Site logo

[Resolved] Excluding category on blog site

Home Forums Support [Resolved] Excluding category on blog site

Home Forums Support Excluding category on blog site

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #2185232
    Erika

    Hi David,
    I´d like to exclude the category “kundenstimmen” on the blog-site which was created with block elements. I used the code snippet from the topic #2175464, category ID is 27, so I have -27 in the code. I cleared all caches, however, the category is still shown, could you take a look?
    Thanks, Erika

    #2185250
    David
    Staff
    Customer Support

    Hi there,

    can you share a link to the topic where you got the Code Snippet ? If you right click and copy the #2175464 on that topic it will give you the URL…

    #2185401
    Erika
    #2185428
    Leo
    Staff
    Customer Support

    Can you try this code instead?
    https://docs.generatepress.com/article/exclude-categories-from-posts-page/

    If it still doesn’t work, can you disable the block element content template and see if that works?

    #2185449
    Erika

    Hi Leo,

    no, it doesn´t work, either way 🙁

    Which works is if I disable the Blog site as Blog site in the WP settings and I add a recent post widget with the category excluded to the Blog site, but that would need a lot of css to style and I really like the way you create block element templates… Much nicer. Actually if we had a way to create a recent post template with the possibility to choose or exclude categories, that would be awesome. Till then, do you have another suggestion for me?

    Erika

    #2185471
    Ying
    Staff
    Customer Support

    Hi Erika,

    The code Leo provided should work.

    Can you try clearing cache and disable cache plugin?

    Make sure you clear your cache plugin and browser cache as well.

    #2185478
    Erika

    Hi Ying, I did both. No change.

    #2185484
    Ying
    Staff
    Customer Support

    I just tested the code and it works well.

    So can you disable all plugins except GP premium to test the code?

    If you have any other custom functions, please disable them as well.

    And can you share the exact code you are using? Please use the code tag to wrap the code so we can check the format.

    #2185487
    Erika

    Obviously I do something wrong. Can I give you a login and you take a look? Might be faster.

    #2185544
    Ying
    Staff
    Customer Support

    I logged in and activate the code in code snippet plugin and it seems working well, I don’t see the posts from category Kundenstimmen on the blog page.
    https://www.screencast.com/t/8pXi6mzz

    #2185546
    Erika

    Hi Ying, yes, I see it working. I also see what I missed. Thank you so much, you are awesome! Erika

    #2185592
    Ying
    Staff
    Customer Support

    No problem! Glad it works now 🙂

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