Archived topic
Hide sidebar widget on certain categories
3 replies · Started by Tyler on August 3, 2021
Is it possible to conditionally show/hide a sidebar widget (the new block-type widgets in WordPress 5.8) based on the category of the current post?
In older versions of WordPress, the Jetpack plugin had a widget visibility setting which worked fine to do what we wanted, but with the new block widgets it doesn't seem to work.
Maybe Jetpack will add it back in a future version, but we're just wondering if GeneratePress has this ability with Elements or hooks/filters or something?
Hi there,
simplest option would be to disable the Block Widgets ( i kinda feel its not quite fit for purpose just yet ):
https://docs.generatepress.com/article/disable-the-block-editor-in-widgets/
For Block Element, you can hook content in before or after the sidebar
Okay thanks
You're welcome