jfeaver
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: register_nav_menu not actually registering menus?If anyone else is having this same issue, I’m also starting a conversation at StackOverflow. Maybe they will know what’s up with this weird header.php funkery.
Yep, they were able to help me. I just put a hyphen instead of an underscore. So… I did read the page and I did have all the info I needed.
Forum: Fixing WordPress
In reply to: register_nav_menu not actually registering menus?I have read the page that you linked. I’ve read it twice now and glanced over it a few more times. I’m really trying and I’m sorry that I’m frustrating you.
The only extra pieces of information that I read about is the optional register_nav_menus for more than one menu, which I’ve now implemented, and the option to give your menu a class in wp_nav_menu.
I’m really trying and still not knowing what to try next. If you know the answer, could you please tell me explicitly?
Forum: Fixing WordPress
In reply to: register_nav_menu not actually registering menus?Okay, I’m sorry. I think that I did do everything on the link that you gave. I did add a function:
function bt_register_custom_menus() {
register_nav_menu(‘header_left’, __(‘Header Left’));
register_nav_menu(‘header_right’, __(‘Header Right’));
register_nav_menu(‘home_left’, __(‘Homepage Left’));
register_nav_menu(‘home_right’, __(‘Homepage Right’));
}I also added an add_action:
add_action(‘init’, ‘bt_register_custom_menus’);
From what I understand of the information in the link, that is all I need. Then I can go ahead and add menus using wp_nav_menu and specify menus to use in Appearance->menus. Is this correct? What else do I need to add to my functions.php?
Forum: Fixing WordPress
In reply to: register_nav_menu not actually registering menus?Have you looked at my Pastebin?? That’s all in there. I know how to register and add menus with the correct php functions. I was wondering if there was something like:
wp_theme_uses_custom_menus(‘init’)
Like I said, the feature is working in my page templates but not in my header.php. Any thoughts?
Forum: Fixing WordPress
In reply to: register_nav_menu not actually registering menus?Maybe?? I started from the Foundation theme. It might have added them already.
How do I add custom menu support?
Forum: Fixing WordPress
In reply to: register_nav_menu not actually registering menus?Nope, nm that didn’t work either… ugg…
But, I did think that it was working because it is working with menus in the page templates. For whatever reason, if I put this functionality into header.php then it won’t work but works fine in a page template.
Forum: Fixing WordPress
In reply to: register_nav_menu not actually registering menus?Okay, I was completely disappointed about getting no help on this. I thought you’d be better than this WP forums. WP should make this place more like StackOverflow ??
I finally figured out the problem. I need to use ‘theme-location’ rather than ‘menu’ as my key in the wp_nav_menu argument. Ugg…
Forum: Fixing WordPress
In reply to: register_nav_menu not actually registering menus?Okay, so I’m getting into the backend, doing some debugging and still not figuring this out. I’m wondering if maybe it is because I’m on a local LAMPP server and maybe something’s not getting stored in the local database correctly?? That would still surprise me a little bit though because the Admin GUI shows that my menus are being saved and that my theme allows for the new custom menu options.
From within wp_nav_menu, a call to wp_get_nav_menu_object returns false which means that get_term and get_term_by are also returning false. The nav menu items exist on my database when I look on the wp_posts table in my phpmyadmin. I’m confused when I look at the menu items though. They don’t seem to have any identifying information on them(like page ids or links) and only say ‘nav_menu_item’ under the post_type heading and have a number under post_name (different from the page id of the link).
Where can I find the name of the custom menus that I’m creating in the database? Do I have a problem setting up the custom menus in functions.php or am I calling them incorrectly in header.php? I’m so confused. Thanks for help!
Forum: Fixing WordPress
In reply to: register_nav_menu not actually registering menus?yep, the same thing happens there too.