0

Hey guys here is the problem I have added 2 sidebars to my blog, however when I change their visibility to only appear on front page and when I click on a specific post ALL of the default widgets available appear for some reason. How do I change that?

2
  • How are you setting widget's visibility, are you using any plugin ?
    – bravokeyl
    Aug 21, 2014 at 8:49
  • I am setting the invisibility correct the problem is where I set them to hidden ALL the default plug-ins appear. The problem is in the template it overrides with the plug-in I think. Aug 21, 2014 at 12:07

1 Answer 1

0
function wpsites_remove_default_widgets() {
     unregister_widget('WP_Widget_Pages');
     unregister_widget('WP_Widget_Calendar');
     unregister_widget('WP_Widget_Archives');
     unregister_widget('WP_Widget_Links');
     unregister_widget('WP_Widget_Meta');
     unregister_widget('WP_Widget_Search');
     unregister_widget('WP_Widget_Text');
     unregister_widget('WP_Widget_Categories');
     unregister_widget('WP_Widget_Recent_Posts');
     unregister_widget('WP_Widget_Recent_Comments');
     unregister_widget('WP_Widget_RSS');
     unregister_widget('WP_Widget_Tag_Cloud');
     unregister_widget('WP_Nav_Menu_Widget');
 }
 add_action('widgets_init', 'wpsites_remove_default_widgets', 11);

Add this in your functions file or a site specific plugin.

Uses unregister widget

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.