2013-05-04 77 views
3

我无法在我的网站上找出这个分页问题。问题是第2页显示与第1页相同的内容。它不应该这样做。Wordpress Kriesi分页问题

<?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(); ?> 

This is the site for Kriesi pagination.

Site

+0

尝试一个不同的插件。我使用[PageNavi](http://wordpress.org/extend/plugins/wp-pagenavi/),效果很好。 – elclanrs 2013-05-04 01:00:52

回答

4

您在查询中未使用分页参数paged。你这样使用它:

<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?> 
$args = array('post_type' => 'baseball-news', 'posts_per_page' => 5 , 'paged' => $paged); 
+0

非常感谢!这似乎已经成功了!你今天教了我一些新的东西哈哈。 – BMS 2013-05-04 18:55:07