WordPress.org

Support

Support » Themes and Templates » Custom menus don't show up in admin panel

Custom menus don't show up in admin panel

  • chrilehner90
    Member

    @chrilehner90

    Hi wordpress-pros,

    I’m writing my own theme and i neet to use custom menus.
    So i activated Appearance > Menus with my functions.php file:

    function register_custom_menu() {
    	if ( function_exists('register_nav_menu') ) {
    	    register_nav_menus(array(
    	        'main' => __( 'Hauptnavigation' ),
    	        'sub' => __( 'Seitennavigation' )
    	    ));
    	}
    	unregister_nav_menu( 'primary' );
    }

    And I’m calling that method from my default-filters.php file.

    But when i create a custom menu with some pages it doesn’t show up anywhere in Appearance > Menus. So i cannot rename, change or delete it.

    Has anybody experienced the same problem and knows the solution how to get the menus appear?

    P.S.: I don’t use any plug-ins.

    Sorry if somebody posted the same issue, but I didn’t find it…

    Thanks in advance!

    Christian

Viewing 15 replies - 1 through 15 (of 20 total)
  • esmi
    Forum Moderator

    @esmi

    Is this a child theme? If not, why are you using unregister_nav_menu( 'primary' );?

    chrilehner90
    Member

    @chrilehner90

    Because I wanted just to see my own theme locations. But it makes no difference if I unregister primary or not. In both cases the menus don’t appear

    esmi
    Forum Moderator

    @esmi

    Because I wanted just to see my own theme locations.

    So is this a child theme or not?

    chrilehner90
    Member

    @chrilehner90

    Sorry, I forgot to answer this question: No, it’s not.

    /*
    Theme Name: my_name
    Theme URI: localhost
    Description: my_description
    Author: Christian Lehner
    Author URI: -
    */
    chrilehner90
    Member

    @chrilehner90

    In the following link you can see an image. That’s what i see in the backend. The error message indicates that there should be a main-menu…and i think i should see the main-menu next to the “+”-sign, right?

    Screen

    esmi
    Forum Moderator

    @esmi

    If this isn’t a child theme, then you can drop unregister_nav_menu( 'primary' );?

    chrilehner90
    Member

    @chrilehner90

    I already dropped it.

    But unfortunately my problem is still there

    esmi
    Forum Moderator

    @esmi

    Have you incorporated wp_nav_menu() where you want your custom menus to show?

    chrilehner90
    Member

    @chrilehner90

    My menus are in the header. And they show up correctly in the header.
    But my problem is that i cannot edit the custom menus i made in the backend, because they’re not there (or i can’t see the link to the menus). I posted a link to the picture of my backend 4 posts above.

    And i think the custom menus must be somewhere in the backend to edit or delete them, right?

    esmi
    Forum Moderator

    @esmi

    What aren’t there? The Locations?

    chrilehner90
    Member

    @chrilehner90

    Let’s say i made a custom menu and named it ‘main-menu’. Then there should be a new tab with that name next to the “+”-sign in the backend in Appearance > Menus, right?

    That’s not there and i don’t know why.

    Or am I wrong and the menu should be accessible somewhere else?

    esmi
    Forum Moderator

    @esmi

    there should be a new tab with that name next to the “+”-sign in the backend in Appearance > Menus, right?

    No. You have to create that menu yourself. All the theme can do is specify the final locations for these custom menus.

    chrilehner90
    Member

    @chrilehner90

    But I created the menu. And I assigned some of my pages to that menu and then saved it. But I’m looking for a possibility to edit or delete that menu

    I’m sorry, but I don’t get it right now…

    esmi
    Forum Moderator

    @esmi

    Have you assigned that new menu to either the main or sub locations in Appearance -> Menus?

    You can also remove or add new menu items to the new menu on the same page. And completely delete the menu if you want. You might want to take a few minutes out to review custom menu management.

    chrilehner90
    Member

    @chrilehner90

    Thanks for that link, but in the first picture there’s exactly the problem I’m experiencing. In that screenshot the user defines a menu called ‘navmenu’ and gets the tab with the text ‘navmenu’ next to the ‘+’-sign.
    When I create a new menu i don’t get that tab like you can see it in this screenshot. The error message in my screenshot says that there is already a menu called ‘main-menu’, but the tab isn’t there.
    So I have no possibility to make changes to that custom menu.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Custom menus don't show up in admin panel’ is closed to new replies.