• 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

Insert an element between logo and main nav

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 › Insert an element between logo and main nav

This topic is: resolved

Tagged: hook, hooks

  • This topic has 2 replies, 2 voices, and was last updated 9 years ago by fpsdf.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • June 8, 2016 at 4:44 am #187163
    fpsdf
    Member

    Using genesis_after_header hook, I can easily insert an element (e.g. an image slider) after the main nav.

    But I'd like to place this slider between the site's logo and the main nav.

    Any suggestion of how to achieve it?

    Thank you so much.

    http://cotton.lampada.pt
    June 8, 2016 at 6:36 am #187166
    Victor Font
    Moderator

    It appears that you are using the Genesis Sample theme. The default location for the primary nav is the Genesis After Header area, which is loaded in the Genesis Framework in genesis/lib/structure/menu.php. This is where having a little understanding of the WordPress add_action function comes into play. The code for displaying the primary nav menu in the Genesis Framework is add_action( 'genesis_after_header', 'genesis_do_nav' );.

    Add action can receive a third parameter known as the priority. Priority defines the order in which actions are added to a specific hook. If no priority is specified, the default priority is 10. If you want something to appear before a specific action, you give it a lower number priority so it loads earlier. If you want it to appear after a specific action, you give it a higher numbered priority so it loads later.

    You have tow choices. You can either create a new widget area and display it above the primary nav or you can create a function to display your slider and execute it above the primary nav. Whatever the case, you would add the new action with the following:

    add_action( 'genesis_after_header', 'my_slider_code', 5 );

    If you go the widget area route, this article should help get you started in the right direction. http://victorfont.com/add-widget-areas-to-news-pro-theme/


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    June 8, 2016 at 1:02 pm #187183
    fpsdf
    Member

    Victor, that's awesome! I thank you so much.

    Priority seems to be the key.

    However, I can't still get it to work.

    I'm using Genesis Simple Hooks plugin and placing your piece of code on genesis_after_header area (selecting Execute PHP on this hook) and I'm using the code...

    <?php add_action( 'genesis_after_header', 'putRevSlider( 'homeslider' );', 5 ); ?>

    ...and I must be missing something. The slider is not showing up...

    Anyway, thank you so much for your time!

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