I'm struggling with an issue registering my custom menu in WP. I have read all the text and various forums about custom menus in wp, but cannot seem to figure out how to get mine to work.
Here is the code snippet I am adding to my function.php file:
function register_my_menu() {
register_nav_menu('header-menu',__( 'Header Menu' ));
}
add_action( 'init', 'register_my_menu' );
and then adding this bit of code to the header.php file where I want the menu to be:
<?php wp_nav_menu( array( 'theme-location' => 'header-menu' ) ); ?>
Both snippets taken directly from: https://wordpress.org/support/topic/register_nav_menu-not-actually-registering-menus
Now I have tried entering these codes differently, in different orders, renaming them, to no avail. Nothing seems to work. When I view my WP site, I find the top part of the side has the functions.php code showing at the top and the option to edit the menu in the admin panel never appears.
Here is even a screen shot of the result i get when I use this code. http://i.stack.imgur.com/5XiEu.jpg
Is there something I'm doing wrong???
IF so, how can I fix it?
I would be much obliged to get some assistance, as I am very new to WP.
<?phpand?>tag in functions.php file - Tamil Selvan C'header-menu''Header Menu'- doublesharpfunctions.phpfile and look at that code you put, and then if the code inside is colored differently then the code that usually works, then your php tags are either missing, or you have unnecessary php tags. Post that part of the code (with few lines about and below so that we can see if you've put your code well). - dingo_d