WP类别的无限滚动不会加载所有元素

时间:2015-12-10 16:59:56

标签: php jquery wordpress

我为摄影师设立了一个网站&她希望使用她的博客类别作为她的投资组合,这很好,除了我使用的无限滚动功能不会加载摘录的所有内容。

它省略的两个项目是帖子缩略图(图像)和水平行作为帖子之间的分隔符。

对此有任何见解表示赞赏 - 我使用了Paul Irish的无限滚动插件&类别摘录的调用方式如下:

<?php get_header(); ?>
<section id="content" role="main">
<header class="header">
<h1 class="entry-title"><!-- <?php _e( 'Category Archives: ', 'themename' ); ?> --> <?php single_cat_title(); ?></h1>
<?php if ( '' != category_description() ) echo apply_filters( 'archive_meta', '<div class="archive-meta">' . category_description() . '</div>' ); ?>
</header>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?><div class="cat-thumbs align-right"><?php the_post_thumbnail(); ?></div>
<?php get_template_part( 'entry' ); ?>
<hr />
<?php endwhile; endif; ?>
<?php get_template_part( 'nav', 'below' ); ?>
</section>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

这是输入模板:

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header>
<?php if ( is_singular() ) { echo '<h1 class="entry-title">'; } else { echo '<h2 class="entry-title">'; } ?><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a><?php if ( is_singular() ) { echo '</h1>'; } else { echo '</h2>'; } ?><?php edit_post_link(); ?>
<?php if ( !is_search() ) get_template_part( 'entry', 'meta' ); ?>
</header>
<?php get_template_part( 'entry', ( is_archive() || is_search() ? 'summary' : 'content' ) ); ?>
<?php if ( !is_search() ) get_template_part( 'entry-footer' ); ?>
</article>

作为参考,这就是我如何调用博客的摘录,这没有问题:

<section class="entry-content">
<a href="<?php the_permalink(); ?>" title="<?php the_title();?>"><div class="cat-thumbs align-right"><?php the_post_thumbnail(); ?></div></a>
<?php the_excerpt(); ?>
<em><p>
<?php comments_number( '0 comments', '1 comment', '% comments' ); ?>.
</p></em>
<div class="entry-links"><?php wp_link_pages(); ?></div>
</section>
<hr />

Link to example

1 个答案:

答案 0 :(得分:1)

<div class="cat-thumbs align-right"><?php the_post_thumbnail(); ?></div><hr>移到条目模板中。

相关问题