• 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

subnav on specific 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 › subnav on specific pages?

This topic is: not resolved

Tagged: conditional tag, subnav

  • This topic has 1 reply, 2 voices, and was last updated 12 years, 11 months ago by SoZo.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • November 21, 2012 at 4:09 pm #1197
    sheilab
    Participant

    I am working on a small site and want the subnav to be displayed on certain pages. I do not want it displayed on the home page.

    Here is the site. http://www.luvnbitsnparts.com/

    The subnav is displaying on the proper inner pages, but I can't seem to get it to not display on the home page. Here is the code I am using.  Please advise.

    /** do not display secondary menu  on chosen pages **/
    add_action('template_redirect', 'child_conditional_actions');
    function child_conditional_actions() {
    if ( is_page( array(12,15,2) ) )
    remove_action('genesis_after_header', 'genesis_do_subnav');
    }
    /** do not display subnav on home page**/
    if( is_home()  ) { remove_action('genesis_after_header', 'genesis_do_subnav');
    }

    November 21, 2012 at 5:39 pm #1207
    SoZo
    Member

    Add to your original conditional statement

    if ( is_home || is_page( array(12,15,2) ) )


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 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

© 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