我可以得到加載指標顯示,但沒有更多的帖子加載。我試着用'render'和主題名稱,模板部分內容而不是content.php來做事情,在while循環中添加另一個帶ID的div。任何幫助將非常感謝。WordPress的Jetpack無限滾動
的index.php
<?php get_header(); ?>
<div class="tagline">
<!-- General > Settings > Tagline -->
<?php echo get_bloginfo('description'); ?>
</div>
<?php get_template_part('content', get_post_format()); ?>
<?php get_footer(); ?>
content.php
<div id="content">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<section class="gallery">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article class="post-item">
<?php
if (has_post_thumbnail()) {
echo '<a href="' . get_permalink($post->ID) . '" >';
the_post_thumbnail('thumbnail');
echo '</a>';
}
?>
<h2 class="post-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="
<?php the_title_attribute(); ?>">
<?php the_title(); ?></a></h2>
</article>
<?php endwhile; else: ?>
<p>
<?php _e('Sorry, no posts matched your criteria.'); ?>
</p>
<?php endif; ?>
</section>
</article>
</div><!-- content -->
的functions.php
add_theme_support('infinite-scroll', array(
'container' => 'content',
'footer' => 'false'
));