Archived topic
Disable elements on Blog-page does not work
3 replies · Started by steffen-bachmann on May 15, 2018
Just found, that disable elements on the blog-page is not working, on all other pages it works.
Also... how can i use disable elements and other features on category-pages?
At the moment, i disable the footer-widgets with that css:
body:not(.home) .footer-widgets{display: none;}
On all pages i can set the number of widgets in the footer to 0 (per page), so in the start-page i have 3 footer widgets visible, but on blog-page this is not working.
I also tried to disable e.g. primary navigation on blog-page, its also not working.
Thanks
Steffen Bachmann
Hi there,
WordPress ignores all metabox values on index pages (blog, archive etc) by default which is why it isn't working.
I would recommend using the filter to set footer widgets in this case:
https://docs.generatepress.com/article/footer-widgets/#changing-the-numbers-of-widgets-using-a-filter
Let me know if you need specific condition, I can provide the full code :)
Ah, ok, i understand. I did not know that.
The solution via filters looks complicated to me. At the moment my css-snippet works fine for me.
In case that not, i can negate the condition (i think):
Define globaly 0 widgets in footer, so on blog and other pages they should not appear, but set for individual pages the widgets.
Sometimes i think too complicated, sorry ;)
Yup that's a good solution too :)