Agregar un nuevo菜单

javascript
阅读 43 收藏 0 点赞 0 评论 0

add_custom_menu.js
//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' ) ); 
?>
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号