Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

How to add a custom menu, made with a plugin, to Genesis child theme.

I am creating my own Genesis child theme from scratch and I'm using the plugin 'Hero Menu' to make the nav bar/menu for the site. Inside the plugin you can apply the menu to a genesis's primary and secondary menus. However, even doing so the menu will not show up on the site?

I can manually add the menu with the following code: <?php echo do_shortcode( '[hmenu id=1]' ) ?>

But I don't know how to get that in Genesis's primary Nav.

Please help, thank you.

1 Answer

Are you properly calling the wp_nav_menu in your theme's files?

The default php for this is:

$defaults = array(
    'theme_location'  => '',
    'menu'            => '',
    'container'       => 'div',
    'container_class' => '',
    'container_id'    => '',
    'menu_class'      => 'menu',
    'menu_id'         => '',
    'echo'            => true,
    'fallback_cb'     => 'wp_page_menu',
    'before'          => '',
    'after'           => '',
    'link_before'     => '',
    'link_after'      => '',
    'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
    'depth'           => 0,
    'walker'          => ''
);

wp_nav_menu( $defaults );

?>```

You can learn more at:
https://codex.wordpress.org/Function_Reference/wp_nav_menu