Quantcast
Channel: Crunchify
Viewing all articles
Browse latest Browse all 1037

WordPress: How to Disable Sidebar Widget on Specific Post/Page

$
0
0

WordPress Icons

Hello WordPress Users,

Sometimes you need to disable Sidebar Widget on Specific Post/Page. Below simple code snippet will help you to perform the same.

add_filter( 'sidebars_widgets', 'crunchify_code_disable_widgets' );
function crunchify_code_disable_widgets( $sidebars_widgets ) {
        if (is_single(array(5,123,43,54))) // replace this with post/page ID
                $sidebars_widgets = array( false );
                return $sidebars_widgets;
}

Enjoy and Have a fun..!!

The post WordPress: How to Disable Sidebar Widget on Specific Post/Page appeared first on Crunchify.com.


Viewing all articles
Browse latest Browse all 1037

Trending Articles