skip to Main 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 WPCode)
Back To Top