Post Pic

How to: Remove widget areas on your blog homepage without editing template files

Ever wanted to be able to remove your widgetized areas (Sidebar, most of the time) on your blog homepage, but don’t feel like editing your theme files? No problem, here is the solution.

To do so, simply add the following code to your functions.php file:

<?php
add_filter( 'sidebars_widgets', 'disable_all_widgets' );

function disable_all_widgets( $sidebars_widgets ) {
	if ( is_home() )
		$sidebars_widgets = array( false );
	return $sidebars_widgets;
}
?>

That's all, no more widgetized areas are displayed on your homepage.

Credits goes to Justin Tadlock for this awesome recipe!

One Response

Jan 17 2013 04:45

thanks mate, ive already hide one of my widget on my homepage.

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required

WP Theme of the week

Sponsored Likebox