http://dthudson.com/ccr/archive-issues/
分页的页面由您在底部(帖子下方)看到的内容填充,但当您单击“2”时,它会加载第2页,但显示完全相同的帖子。我想指出,我正在使用高级自定义字段从帖子类型“issues”中检索内容,我想知道这是否是问题的根源。另外,我从索引页和搜索页复制了分页代码,每一个都很好。有什么想法吗?
<!-- BEGIN LOOP -->
<?php
$args = array(
\'post_type\' => \'issues\',
\'posts_per_page\' => \'9\',
\'order\' => \'ASC\',
\'orderby\' => \'meta_value_num\'
);
$my_query = new WP_Query( $args );
if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post();?>
<div class="loop four columns hover-issue">
<div class="column-nest">
<a class="hover-color" href="<?php echo get_permalink(); ?>"><h5 class="staff-title big-top-space"><?php the_field(\'release_season\'); ?> <?php the_field(\'release_year\'); ?></h5>
<h6 class="staff-name bottom-space"><?php the_field(\'issue_number_full_length\'); ?></h6></a>
</div> <!-- column-nest -->
<figure class="staff-photo-border">
<a href="<?php echo get_permalink(); ?>"><img class="column-nest image-width" src="<?php the_field(\'issue_image_cropped\'); ?>" alt="photo of issue <?php the_field(\'issue_number\'); ?>" /></a>
</figure> <!-- staff-photo-border -->
</div> <!-- loop four columns -->
<?php the_content(); ?>
<?php endwhile; endif; ?>
</div> <!-- looper twelve columns -->
<nav class="pagination">
<?php
$total_pages = $my_query->max_num_pages;
if ($total_pages > 1){
$current_page = max(1, get_query_var(\'paged\'));
echo paginate_links(array(
\'base\' => get_pagenum_link(1) . \'%_%\',
\'format\' => \'page/%#%\',
\'current\' => $current_page,
\'total\' => $total_pages,
\'prev_next\' => False,
\'type\' => \'list\',
));
}
?>
</nav><!--end pagination-->