Skip to content

Snippet: Hide Menu Search When Using Custom Menus

// Disables the search in the menu when a custom menu is being used on the page
add_filter( 'totaltheme/header/menu/search/is_supported', function( $check ) {
	if ( get_post_meta( get_the_ID(), 'wpex_custom_menu', true ) ) {
		return false;
	}
	return $check;
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top