Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other WordPress: How to get pagination to work in parent and child category

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #44224
    Antone1
    Participant

    I have a parent category titled ‘Latest’ and its children categories titled ‘Painting,’ ‘Illustration,’ ‘Photography,’ etc. I’m using the following code in my single.php page from [Wordpress Codex](http://codex.wordpress.org/Template_Tags/next_post_linkhttp://codex.wordpress.org/Template_Tags/next_post_link”) to get the pagination to flip through posts within the same child category. All works well.

    However, when I enter the post from the parent category, it reverts back to flipping through posts within the child category it pertains to, not the parent. I was hoping to get it to work for parent too. Apparently, it confuses visitors.

    I was suggested to use [Ambrosite Next/Previous Post Link Plus](http://wordpress.org/extend/plugins/ambrosite-nextprevious-post-link-plus/http://wordpress.org/extend/plugins/ambrosite-nextprevious-post-link-plus/”) plugin, but it doesn’t seem to help my problem.

    I’ve been trying really hard to get this to work (with and without plugin) but with no luck. I thought it would be simple to do. If anyone can help me, I’d greatly appreciate it!

    #132369
    Antone1
    Participant

    I seem to have solved the problem. Use the code above from WordPress Codex. Then make sure that each post has child and parent categories checked off when managing each post.

    I only had child category checked off which is probably why the pagination wasn’t working correctly when entering a post from the parent category.

    Simple solution. Not sure why I didn’t see that. Sorry about that.

    #132370
    Antone1
    Participant

    I would like to mark this topic as solved, but I don’t see that option. Anyone?

    #132371
    Antone1
    Participant

    Found it. Done!

    #132895
    Antone1
    Participant

    I thought I solved the problem but I just realized I didn’t. Now that I have both child and parent categories checked off, when entering the post from the child category, it flips through the parent category.

    I learned and tried using Sessions and Taxonomies but it didn’t work. Then again I’m very new to Sessions and Taxonomies so maybe I’m not understanding something.

    Again, I’m trying to get the next/previous post links to work within the same category for child and parent. Is this possible?

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Other’ is closed to new topics and replies.