将自定义类添加到特定的wp_nav_menu()ul

时间:2016-06-27 17:52:08

标签: php wordpress

有没有办法将自定义类应用于WordPress菜单<ul>?是否存在'class' => 'my_class'类型的参数?

我用

<?php wp_nav_menu( array( 'theme_location' => 'custom-menu' ) ); ?>

1 个答案:

答案 0 :(得分:3)

这应该有效,我想:

<?php wp_nav_menu( array('theme_location' =>'custom-menu',
'menu_class' =>'your-class')); ?>