Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to customize the menu widget in sense to add some classes which would make it responsive. How do I override the default widget for menus?

I use a custom template which supports bootstrap 3. I set a menu as widget and I make the presence in my sidebar.

the mark-up should look like

 <nav class="navbar navbar-default" role="navigation">

        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
        </div>

        <div class="collapse navbar-collapse">
            <div class="panel-heading">Sidebar22</div>
            <ul class="nav nav-stacked">
                <li class="active"><a href="#">Link</a></li>
                <li><a href="#">Link</a></li>
                <li><a href="#">Link</a></li>
                <li><a href="#">Link</a></li>              
            </ul>


        </div><!-- /.navbar-collapse -->
    </nav> 

Can I override the menu widget generation in my functions.php?!

share|improve this question
2  
Please edit your question to indicate the specific markup you need for the menu. The answer could be a matter of parameters passed to the Widget/menu, or it could require a custom menu walker - but it all depends on your exact needs. (P.S. why not just use the existing classes to define responsive CSS?) –  Chip Bennett Feb 23 at 15:12
    
Thanks for feedback can you give me an example how to make it responsive with the existing classes I'm quite newbie –  fefe Feb 23 at 15:30
    
The actual CSS component of this question will be off-topic. See help center. –  s_ha_dum Feb 23 at 16:17
    
Okay doesn't matter I still search for a solution –  fefe Feb 23 at 16:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.