Use a conditional tag:
Codex References:
Function Reference (Conditional Tags)
You can specify the landing page by Page ID, Page Title or Page Slug.
Here is an example:
<?php if ( !is_page( 'landing-page' ) ) {
wp_nav_menu( array(
'show_home' => 'Home',
'container' => 'false',
'theme_location' => 'main')
);
}
endif;
?>
It excludes the page (in this case the page with the slug “landing-page”) by placing the !
in front of is_page
No need for javascript, this should do the trick.
Related Posts:
- How to get IDs for objects in menu branch?
- Check if a menu is empty?
- Dynamically link to the latest post or simulate request of specific post in page template
- Show only 2nd level of navigation depending on active navigation
- Show all parent pages and their children below from same author as currently viewed page
- How to retrieve depth of menu into template
- Output menu navigation in php file
- How do I render a navigation menu like my theme does?
- How to make the Primary Menu stay the same in the PC and mobile versions of the Twenty Sixteen theme
- Change submenu markup
- How to modify wp-includes without messing my wordpress installation?
- pull non-wp site into content area of wordpress -or- pull wp header into non wp site?
- WordPress template – How to add class to li tag if submenu exist
- How can I switch pages?
- How can template identify what page it’s being used on?
- Prevent menu from loading in a page template [duplicate]
- Add a submenu to wp_nav_menu
- Automatically going to the first page in a hierarchy?
- How to add search to menu?
- Wp_list_pages not showing children with custom page template
- Is it all right to put the whole tag into template_part file?
- Swap out a page that is a parent to a many many pages
- Create link/button to create new post using specific template
- Add a non-dynamic phrase/character after a page title?
- How to add class and span to
- Programatically retreive page content from its template page
- Custom Menu based off custom header
- wp_nav_menu doesn’t show on index page
- Setting up menus before making a template live
- How does WP knows which template to use for a page
- Dynamically exclude menu items from wp_nav_menu
- adding some custom html code to the wp_nav_menu function
- non-clickable placeholder in the menu
- How to Move the Author Metabox into the “Publish” metabox?
- How do you get the current-menu-item ID?
- How do I give class to the dropdown sub-menu in the wp_nav_menu?
- child theme automatically adds new page to top menu instead of only custom menu
- Hide pages depending on role
- Add custom SVG icons to Social Icon MENU in WordPress Twenty Seventeen Child Theme
- how to only add a top-level admin menu without it creating a sub-level-menu
- wp_nav_menu – page template name as item class
- Strange behavor of wp_nav_menu by not appearing [closed]
- Keep parent page active
- Subpages in Menu Editor not Nesting
- bootstrap-navwalker will not load
- Check if menu id = $specific_id – then insert specific
- Menu / div of year and months of blog posts?
- How to replace the page url for the page slug in a menu link?
- How to insert link to the default post archive into a menu
- Add css class to dropdown
- current-menu-item class is not added
- wp_nav_menu add class to child item with sub child
- How to remove menu installed in wp-admin by a theme? [closed]
- Add Buddypress profile and messages link to WordPress menu [closed]
- Use wp_logout_url() in menu creation page
- Active Menu Highlighter with Subpages?
- Insert a div class inside wordpress menu
- Retrieve Menu name for nav_menu_item
- Wrapping link and .sub-menu with wp_nav_menu
- Bootstrap button menu on wordpress
- Want to add different text after each menu item
- How to create a menu item which is not a page
- Is it possible to make the heading on a page different text to the text of the menu item?
- How to Structure Pages and Subpages
- Add extra menu to theme
- Force WordPress to NOT display the manual excerpt
- How to list only root pages?
- Search if menu item has child in wp_get_nav_menu_items hook
- How to customize navigation menu in theme which is converted from pure html theme
- WP nav menu + Bootstrap, add role=”menu” to UL
- Custom HTML output for registered navigation
- 2 item in a same menu pointing to 1 page
- Setting or plugin for showing submenus horizontally under the main menu, and keep them after selection
- New wp menu menu styling
- How do I make it so a post only shows in its category archive but not the home page?
- Prevent header and footer from loading on specific pages with template or plugin
- Bootstrap Menu bar shows up a toggle in Desktop Mode
- Mobile menu displays submenus on top of parent. Need it to display right below on an own line
- For a menu custom link (without a link) a “#” is appended. Can this just be blank, i.e. NO link?
- Why does a custom php code inside a custom template not get executed?
- Highlight inner post menu current item
- Menu dropdown disapears behind slider
- Generate Submenu based on Parent Page using If Statement
- WordPress form submit to custom page template does not work
- how to change single post link
- Any simple way to show 10 previous pages by id to current page in links as a menu
- Vertical Menu items shifting to same line when window size increased [closed]
- Submit form to another template (ugly url)
- Pass $item->description to start_lvl
- Menu on responsive twentytwelve theme not working, strange url error
- Access CSS Classes specified in Menu options
- Query for menus in backend (BE)
- How to output the menue structured for tabbed navigation?
- Add more levels to menu
- WordPress Navigation
- Showing Custom Menus in the sidebar
- How to set up suhosin.ini for unlimited menus
- Making current_page_item work with wp_list_pages in sidebar on post pages
- How to centre menu items on horizontal nav bar? (e.g. make margins equal) [closed]
- Display sub menus as separate lists