Disable Sidebar with zero widget

Hi Team,

Is it possible to disable right sidebar if no widget is placed.

at this point some default textual widget appear as soon as i remove all widgets.

I have n number of pages and i don’t want to shift to fullwidth for them all. Is is possible that we can disable sidebar if no content just like twentytwelve and others follow.

Hi Anantshri,

To remove default textual widget, you will need to edit sidebar.php file in rtPanel.
In sidebar.php, remove code from



Thanks for the response.

It would be nice if we have an option to make sure sidebar goes off if no widget is added.
I have solved it by following way:
created a child theme

I have modified two files

  1. Sidebar.php removed the texual section and added the inverse if condition to the sidebar.
    after the first if elseif
if ( ($sidebar_id && dynamic_sidebar( $sidebar_id ) ) ){  
  1. style.css needed a change.
@import url("../rtpanel/style.css");  
@media only screen and (min-width: 64.063em)  
	.large-8 {  
		position: relative;  
		width: 100%;  

In CSS you have used width: 100%; for .large-8 class which is not correct, it will break your grid system. Hope you are using rtPanel Child Theme, in /lib/rtp-custom-hooks-applied.php file you will need to un-comment rtp_set_content_grid_class filter. After that, replace large-8 with large-12 in the same line, so the code will be: add_filter( 'rtp_set_content_grid_class', create_function( '', 'return "large-12 columns";' ) ); If you are using custom child theme, then just add add_filter( 'rtp_set_content_grid_class', create_function( '', 'return "large-12 columns";' ) ); in functions.php. Also do not forget to revert your CSS changes.

Thanks for the update.

I hope this could one day be available as a feature not a custom code based hack.

BTW i am using a custom child with just the above mentioned changes at this point.