Remove navigation from header in custom page template

Use a conditional tag:

Codex References:

Function Reference (is_page)

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.

Leave a Comment