Php Wordpress Kriesi分页问题
我在我的网站上很难找到这个分页问题。问题是第2页显示的内容与第1页相同。它不应该这样做Php Wordpress Kriesi分页问题,php,wordpress,wordpress-theming,Php,Wordpress,Wordpress Theming,我在我的网站上很难找到这个分页问题。问题是第2页显示的内容与第1页相同。它不应该这样做 <?php $args = array( 'post_type' => 'baseball-news', 'posts_per_page' => 5 ); $baseball_loop = new WP_Query( $args ); while ( $baseball_loop->have
<?php
$args = array( 'post_type' => 'baseball-news', 'posts_per_page' => 5 );
$baseball_loop = new WP_Query( $args );
while ( $baseball_loop->have_posts() ) : $baseball_loop->the_post();
?>
<?php
if ( get_post_type() == 'baseball-news' ) : ?>
<?php include( TEMPLATEPATH . '/includes/show-baseball-posts.php' ); ?>
<?php endif; ?>
<?php endwhile; ?>
<?php kriesi_pagination($baseball_loop->max_num_pages); ?>
<?php wp_reset_query(); ?>
.您没有在查询中使用分页参数paged。您可以这样使用它:
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
$args = array( 'post_type' => 'baseball-news', 'posts_per_page' => 5 , 'paged' => $paged );
$args=array('post\u type'=>'棒球新闻','posts\u per\u page'=>5,'paged'=>$paged);
尝试其他插件。我用,效果很好。万分感谢!这似乎成功了!你今天教了我一些新东西,哈哈。