• I have created my own theme. The link is webbsmeden.com/.

    I have a menu-choice named “Shoes”, you can see it on the page. It has a sub-menu named “Damskor”. As you can see it displays the sub-menu too.

    I want the sub-menu to be displayed as a drop-down, like the normal way. How do I do that? Is it only CSS or do I have to edit code somewhere?

    The code for the menu in my theme in the php-file:

    <?php wp_nav_menu( array('menu' => 'Main', 'container' => 'nav' )); ?>

    How the code is shown on the page:

    <div class="menu">
    <ul>
    <li class="page_item page-item-2 current_page_parent">
    <a href="https://www.webbsmeden.com/about/">Home</a>
    </li>
    <li class="page_item page-item-25">
    <a href="https://www.webbsmeden.com/testing/">About the company</a>
    </li>
    <li class="page_item page-item-33"><a href="https://www.webbsmeden.com/about-the-store/">About the store</a>
    </li>
    <li class="page_item page-item-35"><a href="https://www.webbsmeden.com/shoes/">Shoes</a>
    <ul class="children">
    <li class="page_item page-item-70">
    <a href="https://www.webbsmeden.com/shoes/damskor-2/">Damskor</a></li></ul></li>
    <li class="page_item page-item-37"><a href="https://www.webbsmeden.com/yogurt/">Yogurt</a>
    </li>
    <li class="page_item page-item-39"><a href="https://www.webbsmeden.com/contact-us/">Contact us</a></li>
    </ul>
    </div>

    How the code looks like in my html-file with working drop-down. I am using bootstrap:

    <li class="active"><a href="#">Home</a></li>
    							<li><a href="#">About the company</a></li>
    							<li><a href="#">About the store</a></li>
    							<li class="dropdown-submenu"><a href="#">Shoes</a>
    							<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
    								<li><a href="#">Sub menu</a></li>
    								<li><a href="#">Sub menu</a></li>
    								<li><a href="#">Sub menu</a></li>
    								<li><a href="#">Sub menu</a></li>
    							</ul></li>
    							<li><a href="#">Yogurt</a></li>
    							<li><a href="#">Contact us</a></li>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do display sub-menu’ is closed to new replies.