matias2
3/27/2018 - 1:47 PM

Agregar un nuevo Menu

WordPress allows theme developers to define navigation menus and then display them. Add this code in your theme’s functions file to define a new menu location in your theme.

//Add this code in your theme’s functions file to define a new menu location in your theme.
function wpb_custom_new_menu() {
  register_nav_menu('my-custom-menu',__( 'My Custom Menu' ));
}
add_action( 'init', 'wpb_custom_new_menu' );

//Now you need to add this code to your theme where you want to display navigation menu.
<?php
wp_nav_menu( array( 
    'theme_location' => 'my-custom-menu', 
    'container_class' => 'custom-menu-class' ) ); 
?>