function to add a div inside submenu

Community Forums Forums General Discussion function to add a div inside submenu

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  davidjohnty 1 year, 6 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #36822

    davidjohnty
    Participant
    Post count: 4

    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
  • `
    • This topic was modified 1 year, 6 months ago by  davidjohnty.
    • This topic was modified 1 year, 6 months ago by  davidjohnty.
#36824

braddalton
Participant
Post count: 10217

Maybe something like this will help http://www.studiopress.com/forums/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


#36830

davidjohnty
Participant
Post count: 4

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

#36831

braddalton
Participant
Post count: 10217

Why not change the code to subnav?


#36833

davidjohnty
Participant
Post count: 4

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;
}

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.