[Support request] Post Navigation limited to category

Home Forums Support [Support request] Post Navigation limited to category

Home Forums Support Post Navigation limited to category

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1527740
    Yael

    Hello,

    I read the other threads in the forum and added the appropriate code snippet to my child theme’s function.php file

    add_filter( 'generate_category_post_navigation', '__return_true' );

    However, the post navigation is not limited to category as you can see here:

    https://aviadrealty.com/gc-free-standing/

    Is there something else I need to do in order to limit post navigation to category?

    #1527766
    Elvin
    Staff
    Customer Support

    Hi,

    However, the post navigation is not limited to category as you can see here:

    Strange.

    Adding this snippet as it is should work without any issues.

    Any chance you could provide use temporary site access so we could check any implementation issues?

    You can provide the site details on the Private Information text field. Thank you.

    A wise man once said:
    "Have you cleared your cache?"

    #1527769
    Yael

    Sure, posted below.

    #1528165
    David
    Staff
    Customer Support

    Hi there,

    i checked one Category and looked at this post: /gc-free-standing and next and previous posts were correct and from the same category.

    Is there a particular post category that its not working ?

    #1528170
    Yael

    Can you share a screenshot b/c on that particular post, I’m still seeing post navigation include posts from all categories?

    #1528178
    Yael

    Okay, just dawned on me, perhaps that shortcode only applies to main categories and not sub categories.

    This website has two main categories with lots of sub categories; I want to limit post navigation to posts within the sub categories, not the main category.

    For example:

    Jerusalem Rentals is the main category but has dozens of sub categories. I want to limit post navigation to the the sub category each post is in…. b/c each sub category is a specific area in Jerusalem

    So for the listing you mentioned, it is in German Colony Rentals (a sub category of Jerusalem Rentals).

    #1529160
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    I’ve just done some looking around for this and I couldn’t find an easy-to-implement solution, unfortunately.

    Using the filter above, is it working for child categories as well as the parent category? So in theory, we just need to exclude the parent category?

    #1529231
    Yael

    Hi Tom. NO need to exclude the parent category.

    Apparently I’m still not seeing what you all are seeing even though I’ve cleared my cache multiple times.

    I still post navigation from other sub categories rather than, for example on the post viewed above, only from the German Colony.

    https://aviadrealty.com/gc-free-standing/

    The listing is under Jerusalem Rentals > German Colony but the before and after posts are from City Center and Abu Tor (two different sub categories).

    So you are seeing before and after listings only within German Colony?

    #1529667
    Yael

    OH, wait, my correction. yes we would need to exclude the parent category as it’s what is pulling in the posts from all the sub categories 🙂

    #1530157
    Tom
    Lead Developer
    Lead Developer

    I’ve been digging some more but I can’t find any solid example, unfortunately.

    The only thing I found is someone saying they only added the child category to their posts (left the parent category un-checked) and that worked for them. Not sure if that’s something that will work in your case?

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.