• 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

Code snippet to remove nav on home page only, not inside pages

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 › Design Tips and Tricks › Code snippet to remove nav on home page only, not inside pages

This topic is: not resolved

Tagged: primary nav inside pages, remove menu from home page, remove nav from home page, remove primary nav from home page

  • This topic has 7 replies, 3 voices, and was last updated 12 years, 6 months ago by Brad Dalton.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • June 29, 2013 at 1:41 am #48344
    joycegrace
    Participant

    I am using Education theme, and I want to get a horizontal navigation menu to appear before content on inside pages and not the home page.

    For the home page I am using the header right area with a custom menu like the demo. This will remain on the inside pages but then the inside pages will also show the primary nav that Genesis offers.

    I looked up code snippets and there are snippets to remove the nav or reposition it, but not to have it show only on inside pages.

    I also looked up the Education theme's home.php template and it's not clear where navigation fits into it from reading the code (you can't search the word "nav" in that file).

    I was thinking one way around this is to de-register the menus all together in the functions.php file, then register a new widget area using this method: http://my.studiopress.com/tutorials/register-widget-area/ , throw in a custom menus widget, and then stick the widget area into a template, but there is no template for inside pages, I guess that's taken care of at a parent theme level.

    I also thought maybe I could use Genesis Simple Hooks for this but to be honest I'm not sure what code to put where in that plugin.

    Or maybe I could use "display: none" in the css for the home page nav menu but that seems a little tacky....

    I'm not a php-er so I'm a bit stuck and would really appreciate the help with this.

    A code snippet would really help! I'm surprised this isn't a more requested feature - I did try searching the forums but couldn't see anything related.

    Thank you!


    Find me at Joyce Grace (http://www.joycegrace.ca)

    June 29, 2013 at 8:39 pm #48461
    Brad Dalton
    Participant

    If you want to remove the custom menu in the header right widget, from your home page, you can install the Widget Logic plugin and paste in the !is_home() conditional tag. This will exclude the widget from outputting your custom menu in that position on the home page only.

    If you want to remove your primary or secondary nav menu from your home page, you can use this code or modify it according to your needs.

    This code assumes your primary nav menu uses the after header position.

    Change the hook if needed depending on your themes setup.

    You can also change the code from genesis_do_nav to genesis_do_subnav to remove your secondary nav menu from the after header position.


    Tutorials for StudioPress Themes.

    September 5, 2013 at 5:39 pm #60964
    scotm
    Member

    I've tried this to remove the primary nav on Minimum Pro but it doesn't work even though it looks correct. Perhaps because it already repositions the primary nav in the functions.php. file?

    September 5, 2013 at 8:38 pm #61007
    Brad Dalton
    Participant

    Different themes are coded differently.

    The question relates to the Education theme which i tested the code with and it works for that theme, not the Minimum Pro theme.

    Please link to your site.

    The menu in the Pro demo uses a custom header right widget, not the primary nav.

    Which menu location are you using?


    Tutorials for StudioPress Themes.

    September 5, 2013 at 9:19 pm #61018
    Brad Dalton
    Participant

    The Minimum Pro theme uses a front_page.php file.

    You can paste this code in that file to remove the primary nav menu from the front page only:

    remove_action( 'genesis_after_header', 'genesis_do_nav', 15 );
    

    Tutorials for StudioPress Themes.

    September 6, 2013 at 7:22 am #61059
    scotm
    Member

    Great idea. Thanks!

    December 17, 2013 at 1:56 am #79695
    joycegrace
    Participant

    I forgot to thank you for this, thank you!


    Find me at Joyce Grace (http://www.joycegrace.ca)

    December 17, 2013 at 3:49 am #79708
    Brad Dalton
    Participant

    You're welcome.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 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