wordpress制作主题之菜单

function代码

//pc:相当于菜单id可以随意命名

register_nav_menus( array(        
    'pc'    => '电脑'
) );

前台调用

//pc:function中注册菜单的id
 
wp_nav_menu( array( 'theme_location' => 'pc','container_id'  => 'weihuan-header-num','container_class'  => 'weihuan-header-num', 'fallback_cb' => 'default_menu' ) ); 
?>  

你可能感兴趣的:(wordpress)