• 0
Sign in to follow this  
Followers 0

Add/remove custom widget areas

Question

Posted · Report post

Hi, I am using Platform Pro. I would like to be able to add or remove (more importantly remove) the widgetized areas that are displayed in the "Dashboard > Appearance > Widgets" area. For example, I want only the 'primary sidebar' and the pagelines 'universal sidebar' to be displayed and all other sidebars to be hidden. How can I achieve this? Thanks, Luke

Share this post


Link to post
Share on other sites

8 answers to this question

  • 0

Posted · Report post

Do you mean that you want to remove them from the Widgets settings page on the Dashboard permanently or you want to remove them from your site? If it's the latter, you can disable the sidebars you want by going to Settings > Template Setup.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi Catrina, I mean that I want to remove them from the Widgets settings page on the Dashboard permanently. Similar to this modification to "functions.php" to remove default widgets...

add_action( 'widgets_init', 'remove_default_widgets' );
	function 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');
	}

But in this instance I want to remove the sidebar options available.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi Adam, I'm really new to php but keen to learn more. I understand that have to add the following code to my "child theme" functions.php file...

add_action( 'widgets_init', 'remove_some_widgets', 11 );
	function remove_some_widgets(){
	unregister_sidebar( 'first-footer-widget-area' );
	}
And for each line of this line
unregister_sidebar( 'first-footer-widget-area' );
I need to be replace the
first-footer-widget-area

with the name of the pagelines sidebar. What are the names of the pagelines sidebars? And where should I have looked to find the name of the pageline sidebars? Can you find the names of things like this using Firebug? If so, can you let me know how? Thanks, Luke

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I believe you can just use sidebar-1, sidebar-2, etc in the order that they show up.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi Adam, Thanks, that worked. Is there something that I could have done to figure this out myself that it was 'sidebar-1, sidebar-2, etc' ? I am asking because your answer may help me to solve more issues like this in the future more easily. Cheers, Luke

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

You asked earlier about firebug.. basically just right click the sidebar in question, click "inspect element," and it'll take you to the general vicinity of the sidebar code for that page. You should be able to see the IDs and classes.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi Tim, Thanks, I was having a look around in firebug but am new to that too, and didn't understand how, or if, firebug related to php, but Ive just had another look and I see the ID and classes that Adam refered to above. That's a big help and with Adams reference above to wordpress codex I should be able to figure a few more things out now more easily. Thank you all. Luke

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0