WordPress 菜单:从 ul 中删除第三级的 类
WordPress Menus : Remove classes from ul for third level
我正在使用 Bootstrap nav walker
用于创建 WordPress 菜单。
它创造了什么
<ul id="primary-menu" class="navbar-nav ml-lg-auto font-weight-bold">
<ul class="dropdown-menu animated fadeIn" aria-labelledby="menu-item-dropdown-119">
<ul class="dropdown-menu animated fadeIn" aria-labelledby="menu-item-dropdown-119">
<ul class="dropdown-menu animated fadeIn" aria-labelledby="menu-item-dropdown-119">
现在我不想在 UL 的第三级和第四级添加 类。怎么办?不用JS可以吗
三四级菜单可以写脚本
if ( $args->has_children && $depth === 0){ $class_names .= ' dropdown'; } elseif($args->has_children && $depth == 3){ $class_names .= ' '; }
尝试类似的东西。
我正在使用 Bootstrap nav walker
用于创建 WordPress 菜单。 它创造了什么
<ul id="primary-menu" class="navbar-nav ml-lg-auto font-weight-bold">
<ul class="dropdown-menu animated fadeIn" aria-labelledby="menu-item-dropdown-119">
<ul class="dropdown-menu animated fadeIn" aria-labelledby="menu-item-dropdown-119">
<ul class="dropdown-menu animated fadeIn" aria-labelledby="menu-item-dropdown-119">
现在我不想在 UL 的第三级和第四级添加 类。怎么办?不用JS可以吗
三四级菜单可以写脚本
if ( $args->has_children && $depth === 0){ $class_names .= ' dropdown'; } elseif($args->has_children && $depth == 3){ $class_names .= ' '; }
尝试类似的东西。