Pagination Issue
-
Hey all,
I’ve been searching the forum for quite a while to find the solution to this, but all the relevant answers I’m coming up with are not working.
I’m running 2.3.3, and I have the default settings to show posts on the index page, and to show 10 at a time.
In my index.php file, I want only 1 post from a certain category to show, so I’ve used a query to do so.
The issue come in with going back in time – the “next_post” stuff doesn’t work (I’ve tried 3 different tags – all show the link, and ALL links lead right back to the one post showing on the index page.)
right now, I have this (cleaned up extraneous stuff because it serves only layout purposes):
<div id="content"> <?php if(is_home()) { $page = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts('cat=1&showposts=1&paged=$page'); } ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="entry"> post layout stuff here <!--/entry--> </div> <?php comments_template(); ?> <?php endwhile; ?> <p class="navigation"> <?php previous_posts_link(); ?> <?php next_posts_link(); ?> </p> <?php else: ?> <p><?php _e('Sorry, no posts matched your criteria.'); ?></p> <?php endif; ?> <!--/content--> </div>This is the latest version of what I’ve been trying. I’ve also had the closing “}” for the “if(is_home())” stuff just before the closing “content” div tag, and I’ve also used different next/previous tags. But no matter what I do, the link *always* leads to the most recent post on the index page.
Would anyone have any suggestions for me? I just cannot get this to work at all. I’ve even changed he settings so I wouldn’t use a query – just set it back to default – and they *still* won’t work.
The topic ‘Pagination Issue’ is closed to new replies.