我是wordpress的新手,我真的需要帮助。我的主站点,列出所有帖子的简历(Except),并分页。但当用户发布新帖子时,在主页上查看它的唯一方法是重新加载它。。。我想知道是否有办法自动显示新帖子,比如facebook。。。。
直到现在我才找到做这件事的方法。
我已经从索引中删除了以下行。php(在/wp-content/themes/wp\\u-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; ?>
我已经把上面的代码放进了一个负载中。php(在同一目录中),并在索引中替换它。php具有:<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>
但是运气不好。。。我收到以下错误:致命错误:调用/var/www/RMON/blog/wp-content/themes/wp\\u-blogger/load中的未定义函数have\\u posts()。php在线1