- This topic has 11 replies, 4 voices, and was last updated 3 years, 11 months ago by
Ying.
-
AuthorPosts
-
April 11, 2022 at 8:38 am #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, ErikaApril 11, 2022 at 9:05 am #2185250David
StaffCustomer SupportHi 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…
April 11, 2022 at 11:00 am #2185401Erika
April 11, 2022 at 11:26 am #2185428Leo
StaffCustomer SupportCan 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?
April 11, 2022 at 11:48 am #2185449Erika
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
April 11, 2022 at 12:04 pm #2185471Ying
StaffCustomer SupportHi 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.
April 11, 2022 at 12:13 pm #2185478Erika
Hi Ying, I did both. No change.
April 11, 2022 at 12:22 pm #2185484Ying
StaffCustomer SupportI 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.
April 11, 2022 at 12:28 pm #2185487Erika
Obviously I do something wrong. Can I give you a login and you take a look? Might be faster.
April 11, 2022 at 1:32 pm #2185544Ying
StaffCustomer SupportI 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/8pXi6mzzApril 11, 2022 at 1:34 pm #2185546Erika
Hi Ying, yes, I see it working. I also see what I missed. Thank you so much, you are awesome! Erika
April 11, 2022 at 2:26 pm #2185592Ying
StaffCustomer SupportNo problem! Glad it works now 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.