- This topic has 3 replies, 3 voices, and was last updated 5 years, 6 months ago by Skandha.
-
AuthorPosts
-
April 23, 2019 at 1:37 pm #170973npl_buzz19Participant
Hi,
I’m trying to add another menu bar to my site since the default NepalBuzz theme only supports 2 menu locations.
I added this code snippet to my functions.php and it worked great:
function register_my_menu() {
register_nav_menu(‘new-menu’,__( ‘New Menu’ ));
}
add_action( ‘init’, ‘register_my_menu’ );Now the instructions say to add this code to the header.php page to place the menu where I want it:
wp_nav_menu( array( ‘theme_location’ => ‘new-menu’ ) ); ?>
However, I can’t get the menu bar to show up how I’d like. I want the new menu bar to be ABOVE the main sticky menu at the very top of my site. I tried adding the code snippet to the bottom of the header.php page, and it showed up at the top of the main container of my site. I tried adding it at various other points in the header.php file and it just caused errors.
I know there’s another file in the NepalBuzz directory called menus.php. Is this where I should be adding this code snippet to place the menu where I want it? If so, where?
Sorry, I am not well-versed in PHP. Thank you for any help!
April 24, 2019 at 12:10 am #171008sapanaParticipant@npl_buzz19: If you are making any changes in the theme I suggest you to make child theme as the changes you make in core files of the theme get lost after you update the theme. Let me know if you are familiar with child theme customization otherwise I suggest you to hire a customizer to get it done.
Kind Regards,
SapanaApril 24, 2019 at 10:23 am #171056npl_buzz19ParticipantHi,
Yes, I am using a child theme.
April 26, 2019 at 2:46 am #171264SkandhaParticipant@npl_buzz19: Hello there,
Go to => Child Theme Folder => functions.php and add the code in this link.Go to => Child Theme Folder => style.css and add the CSS Code in this link.
Let me know if the new menu shows up in your customizer and is working well.
Kind Regards,
Skandha -
AuthorPosts
- The topic ‘Which file to add new menu code to?’ is closed to new replies.