Problem with register_nav_menus (in functions.php) and wp_nav_menu (header.php)
-
I have a problem showing the menus in my WordPress theme Mantra, the problem is that when I write new menus in my functions.php(like this):
<?php function registrar_mis_menus() { register_nav_menus( array( '2' => 'Segundo', '3' => 'Tercero', '4' => 'Cuarto', '5' => 'Quinto', '6' => 'Sexto', '7' => 'Septimo' ) ); } add_action( 'init', 'registrar_mis_menus' ); ?>
And in the header.php:
<?php wp_nav_menu( array( '2' => 'Segundo', 'container_class' => 'menu' )); ?> <?php wp_nav_menu( array( '3' => 'Tercero', 'container_class' => 'menu' )); ?> <?php wp_nav_menu( array( '4' => 'Cuarto', 'container_class' => 'menu' )); ?> <?php wp_nav_menu( array( '5' => 'Quinto', 'container_class' => 'menu' )); ?> <?php wp_nav_menu( array( '6' => 'Sexto', 'container_class' => 'menu' )); ?> <?php wp_nav_menu( array( '7' => 'Septimo', 'container_class' => 'menu' )); ?>
They seem to work right in the admin Panel:
http://img209.imageshack.us/img209/6332/capturadepantallan.png
But when i go to any page of my site they show the same link on all the menus::
http://img217.imageshack.us/img217/3880/menuconlosenlacesrepeti.png
¿How can I solve this problem?, ¿Theres a problem with my code, or with that theme?
Help, ¡Please!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Problem with register_nav_menus (in functions.php) and wp_nav_menu (header.php)’ is closed to new replies.