0

I'm new in WordPress so I'm sorry if I repeat question. I have theme in HTML/CSS and I want move theme to WordPress and I have problem with my menu. Below I show my problem. I have menu in HTML:

enter image description here

In WordPress my menu is:

enter image description here

HTML is:

<nav class="navbar-default sidebar pb-30">
<ul class="nav navbar-nav nav navbar-nav side-nav text-center">
<li >
    <a href="#">Home</a>
</li>  
<li >
    <a href="#">About Us</a>
</li>
<li>
    <a aria-expanded="true" class="collapsed" href="javascript:;" data-toggle="collapse" data-target="#colapse-item-1">Gallery
        <i class="ti-minus"></i> 
        <i class="ti-plus"></i>
    </a>
    <ul style="" aria-expanded="true" id="colapse-item-1" class="collapseItem collapse">
        <li>
            <a href="#">
                <i aria-hidden="true"></i>Gallery - 1

            </a>
        </li>
        <li>
            <a href="#">
                <i aria-hidden="true"></i>Gallery - 2

            </a>
        </li>
        <li>
            <a href="#">
                <i  aria-hidden="true"></i>Gallery - 3

            </a>
        </li>
        <li>
            <a href="#">
                <i aria-hidden="true"></i>Gallery - 4

            </a>
        </li>
        <li>
            <a href="#">
                <i aria-hidden="true"></i>Gallery - 5

            </a>
        </li>   
        <li>
            <a href="#">
                <i aria-hidden="true"></i>Gallery - 6

            </a>
        </li>                                   
    </ul>
</li>    
<li class="active"><a href="#">Contact</a></li> 

At this moment I display menu using:

<?php                         
$defaults = array (
  'theme_location' => 'menu',
  'container' => 'nav',
  'menu_class' => 'nav navbar-nav nav navbar-nav side-nav text-center'                     
 );                        
wp_nav_menu( $defaults );                        
?>  

But I don't know how correctly display/hidden submenu, how check link is children and display his parent links. How add

<ul style="" aria-expanded="true" id="colapse-item-1" class="collapseItem collapse">     

in second ul in my menu.

0

You can use walker class to update HTML. Please check following URL to get idea about how to manage HTML in walker class. URL : Walker Class

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.