WordPress.org

Forums

excluding menu/navbar from specific page (3 posts)

  1. JohannRosenzweig
    Member
    Posted 3 years ago #

    Greetings,
    I use the "twenty eleven" theme and have a problem with the menu/nav bar above linking to the pages I set up. I like to exclude the menu on one page. I know it sounds odd, but I have a different navigation there. All pages are set up as default. The code below was what I found in my CSS. So I was wondering if and how to do it there.

    Details: I got the page ID of the particular page I want to exclude and know I must not do it in the header. I´m not configurating the orignal, I´m working in a child theme.

    Help is appreciated, thanks in advance
    JR

    [CSS moderated as per the Forum Rules. Please just post a link to your site.]

  2. hotplugin
    Member
    Posted 3 years ago #

    u can use if(!is_page(your_page_number)):wp_nav_menus;

    on your header.

  3. esmi
    Forum Moderator
    Posted 3 years ago #

    know I must not do it in the header.

    Why not? That's where the top nav menu is generated.

    <?php if( !is_page( x ) ) wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic