WordPress.org

Ready to get started?Download WordPress

Forums

Next page button not displaying older posts (4 posts)

  1. galiberal
    Member
    Posted 4 years ago #

    I recently changed themes on my website (http://www.galiberal.com) and the "Next Page" button on the bottom doesn't work. It changes pages, but all the same posts are still displayed. I'm pretty sure it's a problem how it's querying posts to display the headline-only posts. Here's where I suspect the page query is going astray:

    <div id="headlines">
           <?php $my_query = new WP_Query(array('showposts'=>get_skyye_option('other_posts'),'post__not_in'=>$ignore,'caller_get_posts'=>1)); ?>
    	<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>

    I don't really know much PHP so I really have no clue on how to fix this. I've looked up similar posts on this problem, but they all seemed to deal with categories and not posts on the main page. I tried all the fixes I could find, but to no avail.

    Any help on this would be greatly appreciated!

  2. vtxyzzy
    Member
    Posted 4 years ago #

    I think you need to add the 'paged' parameter to your query like this:

    <div id="headlines">
           <?php
           $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
           $my_query = new WP_Query(array('showposts'=>get_skyye_option('other_posts'),'post__not_in'=>$ignore,'caller_get_posts'=>1,'paged'=>$paged)); ?>
    	<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
  3. galiberal
    Member
    Posted 4 years ago #

    Thank you so much. I thought that was the problem, but just didn't know where to add the Pagination stuff. Once again, thanks!

    Resolved. :)

  4. vtxyzzy
    Member
    Posted 4 years ago #

    Please use the dropdown on the right to mark this topic 'Resolved'.

Topic Closed

This topic has been closed to new replies.

About this Topic