Problem with Pagination
-
Hi there,
I have a strange problem with Pagination not working correctly,the page displays fine, the news feed loads & the next button goes to /page/2
The problem is the content on page 2 is exactly the same as page 1. Also it doesn’t go any further than page 2.Here’s my code which ive customized accordingly
<?php $current_browsing_author = $wp_query->queried_object_id; // Get current browsing author $sticky = get_option( 'sticky_posts' ); rsort( $sticky ); $sticky = array_slice( $sticky, 2, 5000 ); $args = array( 'post_type' => 'update', 'posts_per_page' => 6, 'orderby' => 'date', 'post_status' => 'publish', 'post__in' => $sticky, 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1), ); query_posts($args);?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post();?> <div class="row tabs-border-top"> <?php $attachment_id = get_post_thumbnail_id(); // attachment ID $image_attributes = wp_get_attachment_image_src( $attachment_id,'full' ); // returns an array ?> <div class="large-2 small-3 columns" style="background-image: url('<?php bloginfo('template_directory'); ?>/imageResizer/imgresize.php?src=<?php echo $image_attributes[0]; ?>&h=475&w=480&q=95');"></div> <div class="large-10 small-9 columns hub-updates-padding"> <div class="hub-updates-padding"> <h4><a href="<?php the_permalink(); ?>"><?php echo substr(get_the_title(),0,58); ?></a></h4> <div class="news-feed-categ"> <?php the_category(', '); ?> </div> <p> <?php echo get_excerpt(280); ?> </p> </div> </div> </div> <?php endwhile; ?> <div class="navigation"> <span> <?php next_posts_link('Older ?') ?> </span> <span> <?php previous_posts_link('? Newer') ?> </span> </div> <?php else : ?> Sorry, no posts were found. <?php endif; ?> <?php wp_reset_query(); ?>
Now this loop is inside of tabs & im not sure wether that could be causing an issue.
Any help with be appreciated – thanks
- The topic ‘Problem with Pagination’ is closed to new replies.