Archived topic
register a new menu in a child theme
3 replies · Started by webtags on May 28, 2017
Viewing posts 1–4 of 4
Hi, i'm trying to setup a new custom menu inside a child theme.
I edited the functions.php with this code:
add_action( 'after_setup_theme', 'register_my_menu' );
function register_my_menu() {
register_nav_menu( 'topics', __( 'Topics Menu', 'generatepress' ) );
}
Then inside the after header hook i have putted this:
<!-- topics -->
<div class="grid-container container grid-parent">
<?php wp_nav_menu( array( 'theme_location' => 'topics-menu', 'menu_class' => 'inside-topics' ) ); ?>
</div>
<!-- /topics -->
after that the new menu appear inside the the menu list, But i'm not able to associate a new menu in that position.
what is the problem?
You named it "topics", but you've called for "topics-menu" in your function.
omg...
thank you
You're welcome :)
This archived topic is closed to new replies.