I have a simple code in functions.php in wordpress theme
add_filter( 'sidebars_widgets', 'disable_all_widgets' );
function disable_all_widgets( $sidebars_widgets ) {
if ((is_single() || is_home() || is_front_page()) && have_posts())
$sidebars_widgets = array( false );
return $sidebars_widgets;
}
When I in Home page is result OK, but when I click on menu other menu home page is result show all widget, how to disable all widget all pages
If you want to disable all widgets in all pages:
Simply don’t do the check.