Archived topic
How to show or hide GP widget on specific pages?
3 replies · Started by Johannes on August 23, 2017
Hi,
How to show or hide GP widget on specific pages? I suppose I can add a custom CSS class to it and the use some CSS?
-Johannes
Hi there,
For sidebar widgets? If so I would recommend this handy plugin:
https://en-ca.wordpress.org/plugins/content-aware-sidebars/
If not then we need to use some CSS. Can you link me to the page and let me know which widgets you would like to hide?
Hi, let say I want to have the search field ( in header ) only on specific pages.
http://www.johannesoedegaard.com/generatepresstest/
- Johannes
Ok so use Tom's Simple CSS plugin: https://docs.generatepress.com/article/adding-css/#simple-css
and add this CSS in the CSS meta box on the pages you don't want the search field:
.header-widget {
display: none;
}
Index pages (blog, archive) need to be handle differently so let me know if you want to hide it on them too.