Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress Kriesi Pagination Issue

I'm having trouble figuring out this pagination issue on my site. The problem is that page 2 shows the same content as page 1. It's not supposed to do that.

<?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.

like image 573
MrMachoman86 Avatar asked Dec 28 '25 09:12

MrMachoman86


1 Answers

You are not using pagination parameter paged in your query. You use it like this:

<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
$args = array( 'post_type' => 'baseball-news', 'posts_per_page' => 5 ,  'paged' => $paged );
like image 184
user850010 Avatar answered Dec 30 '25 23:12

user850010