i’m new in wordpress, and i really need a help here. My main site, list the resume (excrept) of all posts, with pagination. But when a user publish a new post, the only way to see it on the main page is to reload it… I want to know if there’s a way to automatic show new posts , like facebook….
I didn’t found a way to do it untill now.
I’ve removed the following line from my index.php (inside the /wp-content/themes/wp_blogger/):
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php include(TEMPLATEPATH."/excrept.php"); ?>
<?php endwhile; else: ?>
<div class="featured_section">
<div class="featured_in">
<h3 style="margin-bottom:800px;"><?php _e('Nenhum post encontrado com estes critérios.'); ?></h3>
</div>
</div>
<?php endif; ?>
I’ve put the code above inside a load.php (at the same directory), and replace it inside the index.php with:
<script>
$(document).ready(function(){
var callAjax = function(){
$.ajax({
method: "GET",
url: "/RMON/blog/wp-content/themes/wp_blogger/load.php",
success: function(data){
$("#test").html(data);
}
});
}
setInterval(callAjax,5000);
});
</script>
<div id="test"></div>
But no luck with that… i’m getting this error: Fatal error: Call to undefined function have_posts() in /var/www/RMON/blog/wp-content/themes/wp_blogger/load.php on line 1