I have an easier solution using the standard AJAX WordPress guidelines. In your functions.php add the following code:
add_action('wp_ajax_posts_by_tag', 'ajax_posts_by_tag');
add_action('wp_ajax_nopriv_posts_by_tag', 'ajax_posts_by_tag');
function ajax_posts_by_tag() {
$q = new WP_Query('tag=' . $_POST['tag'])
echo '<ul>';
while ($q->have_posts())
{
$q->the_post();
echo '<li>' . $q->post->post_title . '</li>';
}
echo '</ul>';
die();
}
Then, inside your javascript on your homepage, use the following method to retrieve the contents by tag (assuming you're using jQuery):
jQuery(document).ready(function($) {
var data = {
action: 'posts_by_tag',
tag: 'my-tag'
};
jQuery.post(ajaxurl, data, function(response) {
alert(response);
});
});
Something like that. You can then squeeze the response into any block on the page. This will fetch for posts tagged my-tag.