WordPress Troubleshooting and Support
Public Group active 10 months ago agoWordPress support from our community
Broke site trying to add additional menu
Tagged: additional menu to wordpress, broke site
- This topic has 9 replies, 3 voices, and was last updated 9 years, 6 months ago by
amylaneio.
-
AuthorPosts
-
January 27, 2013 at 5:15 pm #1592
Vincent Gentile
ParticipantI am trying to add an additional menu to the header of my site and tried to use the 404 menu in the theme with a custom menu to add the second menu to the header.
I added a header.php file to the avada child and added the this code to the header.php: ’404_pages’, ‘container_class’ => ‘nav’ ) ); ?>
It didn’t work and even though I have removed the code from the header.php the site hasn’t gone back to what it should be.
Staging site: http://privacy.avmhost.com/
Any ideas………..…?
January 27, 2013 at 6:26 pm #2792Vincent Gentile
ParticipantFor some reason all of the code is not showing up in the post….this is what I added:
’404_pages’, ‘container_class’ => ‘nav’ ) ); ?>January 27, 2013 at 7:18 pm #2793Steve
KeymasterBy adding a header.php file I’m assuming you’re using a child theme and over riding the main Header.php.
Did you copy the parent header.php and add your code?
January 27, 2013 at 7:22 pm #2794Vincent Gentile
ParticipantHi Steve…..yes using a child and no…..i did not copy the the parent header.php code…I assumed the child code would pick up.
January 27, 2013 at 7:23 pm #2795Vincent Gentile
ParticipantI assumed the child would pick up the parent.
January 27, 2013 at 8:13 pm #2796amylaneio
Spectator@Vincent, any file you want to add code to in the child, you need to copy the entire file, then edit it. The child header.php completely overrides the parent header.php. (The only “exception” for this is style.css, but that’s because the first thing you do in in the child style.css is @import the parent style.css).
January 27, 2013 at 9:53 pm #2797Vincent Gentile
ParticipantThank You Steve/Andy – So I loaded the header.php into the child and the site came back ….then I was going to register a new menu …..so I loaded the functions.php into the child and I am getting the following errors…?
Warning: require_once(admin/index.php) [function.require-once]: failed to open stream: No such file or directory in /home/avmhost/public_html/privacy/wp-content/themes/Avada-Child-Theme/functions.php on line 19
Fatal error: require_once() [function.require]: Failed opening required ‘admin/index.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/avmhost/public_html/privacy/wp-content/themes/Avada-Child-Theme/functions.php on line 19
January 27, 2013 at 9:56 pm #2798amylaneio
SpectatorShoot, forgot that functions.php also doesn’t override the parent. You can just add the new function to the child’s functions.php without having to duplicate the parent. See the following for more details:
January 27, 2013 at 11:28 pm #2799Vincent Gentile
ParticipantAndy – Thank You…..I added the extra menu……Do you how to keep the styling of this menu separate from the menu above it….? I need to move it around
staging site – http://www.privacy.avmhost.com
January 27, 2013 at 11:33 pm #2800amylaneio
SpectatorYou’ll need to change, or even remove, the class of the
- tag to something else if you want completely different styling, i.e.
- or
You could also ADD a class to the existing one to inherit the main styles, but override what you want, i.e.
(notice the space in between the ‘menu’ class and ‘sub’ class). Then you could just add styles for .sub to override what you don’t want in the main .menu class, i.e.
.menu { …existing styles are already in main style.css… }
.sub { …override what you want here, for example, margin, border, etc… }
-
AuthorPosts
- You must be logged in to reply to this topic.