• 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

function to add a div inside submenu

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 › function to add a div inside submenu

This topic is: not resolved

Tagged: function, navigation menu

  • This topic has 4 replies, 2 voices, and was last updated 13 years, 3 months ago by davidjohnty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • April 22, 2013 at 1:02 am #36822
    davidjohnty
    Member

    I am looking to find a way to add a new div with a class inside submenu in genesis framework using any genesis hook or php function.

    Here is the example:

    Original Code:

    `

    • Menu Item 1
    • Menu Item 2
    • Menu Item 1
    • Menu Item 2
  • Menu Item 3
  • `

    What I want to Achieve:

    `
    
    • Menu Item 1
    • Menu Item 2
    • Menu Item 1
    • Menu Item 2
    • Some text or images here
  • Menu Item 3
  • `
April 22, 2013 at 1:24 am #36824
Brad Dalton
Participant

Maybe something like this will help http://www.studiopress.community/topic/add-rss-to-right-side-of-the-menu/#post-36812

Another option might be to try to use the Genesis Social Profiles Menu http://wordpress.org/extend/plugins/genesis-social-profiles-menu/

Depends on what you want to display in the sub nav


Tutorials for StudioPress Themes.

April 22, 2013 at 3:01 am #36830
davidjohnty
Member

But this code will add div under menu I want to add under submenu.

April 22, 2013 at 3:05 am #36831
Brad Dalton
Participant

Why not change the code to subnav?


Tutorials for StudioPress Themes.

April 22, 2013 at 3:24 am #36833
davidjohnty
Member

What changes I have to do here?

add_filter( 'genesis_nav_items', 'custom_sbmenu', 10, 2 );
add_filter( 'wp_nav_menu_items', 'custom_sbmenu', 10, 2 );

function custom_sbmenu($menu, $args) {
$args = (array)$args;
if ( 'primary' !== $args['theme_location'] )
return $menu;
$follow = '<div class="sbclass">Our Jelly Town cat that loves<br />
climbing from tree to tree!<br /><br />
Learn how to make Cheeseball <br />
with our art supplies and<br />
creative craft ideas.<br />
<br /><br />
<a class="cheesebtn">View Cheeseball Kit</a>
</div>';
return $menu . $follow;
}

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