Pagination Displaying Same Content
-
I’m trying to get pagination working on a test site that I’m developing with the hope to add Ajax to use a load more function however at present my pages display the same 5 posts every time I click on the next page link. Would appreciate some advice on this
<?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; $args=array( 'caller_get_posts'=>1, 'offset' => 1, 'orderby' => 'title', 'order' => 'DESC', 'posts_per_page' => 5, 'paged' => $page ); $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); ?> <article class="row sub-article"> <a href="<?php the_permalink();?>" title="<?php the_title();?>"> <div class="col-xs-4"> <?php the_post_thumbnail('secondary-thumb', array('class' => 'img-responsive')); ?> </div> <div class="col-xs-8"> <h4><?php the_title();?></h4> </div> </a> </article> <?php endwhile;} ?> <?php posts_nav_link(); ?> <?php wp_reset_postdata(); ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Pagination Displaying Same Content’ is closed to new replies.