I want to ajaxify TwentyThirteen WordPress template and I have a function in functions.php
function prefix_ajax_add_foobar() {
echo("add_foobar is trigered <br/>");
if ( have_posts() ) { echo ("have posts <br/>");
while ( have_posts() ) {
the_post(); echo ("the_post() <br/>");
the_ID(); echo ("the_ID() <br/>");
}
}
die("The End");
}
But I only see those results:
add_foobar is trigered
The End
So can you give me an idea why those functions are not working?