• Resolved tersmi

    (@tersmi)


    A wordpress site I’m helping to develop is nearly ready for launch. Within the last month we suddenly lost the ability to find/edit our primary nav menu. When accessing it through appearance>menus I’m able to see 2 of the 3 menus we’ve created but nothing is registered for the “primary” menu that I’ve already created (and which is still active on my site). I’ve tried disabling all my plugins and clearing the cache but the menu is still missing. I’d love your thoughts.

    • This topic was modified 7 years, 8 months ago by tersmi.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi there,
    just a thought, have you worked on anything in the functions.php file of your theme that might be interfering with the primary menu, or maybe even removed/changed the code by error?
    I ask because it seems its not registering properly.
    Maybe compare your current file with a backup from when it was still working.
    It should look similar to the info here > https://codex.www.ads-software.com/Navigation_Menus

    Thread Starter tersmi

    (@tersmi)

    Awesome thought Sol. I’m not new to web development, but I am new to the ins and outs of WP so this is the first step I’m looking for. I’ll check it and report back.

    Thread Starter tersmi

    (@tersmi)

    After looking at the functions.php file I’m unable to find any reference to the primary_menu or anything relating to navigation. Any thoughts on where I should be finding this? IOs there likely to be more than one functions.php file? Something to do with the theme?

    I haven’t made any changes to these files before now. I’m just hoping to reconnect it without have to recreate the entire menu (the site has grown quite large).

    Hi @tersmi,
    no that’s the only place where the primary menu goes if you are registering it. Only one functions.php file to a theme.
    If one of the other menus is similar you could duplicate it with a plugin called Duplicate Menu, however what you are saying is, your Primary menu “exists” already.
    It couldn’t be “hardcoded” to the theme could it? (Gasp!)
    No you said it disappeared recently from the menu area.

    I would recommend that if you have not backed up the site do it now. Here are several plugins in the repo > https://www.ads-software.com/plugins/search/backup/

    I’ll do a bit more research, is there an url you can share?

    Thread Starter tersmi

    (@tersmi)

    Hi @sol
    I’ll include the link to the site at the bottom of this post. The menu appears on the site but no access to it on the back end (in appearance>menus). As for hard-coding, are you referring to it somehow being present in the CSS?

    https://s23009.p507.sites.pressdns.com/
    Bear in mind that this is not “published” yet.

    @tersmi,
    a colleague suggests two things
    1. Turn off plugins (Told him you did that)
    2. Try and see if menu appears with another theme (maybe a basic one like twenty sixteen)

    Let me know if that triggers something. Fingers crossed.

    @tersmi,
    no it would go into header.php

    Here is a bit more about the Theme file structure.
    https://codex.www.ads-software.com/Stepping_Into_Templates

    This page has info on the functions.php file (just general info)
    https://codex.www.ads-software.com/Theme_Development

    Try and do the test with another theme to see if in the admin the Menu reappears. Your site will look wonky for a minute.

    Moderator bcworkz

    (@bcworkz)

    Whether your menu shows up in a different theme or not could be a clue towards how to recover it in your preferred theme. Such recovery can be tricky though. The fact it shows on the front end actually isn’t that helpful a clue because it could still be visible for any number of reasons. But it can be very helpful in another way. It may be more expedient to create a new menu, using the current front end menu for reference.

    If you’d rather attempt recovery, the following is basically how menus are managed internally. You’ll need to be able to navigate within phpMyAdmin to track this down, and have an understanding of serialized arrays and the table relationships between taxonomy terms and posts. The location-to-menu relationship is saved in the options table with the theme mods. Option name format is theme_mods_{$theme-slug}. Theme mods are saved as a serialized array. After each menu location name is ;i:###; where the hashes are an integer that is a taxonomy term object ID. The term is for the “nav_menu” taxonomy and the term is assigned to each menu item for the particular menu assigned to the location of interest. Each menu item is a WP_Post object of the type “nav_menu_item”.

    The data is corrupted somewhere along this path. If you can identify it, it could conceivably be repaired. You can also now see how simply re-creating the menu might be more expedient ?? Good luck!

    Thread Starter tersmi

    (@tersmi)

    @bcworkz thanks for the detailed reply. Your point is well-taken. After some back and forth experimenting with deactivating plug-ins and swapping themes I am resigned to the fact that rebuilding is the easiest course. Again, thanks to both @sol and @bcworkz ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Primary menu suddenly missing from appearance > menus’ is closed to new replies.