You should be able to short circuit the menu by conditionally return
ing an empty string by adding this code to your theme functions.php
:
add_filter( 'pre_wp_nav_menu', 'wpse_210095');
function wpse_210095($menu) {
if (is_home()) {
$menu = '';
}
return $menu;
}
You can see in the Core where this logic executes:
260 $nav_menu = apply_filters( 'pre_wp_nav_menu', null, $args );
261
262 if ( null !== $nav_menu ) {
263 if ( $args->echo ) {
264 echo $nav_menu;
265 return;
266 }
267
268 return $nav_menu;
269 }
Related Posts:
- Dynamically exclude menu items from wp_nav_menu
- How to Add to Each Menu Link with link text to data-attr?
- Removing link ” from ” menu for some “links” without JS
- Call custom field into menu item
- Multi Level Bootstrap Navigation Menu in WordPress
- Determine if a navigation item has children
- Bootstrap dropdown nav pills not working with wp_nav_menu()
- Add Page ID class to nav menu items
- Links open only on new tab or window
- Bar separated navigation by extending Walker_Page
- How to Create a Custom WordPress Navigation Menu with the Code?
- how to automatically generate hierarchical menus from hierarchy of pages?
- Why is ‘nav_menu_item_args’ filter’s $item argument empty?
- Add sidebars to navigation menu?
- Add custom text to menu
- Menu styling for last menu item
- How to insert custom code into wp_nav_menu structure?
- Menus like a CMS
- Remove li from wp_nav_menu
- Adding post excerpt into navigation menu
- Adding Custom “Current Menu Item” class to navigation?
- Use wp_nav_menu to display ALL pages
- Third level navigation class
- How to add a submenu toggle button inside all “li” elements that have a submenu?
- get_query_var(‘post_type’) not returning in a filter
- Prev / Next menu item
- Navigation Menus Depth for specific menus
- wp_nav_menu() with multiple Class
- add span class and i tag inside wp_nav_menu link anchor tag
- I am facing a problem with the navigation menu of my website
- Prepend to start of WordPress nav loop
- Grey out nav buttons unless is_user_logged_in()
- You do not have permission to create Navigation Menus – Twenty Twenty-Two theme
- How to approach this menu design?
- Trying to Create Menu in WordPress
- Creating a navigation menu to see where you are on your website
- Automatically list top level menu item child pages
- Check if menu_item has children or has parent
- wp_page_menu not working right?
- How can I add text to a single nav menu item?
- Alternative to wp_get_nav_menu_items?
- Using Zurb’s Foundation Tabs as WordPress Nav (Active Tab)
- Using my WordPress menu on another platform
- Links do not open from click, only in new tab [closed]
- How to get rid of the home link in nav menu?
- How to remove dropdown from wp_nav_menu
- Add a submenu to wp_nav_menu
- Walker menu not displaying at all
- display menu as table layout
- Show children (sub-navigation) of active menu item only
- Menu Arrow for Child Element
- How to make wordpress nav menu use post custom meta data
- Adding a unique ID to each sub-menu
- How to add css to single navigation text? [closed]
- add another html tag after li element in wp_nav_menu
- My navigation menu isn’t working. What happened? Please help!
- Odd spacing in Navigation Bar [closed]
- wp_list_pages Hierarchical Help
- How to avoid the and which added when custon menu widget is used
- How to add a menu that belongs to parent blog to all child-blogs?
- Blending Foundation’s Tabs with WordPress Nav Menu & Display Active Tab
- Editing the nav menu?
- How to change how WordPress renders navigation menu on Block Themes
- Problem with links once in portfolio item
- Add Different Class on Different Ul in twenty-twentyone theme
- Nav Menu: Theme Location not working
- Is it all right to put the whole tag into template_part file?
- How to remove empty line space in navigation menu?
- Is it possible to get_the_post_thumbnail (Featured Image) inside a sprintf function?
- Misleading behaviour on Menu & Theme location
- What is inside in $item in start_el function in Walker_Nav_Menu class
- Disable Top Nav Bar on Mobile
- Building a menu from a large number of pages?
- Show thumbnail to category items in wp_nav_menu(), how?
- How to select particular menu position in wordpress?
- Links in new menu don’t work
- Conditional Nav Menu Inside Nav Menu Across Multisite Sites
- Programmatically add a Navigation menu and menu items
- Site-wide tabs at WordPress website?
- Creating custom Menu for custom theme
- How to add class and span to
- Add dynamic content block to nav section generated by custom walker
- Next/previous a-like single navigation
- How to output the menue structured for tabbed navigation?
- Walker for menus
- wp_nav_menu: indicate by id page grandparents
- WordPress Navigation
- How to call either page name as the nav link or navigation title?
- How to get wordpress navigation to work
- Navigation list not correctly styled on pages with custom template (missing .current-menu-item)
- How do I show a different secondary navigation menu for each section of my website?
- Add a navigation menu item using MySQL
- how to make a walker to this (in bootstrap, i try but not work)
- How was this menu system created?
- Display sub menus as separate lists
- Site navigation sits unstyled for a second on page reload [closed]
- how can i get the page_ID in nav li [closed]
- How do i add logo in wordpress studiopress (glam theme)?
- Add featured posts to nav menu
- WordPress “add to menu” button not working