wordpress snippets last updated   : September 29, 2014
we now have 639 snippets

Disable widget areas on specific pages of your blog

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will disable widgets on the specified page.

snippet :  PHPcopy
<?php
add_filter( 'sidebars_widgets', 'disable_sidebar_widgets' );
function disable_sidebar_widgets( $sidebars_widgets ) {
	if ( is_page('about-me') )
		$sidebars_widgets = array( false );
	        return $sidebars_widgets;
}
?>

Did you like this post? If so please share it with your friends. Thanks!