Next/Previous links in a custom post loop not showing up
-
Ok. I am going a little crazy over this. The next and previous links don’t show up in my custom loop, which is on a page template (not the home page). I’ve looked at several posts on this board and others, and none of the solutions seem to work for me.
If I echo out the $page var I get the default 1, so I figure I must be missing some global… Any help will be much appreciated.
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $sgallery_loop = new WP_Query( array("post_type" => "galleries", "post_status" => "published", "paged" => $paged, "posts_per_page" => "1", "caller_get_posts" => 1) ); ?> <?php while ( $sgallery_loop->have_posts() ) : $sgallery_loop->the_post(); ?> <nav class="postnav"> <div class="older"> <p><?php next_posts_link('« Older Entries') ?></p> </div> <div class="newer"> <p><?php previous_posts_link('Newer Entries »') ?></p> </div> </nav> <div id="galllery-<?php echo $sectionID; ?>" class="section"> <h3><?php the_title(); ?></h3> <?php endwhile; ?><!-- End Gallery Loop -->
Links to other posts
https://weblogtoolscollection.com/archives/2008/04/19/paging-and-custom-wordpress-loops/
https://www.ads-software.com/support/topic/pagination-with-custom-post-type-listing
https://www.ads-software.com/support/topic/custom-posts-pagination
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Next/Previous links in a custom post loop not showing up’ is closed to new replies.