[Resolved] register a new menu in a child theme

Home Forums Support register a new menu in a child theme

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #325227
    webtags

    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?

    GeneratePress 1.3.46
    GP Premium 1.3
    #325374
    Tom
    Lead Developer
    Lead Developer

    You named it “topics”, but you’ve called for “topics-menu” in your function.

    #325441
    webtags

    omg…
    thank you

    #325443
    Tom
    Lead Developer
    Lead Developer
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.