When I’m viewing posts filtered to a category and select next page, it leaves the category and goes to the non-filtered next page. It also does this for tags.
When viewing the above link and select the next page it jumps to
Alright, I’ve found the culprit. CForms.
After submitting a trac and help from a developer it was determined to be CForms.
I am resolving this and opening a new post under CForms.
What do you mean the problem was CForms? I’m having the same issue and curious what kind of solutions there are.
I had no specifics other than when I disabled the plugin, the inter-category page navigation worked properly. I notified the developer of cforms and he quickly gave me a beta which worked. The beta is now part of the stable release from a number of releases ago so if you have the latest cforms it shouldn’t be a problem.
If you don’t have cforms it might be another plugin stepping on the code. Disable all your plugins and check it. If it works enable one at a time (or small group) and test till it breaks. You’ll find which one is breaking it.
I’m having the exact same problem and I don’t have any plugins installed
I have the posts displayed on a “news” page which is actually the category.php page but when I click to see older posts it takes me back to the index.php page.
I’m using this for my navigation:
<div class="alignleft"> <?php posts_nav_link('','','« Previous Entries') ?> </div> <div class="alignright"> <?php posts_nav_link('','Next Entries »','') ?> </div>
Are you using something different?
If I understand you correctly, your code should read
<div class="alignleft"> <?php prev_post_link('%link', '« Previous Entries', TRUE); ?> </div> <div class="alignright"> <?php next_post_link('%link', 'Next Entries »', TRUE); ?> </div>
Thanks for the reply Heriz – I’m quite new to wordpress but isn’t that to display the next single post rather than the next “page” of posts? – I’m probably wrong on this though.
I tried adding the code to the page both inside and outside the loop but this broke the page.
Just to be clear – I have a category page, that’s displaying all the posts in the news category. The posts are limited to 3 so they should be paged. When I click “previous” it seems to go to the index page rather than staying on the category page. Also it says “Sorry, no posts matched your criteria”
I did see something that sounded similar at the bottom of here: http://codex.wordpress.org/Using_Permalinks (Paged Navigation Doesn’t Work ) but I went though the fix with no joy.
Maybe I’ve set my whole loop up wrong. I have:
<?php if (have_posts()) : ?> <ul id="news_list"> <?php while (have_posts()) : the_post(); ?> <li><h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <?php the_title(); ?></a> <span class="date"><?php the_time('F jS, Y') ?></span> </h2> <p><?php $excerpt = strip_tags(get_the_excerpt()); echo $excerpt; ?></p> </li> <?php endwhile; ?> </ul> <div class="navigation"> <div class="alignleft"> <?php posts_nav_link('','','« Previous Entries') ?> </div> <div class="alignright"> <?php posts_nav_link('','Next Entries »','') ?> </div> </div> <?php else : ?> <h2 class="center">Not Found</h2> <p class="center"><?php _e("Sorry, but you are looking for something that isn't here."); ?></p> <?php endif; ?>
Maybe if someone would be kind enough to post their code I might be able to see where I am going wrong or if this is a HTACCESS problem.
- The topic ‘page navigation within category leaves current category’ is closed to new replies.