Hide menu on homepage

Community Forums Forums Design Tips and Tricks Hide menu on homepage

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  stephanhov 1 year, 6 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #35595

    stephanhov
    Participant
    Post count: 9

    I’m using a widgetized homepage on a custom child theme, which means I have a static page called “Home” which is set as the homepage under Settings > Reading, and a page_home.php file in my child theme folder.

    I’d like to remove the primary menu from this page, since the widgets I’m using are identical to the menu. How would I go about doing this?

    Thanks in advance for your collective, help as I struggle through my first child theme.

    #35628

    braddalton
    Participant
    Post count: 10346

    Link to your site please.

    The easy way to do this is to add code like this to your child themes style.css file:
    [css]
    .home #nav {
    display: none;
    }
    [/css]

    Because you’re using a static page as your home page, you may need to grab the page i.d from your source code in the body class and use that in the code rather than .home:

    Example:

    [css]
    .page-id-10452 #nav {
    display: none;
    }
    [/css]


    #35654

    stephanhov
    Participant
    Post count: 9

    thanks Brad, hacking CSS isn’t something I prefer but in the interest of time I’ll probably take your advice.

    However, isn’t the menu loaded somewhere such that I can “deregister” it or “remove” it somehow using a Genesis function? Like we register sidebars, loops, etc.?

    #35658

    braddalton
    Participant
    Post count: 10346

    You could add a conditional tag [php]!is_home()[/php] to this code: http://my.studiopress.com/snippets/navigation-menus/

    No need to hack the CSS in the child theme.

    Simply paste the above CSS code at the end of the child themes style.css file.


    #35659

    stephanhov
    Participant
    Post count: 9

    bingo. thank you SOOOO much Brad!!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.