我正在使用自定义导航步行器,并想创建一个树形菜单。
这是完整导航的 HTML 结构
<ul class="navbar-nav">
<li class="has_dropdown">
<a href="index.html">HOME</a>
<div class="dropdowns dropdown--menu">
<ul>
<li>
<a href="index.html">Home Multi Vendor</a>
</li>
<li>
<a href="index-single.html">Home Two Single User</a>
</li>
<li>
<a href="index3.html">Home Three Product</a>
</li>
</ul>
</div>
</li>
<li class="has_dropdown">
<a href="all-products-list.html">all product</a>
<div class="dropdowns dropdown--menu">
<ul>
<li>
<a href="all-products.html">Recent Items</a>
</li>
<li>
<a href="all-products.html">Popular Items</a>
</li>
<li>
<a href="index3.html">Free Templates</a>
</li>
<li>
<a href="#">Follow Feed</a>
</li>
<li>
<a href="#">Top Authors</a>
</li>
</ul>
</div>
这是 wp_nav_menu 的 HTML 调用:
<?php
$args = array(
'container' => 'ul',
'theme_location' => 'primary-menu',
'menu_class' => 'navbar-nav',
);
wp_nav_menu( $args );
?>
如何使用 Walker 功能做到这一点