0

I want to create below code using wp_nav_menu. How do I create this code using wp_nav_menu? Also how to change UL class page to page using 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>

I used this code for now:

<?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, 

    ) 
);
?>

Using this code I can view main URL, but I don't know how to view sub menu items.

Red
  • 6,599
  • 9
  • 43
  • 85
Buddika
  • 11
  • 1
  • 6
  • what you did so far? show us your efforts if you stuck then will help you there. – dipmala Jun 18 '18 at 10:14
  • I used this code for now 'navbar-nav hatch-main-nav-inner hatch-main-nav-inner--red', 'container' => false, 'theme_location' => 'header-menu', 'items_wrap' => '
      %3$s
    ', 'depth' => 1, ) ); ?> using this code i can view main url but i don't no how to view sub menu items
    – Buddika Jun 18 '18 at 10:18
  • Kindly read this https://code.tutsplus.com/tutorials/function-examination-wp_nav_menu--wp-25525 it will help you to solve this. – dipmala Jun 18 '18 at 11:09
  • formatting, grammar, hyperlink, added comment with code to question – Armali Jun 18 '18 at 11:16

0 Answers0