Forums
Forums / Fixing WordPress / How to enable / disable sidebar?
(@sub_zero)
11 years, 5 months ago
Hi,
I have created a sidebar which looks like this:
function customSidebar(){ register_sidebar(array( 'name' => 'Custom Sidebar', 'id' => 'sidebar-3', 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>', )); }
This works absolutely fine and I can see my widget when I go to Appearance -> Widgets.
But I would like to have the option to enable or disable that sidebar whenever I want on any post.
How can I do that?
(@contentiskey)
2 thoughts:
I have managed something similar using jetpack widget visibility module ==== Otherwise, use of full width template to remove sidebar pages
The topic ‘How to enable / disable sidebar?’ is closed to new replies.