• Resolved paddyinthesun

    (@easylifespain)


    Hi, i’ve created a new page template and would like to remove the main navigation menu. I can’t see the code for the main_nav in the new custompage.php so assume the method is through functions.php.

    Can anyone point me in the right direction?? Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    what theme are you using?

    Thread Starter paddyinthesun

    (@easylifespain)

    I’m using affilotheme although i don’t think there are much difference, i would be surprised if people knew this theme. If not, can you tell me how to do it with twentyeleven and i can work it from there.

    Moderator keesiemeijer

    (@keesiemeijer)

    I cannot find the theme. Can we have a link to your site.

    have you looked in header.php for the navigation code?

    Thread Starter paddyinthesun

    (@easylifespain)

    Sure, you can check the website here.

    Moderator keesiemeijer

    (@keesiemeijer)

    On what page(s) don’t you want to show the navigation? Have you looked in your header.php for something simular to this:

    <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>

    Thread Starter paddyinthesun

    (@easylifespain)

    The page i am working on is not live yet as its unfinished. I’ve looked in header.php but can’t find anything like that code.

    Moderator keesiemeijer

    (@keesiemeijer)

    You can hide the menu with css in combination with the body_class() which your theme is allready using.

    This example (in your themes stylesheet style.css) will hide the navigation menu on the “About” page:

    .page-id-34 #wrapper-navigation {
        display: none;
    }

    For a custom page template file “custom_template.php” you could use:

    .page-template-custom-template-php #wrapper-navigation {
        display: none;
    }

    Thread Starter paddyinthesun

    (@easylifespain)

    Tried this but menu is still showing up

    .page_no_nav #wrapper-navigation {display: none !important;}

    Thread Starter paddyinthesun

    (@easylifespain)

    Ok, got it. I can remove it using the first example you gave by using the page id. This is preferable too because i may want some page that use this custom template to have a nav.

    Thanks for your help keesiemeijer!!!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to remove main navigation menu from custom page template’ is closed to new replies.