• For a costum theme i try to achieve this:

    https://dl.dropboxusercontent.com/u/204337/submenu/submenu.jpg

    My designer for this project decided to add a widget (a list of links) INSIDE a submenu besides the standard submenu items.

    The full width submenu with all the submenuitems is no problem, but i don’t know how to add extra content in a submenu besides the submenuitems.

    Is there a way to add a widget or other content INSIDE a submenu?

    I develop the side on a local machine, so I can’t give a link just yet.

    In code it will be something like this:

    <nav>
        <ul>
           <li><a href="#">item 1</a></li>
           <li><a href="#">item 2</a>
               <ul>
                    <div class="Widget_inside_submen">
                       <p>How do I add this widget here?/p>
                    </div>
                    <li><a href="#">Sub-item 1</a></li>
                    <li><a href="#">Sub item 2</a></li>
                    <li><a href="#">Sub-item 3</a></li>
               </ul>
           </li>
           <li><a href="#">item 3</a></li>
           <li><a href="#">item 4</a></li>
        </ul>
    </nav>
Viewing 4 replies - 1 through 4 (of 4 total)
  • vishalnthoriya

    (@vishalnthoriya)

    Sir i also want to this type of menu if you will got solution then please let me know

    Thread Starter Soron

    (@soron)

    I did use a Costum Walker Class to extend the output of the submenu’s. This code in my functions.php file puts a list (ul) in a section before the submenu-items. I’m sure there must be a way to call for a sidebar to make the section dynamic instead.

    <?php
    class Walker_Page_Custom extends Walker_Nav_Menu {
    
    function start_lvl(&$output) {
        $output .= "<div>
    	<section>
    	  <header>
    	  	<h1>Meest populair</h1>
    	  </header>
    		<ul>
    			<li><a href='/verwarmen-en-koelen/cv-ketels/'>CV Ketels</a></li>
    			<li><a href='/verwarmen-en-koelen/pellet-kachels/'>Pellet-kachels</a></li>
    			<li><a href='/energie-besparen/zonnepanelen-pv/'>Zonnepanelen (PV)</a></li>
    			<li><a href='/domotica-en-beveiliging/domotica/'>Domotica</a></li>
    		</ul>
    	</section>
    	<ul>";
    }
    
    function end_lvl(&$output) {
        $output .= "</ul></div>";
    }
    
    }
    ?>

    Thanks but i think it is totally static menu i want to add dynamic can you help me?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Would it be easier to just use a mega menu plugin?
    https://www.ads-software.com/plugins/jquery-mega-menu/

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to add a widget inside a submenu?’ is closed to new replies.