[英]Add custom class to specific wp_nav_menu() ul
Is there a way to apply a custom class to a WordPress menu <ul>
? 有没有办法将自定义类应用于WordPress菜单
<ul>
? Is there an argument of the 'class' => 'my_class'
type? 是否有
'class' => 'my_class'
类型的参数?
I use 我用
<?php wp_nav_menu( array( 'theme_location' => 'custom-menu' ) ); ?>
This should work, I think: 我认为这应该有效:
<?php wp_nav_menu( array('theme_location' =>'custom-menu',
'menu_class' =>'your-class')); ?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.