• Hi – anybody know how to navigate through category page? Completely stumped.

    I’m trying to create a simple ‘Prev / Next’ button that will allow me to Navigate Category pages. By this I mean, not posts within…but the actual Categories themselves (like a nice additional level of navigation)

    I am using the simple category.php template, to display the title of the Categories, it’s description and list the posts contained within..

    Right at the bottom of the category page (outside the loop), I am using the following – which so far only refreshed the same page rather then taking me to the next or previous one.

    I’m sure I’m going about this about face, any advice would be amazing.

    <div class="prev_next">
    <div class="prev_next_text"><a href="<?php previous_posts_link(); ?>"><&nbsp;Previous</div>
    <div class="prev_next_text"><a href="<?php next_posts_link(); ?>">Next&nbsp;></div>
    </div>
Viewing 4 replies - 1 through 4 (of 4 total)
  • Is this what you want?
    How to do pagination on category page

    Thread Starter emergingideas

    (@emergingideas)

    Hey thanks David, that looks like the thing…but I’m not having success with it, my Prev Next links don’t appear at all and I’m stumped. Maybe it’s a permalink set-up issue…but not finding a way to resolve. Have you had success with this before – and tips that might be useful? Thanks

    Moderator bcworkz

    (@bcworkz)

    If you want the next and previous links to go to a different category, I don’t think David’s link will help you. It appears to be working on the same category, paginating posts of that category.

    You’ll need to get an array of all categories in a certain order. Determine where in the array the current category exists, then get the next and previous categories out of the array and construct your links accordingly.

    Sorry, I didn’t understand what you’re asking for.
    So, you want to show the first category with all posts that belongs to it, and when you click on Next/Prev you go to the next/prev Category with all posts listed of that category.

    Is that it?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Navigate Categories with Prev Next’ is closed to new replies.