Archived topic
Include or Exclude Widgets from certain pages
2 replies · Started by Scott on March 31, 2017
Does the GP theme have a way to include or include a widget (in this case, an ad wodget) from certain pages or classes of page?
Hi Scott,
I think the easiest way would be using this plugin and turn them into shortcode:
https://en-ca.wordpress.org/plugins/widget-shortcode/
Then we can insert them into GP hooks with some conditional statement:
https://docs.generatepress.com/article/hooks-overview/
http://demo.generatepress.com/hook-locations/
https://codex.wordpress.org/Conditional_Tags
If you let us know the condition you are wanting to display/exclude them, we can for sure help with the code :)
If you're only wanting some widgets to display or not display on specific page sidebars, you can use a plugin like Content Aware Sidebars.