• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Primary Nav Bar Only on Home Page

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Primary Nav Bar Only on Home Page

This topic is: resolved

Tagged: Primary Navigation Menu

  • This topic has 7 replies, 4 voices, and was last updated 12 years, 11 months ago by OliveBurbank.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • January 13, 2013 at 11:29 am #11599
    OliveBurbank
    Member

    I just need the primary nav bar on the home page - all other pages have a vertical nav bar in a sidebar.  I found this for functions.php
    /** Change - Reposition the primary navigation menu */
    remove_action( 'genesis_after_header', 'genesis_do_nav' );

    Which is great - it removed the primary nav bar from all of the pages.

    Question, how do I put the nav bar back on just the home page?

    I have looked through various forums, searched the internet - most of the items I have ran across are for sidebars or removing pages from nav bars.

    I am looking for any assistance.  Thank You.

    January 13, 2013 at 7:58 pm #11718
    itsonlybarney
    Member

    You could test for whether the page is the home page, and then remove it for all others using the following:


    if ( !is_home() ) {
    remove_action( ‘genesis_after_header’, ‘genesis_do_nav’ );
    }

    January 14, 2013 at 8:19 am #11819
    OliveBurbank
    Member

    Thank you - I have a functions.php and a home.php.  I tried placment in both and nothing changed.

    Any other suggestions?

    The home page does not have an id however, do you know what code would take the nav bar off a page.  I know it is the long way of doing it in the css for every page but it is an option, I think.

    Thank you for your time.

    January 14, 2013 at 8:29 am #11821
    Susan
    Moderator

    Here's a thread where someone wanted to move the nav. bar off a particular page (it doesn't work for a home page with no ID), but it will answer your question for doing it the long way...

    http://www.studiopress.community/topic/how-to-remove-navigation-menus-from-a-certain-page/

    January 14, 2013 at 8:35 am #11823
    Bill Murray
    Member

    I think a mix of itsonlybarney's and Susan's recommendations is what you want:

    //Remove nav from home page
    add_action('get_header', 'child_remove_genesis_do_nav');
    function child_remove_genesis_do_nav() {
    	if ( !is_home() ) {
    		remove_action('genesis_after_header', 'genesis_do_nav');
    	}
    }
    

    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

    January 14, 2013 at 9:00 am #11829
    OliveBurbank
    Member

    Thank you Susan and Bill.

    Bill, the mix you provided worked like a charm - Nav Menu Bar is on the home page only and removed from the other pages.

    Again, Thank you so much.

    January 14, 2013 at 9:13 am #11831
    Bill Murray
    Member

    Glad it worked. Keep in mind that itsonlybarney put you on the right path. You might have copied the exact code he provided into your functions.php and the exact code wouldn't work because you need to put the code in a function and add the function to an existing action. itsonlybarney may have assumed you were aware of that step so he just included the code that went inside the function.


    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

    January 14, 2013 at 9:21 am #11833
    OliveBurbank
    Member

    Yes, you are correct in your assessment Bill.  I am a novice and put the code right into the function with out the action.

    Thank you itsonlybarney - Thank you all.

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Primary Nav Bar Only on Home Page’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble