Category display navigation problem
-
I have looked all around the forums and not found this issue. I have set up theme templates for archive display. I have pages that are categories so that when you navigate to the category page you see the first 5 posts in that category (e.g. domain.com/commercial shows posts in the category commercial) I use the same nav for next and previous as on the index page in the template that also shows the 5 most recent posts. On the index page the nav takes you to the previous 5 or the next 5 in order of date. In the categorized posts the nav takes you to a link like domain.com/commercial/page/2/ and the same first 5 posts are shown even though there are plenty of posts in the category. Here is the code. If anyone can see what I am missing or point me to the error of my ways I will appreciate it.
<?php /* Template Name: Archive Page */ ?> <?php define('WP_USE_THEMES', true); get_header(); ?> <div class="archivepage"> <div id="all-wrap"> <div id="contentarea" class="clearhere"> <h1><?php echo ucwords($pagename);?> Archive</h1> <?php query_posts('category_name='.get_the_title().'&post_status=publish,future');?> <div class="navigation ntop"> <div class="alignleft"><?php next_posts_link('« Older Entries') ?></div> <div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div> </div> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <h3><a href="<?php the_permalink();?>"><?php the_title(); ?></a></h3> <h4><?php the_date();?></h4> <p class="post-text"> <?php the_content();?> </p> <p class="postmetadata alignright"> <?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> </p> <?php endwhile; else: ?> <p><?php _e('Sorry, no posts matched your criteria.'); ?></p> <?php endif; ?> <div class="navigation nbottom"> <div class="alignleft"><?php next_posts_link('« Older Entries') ?></div> <div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div> </div> <p style="clear: both;"></p> </div> </div><!-- end all-wrap--> </div> <?php get_footer(); ?>
I also tried
<?php previous_posts_link('Newer Entries »',$in_same_term = false) ?>
but it did nothing different.
Thanks for any help.
- The topic ‘Category display navigation problem’ is closed to new replies.