Changing Main Menu in Child Theme
- This topic has 2 replies, 2 voices, and was last updated 12 years ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Hey all!
Firstly, I’m really sorry if it turns out that this is just a wordpress question and not a CBOX question.
My question is about how to control what pages show up as links in the “main menu” in the header of the CBOX theme (I’m running a very lightly customized child theme). Basically, I want to be able to hide/exclude some of my pages because they mess up my layout. From following the template files, it looks like those links are being generated by the command “infinity_base_nav_menu( ‘main-menu’ )” in main-menu.php (in templates/parts), which is referenced by header-banner.php (also in templates/parts), which is referenced by header.php (in the theme’s root directory).
I have a feeling that even if I could find infinity_base_nav_menu(), I really wouldn’t want to edit it…so does anyone know where it’s pulling ‘main-menu’ from and how I can choose which pages do and don’t show up in it? I looked around in the different options on my admin page but couldn’t find anything- just an option to edit cbox-sub-menu, which seems like it definitely is not main-menu.
Any help would be greatly appreciated!
Dan
Appreciate you looking through the codebase! However the menu is simply using the WordPress Menu system.
1. Login to the WP dashboard
2. Navigate to “Appearance > Menus”
3. Customize the menus to your heart’s content!
Let me know if this is what you meant.
Thanks for the reply, Ray!
I’ve been messing around some with the Menus page in my admin panel, as well as a forked main-menu.php in my child theme, with some weird-seeming results.
First, though- it doesn’t look like ‘main-menu’ exists at all for my Menus admin panel, just ‘cbox-sub-menu’, which has a different set of links from whatever ‘main-menu’ is. Do you have a sense of where it might be getting defined/populated with links?
Here’s what I’ve done so far:
1. When I comment out the “infinity_base_nav_menu( ‘main-menu’ );” line entirely, the menu disappears, as expected.
2. I created a new menu through the admin interface, which I called ‘mod-main-menu’, and replaced ‘main-menu’ with ‘mod-main-menu’ in the command above: no effect
3. I replaced ‘main-menu’ with ‘bleh’ (which I hadn’t created as a menu- was just testing a random string): also no effect
4. I removed the string argument from the command entirely (‘infinity_base_nav_menu()’), which changed the menu into the one defined by ‘cbox-sub-menu’ in my admin panel- that seemed especially weird, but makes sense if that’s defined as the default, but then doesn’t because a random string didn’t return it but the same thing as ‘main-menu’
5. I set the menu for ‘Inside Header’ to my ‘mod-main-menu’ using the admin interface: no effect
At this point I’m also really curious to see the code inside of infinity_base_nav_menu(): do you know where it’s defined?
Any thoughts/recommendations would be greatly appreciated!
Dan