Ver Mensaje Individual
  #16 (permalink)  
Antiguo 19/07/2012, 07:22
Avatar de rogertm
rogertm
Mod->Cuba
 
Fecha de Ingreso: julio-2005
Ubicación: /home/Cuba/Habana/rogertm/
Mensajes: 2.922
Antigüedad: 18 años, 9 meses
Puntos: 638
Respuesta: Como añadir un menu nuevo?

¿Será que estás usando mal el hook? Mira, prueba este pedazo de código, que es como viene en twentyeleven:
Código PHP:
Ver original
  1. <?php
  2. /** Tell WordPress to run twentyten_setup() when the 'after_setup_theme' hook is run. */
  3. add_action( 'after_setup_theme', 'twentyten_setup' );
  4.  
  5. if ( ! function_exists( 'twentyten_setup' ) ):
  6.  
  7. function twentyten_setup() {
  8.     // This theme uses wp_nav_menu() in one location.
  9.     register_nav_menus( array(
  10.         'primary' => __( 'Primary Navigation', 'twentyten' ),
  11.         'secondary' => __( 'Secondary Menu', 'twentyten' ),
  12.     ) );
  13. }
  14.  
  15. endif;
  16. ?>
Originalmente viene para un solo menú, pero le he agregado otro para que veas que si funciona... Igual fíjate en el hook: after_setup_theme()

Como plus, y para que no cometas errores ya cometidos por otros, por ejemplo: Yo, fíjate que la función __() tiene dos parámetros, el primero es una cadena de texto que en algún momento querrás traducir a tu idioma (o al que sea) y el segundo es el text domain, para indicarle a la función qué idioma estás usando... Para más info mira aquí en las funciones de Localization

Saludos.
__________________
Friki y Blogger por Cuenta Propia:213
Twenty'em: Theming is Prose