• Resolved unsavouryindividual

    (@unsavouryindividual)


    Hi,
    I’m building a child theme (I’ve troubleshoot-ed, it’s not the parent theme) and registered my own menu because I was having trouble styling the original one (for some reason). It simply displays ALL pages instead of the pages listed in the menu I assigned to it in admin.

    Can someone look over my code? What am I missing?

    In functions.php

    function register_my_menu() {
      register_nav_menu('top-menu',__( 'Top Menu' ));
    }
    add_action( 'init', 'register_my_menu' );

    In the theme
    <div id="top-nav"> <?php wp_nav_menu(array('theme_location' => 'top_nav', 'container' => '')); ?> </div>

    Much thanks

Viewing 1 replies (of 1 total)
  • Thread Starter unsavouryindividual

    (@unsavouryindividual)

    Yeah, I’m just gonna slink on out of here in embarrassment after I explain my mistake.
    “top_nav” in the theme should be “top-menu”

Viewing 1 replies (of 1 total)
  • The topic ‘Menu location not showing chosen menu’ is closed to new replies.