0

我想使用创建下面的代码wp_nav_menu。如何使用创建此代码wp_nav_menu?另外如何使用 UL 类页面更改为页面wp_nav_menu

<div class="collapse navbar-collapse" id="navbarNavDropdown">
    <ul class="navbar-nav hatch-main-nav-inner hatch-main-nav-inner--red">
        <li class="nav-item">
            <a class="nav-link" href="<?php bloginfo('url'); ?>/about">About</a>
        </li>
        <li class="nav-item active">
            <a class="nav-link" href="<?php bloginfo('url'); ?>/co-working">Co-working <span class="sr-only">(current)</span></a>
            <div class="hatch-secondary-menu">
                <a class="hatch-secondary-menu-item hatch-secondary-menu-item--active" href="<?php bloginfo('url'); ?>/co-working">Overview</a>
                <a class="hatch-secondary-menu-item" href="#">Pricing</a>
                <a class="hatch-secondary-menu-item" href="#">Perks</a>
                <a class="hatch-secondary-menu-item" href="#">Locations</a>
            </div>
        </li>
        <li class="nav-item">
            <a class="nav-link" href="<?php bloginfo('url'); ?>/start-ups">Start-ups</a>
        </li>
        <li class="nav-item">
            <a class="nav-link" href="<?php bloginfo('url'); ?>/membership">Membership</a>
        </li>
        <li class="nav-item">
            <a class="nav-link" href="<?php bloginfo('url'); ?>/events">Events</a>
        </li>
        <li class="nav-item">
            <a class="nav-link" href="<?php bloginfo('url'); ?>/contact">Contact</a>
        </li>

    </ul>
</div>

我现在使用此代码:

<?php
wp_nav_menu( 
    array( 
        'menu_class' => 'navbar-nav hatch-main-nav-inner hatch-main-nav-inner--red', 
        'container' => false, 
        'theme_location' => 'header-menu', 
        'items_wrap' => '<ul>%3$s</ul>', 
        'depth' => 1, 

    ) 
);
?>

使用此代码我可以查看主 URL,但我不知道如何查看子菜单项。

4

0 回答 0