• Hi,

    I am working on a website for a walking club using the Astra theme.
    I have a static page as my homepage and two blog pages achieved by adding the post categories of “news” and “walk reports” to my main menu. This works fine until the user clicks through to see the single post details and decides to use the “next post/previous post” navigation links because these links disregard the category and take the user through all the published posts.

    Any thoughts on how I can overcome this or even a re-design to achieve the same objective would be very welcome.
    Pete

    • This topic was modified 2 years ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic
Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @pete1889

    I have tried re-creating your scenario, but mine worked fine. Have you added ‘news’ and ‘walk reports’ to your navigation menu?

    Make sure you used separate Query Loop blocks for your post categories.

    Cheers
    Wes

    Thread Starter Peter Hubbard

    (@pete1889)

    Hi Wes, thanks for your response.
    I have followed your advice to the best of my knowledge but the next/previous navigation on a single post is still ignoring the category and cycles through all posts eventually.
    I might see if I can hide the navigation as I don’t think it’s particularly useful.
    Thanks
    Pete

    Hi @pete1889

    Yes, you can merely remove the Pagination block if you wanted to: https://cloudup.com/cL-7IQgGCGZ

    If you send me a link to your website, I will probably get a better idea.

    Cheers

    Thread Starter Peter Hubbard

    (@pete1889)

    Thanks Wes, I’m just going to go with removing the pagination block for the time being.

    Good luck

    Thread Starter Peter Hubbard

    (@pete1889)

    Hi Wes,
    I have re-visited my original query. I have seen other posts from people with the same issue with solutions that require using the “in_same_term” parameter to ensure that next/previous is within the category.
    However, there are occasions e.g in an archive where you want to browse through every post regardless of category. Do you know if there is a way to say (in pseudocode)
    if browsing within a category
    apply paramter in_same_term
    else
    don’t apply paramter in_same_term
    end if

    thanks
    Pete

    Hey @pete1889

    Unfortunately, I don’t know the answer to that. I suggest creating a separate ticket.

    Keep well

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Navigation in Posts’ is closed to new replies.