• 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

conditional when using genesis simple menu as secondary menu

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 › conditional when using genesis simple menu as secondary menu

This topic is: not resolved
  • This topic has 2 replies, 2 voices, and was last updated 8 years, 8 months ago by Bill.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • February 25, 2018 at 7:54 am #216974
    Bill
    Participant

    I want to display a secondary menu at the end of the content of certain pages or a CPT, but I need a conditional statement to look if it is a page or CPT AND where a genesis secondary menu is actually assigned (I use the genesis simple menus plugin). The reason I want the conditional is I want a title to appear above the secondary menu that says "related searches"....but I only want that title to appear if a secondary menu was actually assigned.

    This is what I have so far which does fire the menu as I want, except I only want it to fire off on these pages or cpt when a secondary menu is actually is assigned to the page or post. Is this possible to do?

    // Reposition the secondary navigation menu to below content and add "Related Links" title just above it

    remove_action( 'genesis_after_header', 'genesis_do_subnav' );
    add_action( 'genesis_entry_footer', 'related_links' );
    function related_links () {
    if ( is_singular( array ('page','mycpt') ))
    echo( '<strong>Related Searches:</strong>' );}
    add_action( 'genesis_entry_footer', 'genesis_do_subnav' );
    February 26, 2018 at 3:21 am #217013
    Gary Jones
    Member

    has_nav_menu( 'secondary' ) may be the bit you're missing here.

    Untested, but try:

    
    add_action( 'genesis_entry_footer', 'bill_related_links' );
    /**
     * Add "Related Links" title just above secondary menu in footer.
     */
    function bill_related_links () {
    	if ( is_singular( array ('page','mycpt') ) && has_nav_menu( 'secondary' ) ) {
    		echo( '<strong>Related Searches:</strong>' );
    	}
    }
    
    // Reposition the secondary navigation menu to below content.
    remove_action( 'genesis_after_header', 'genesis_do_subnav' );
    add_action( 'genesis_entry_footer', 'genesis_do_subnav' );
    

    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

    February 26, 2018 at 5:59 am #217018
    Bill
    Participant

    You're a genius Gary.

    That's it. Thank you so much!

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘General Discussion’ 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