1

I am trying to fetch WordPress Menu dynamically like this image

enter image description here

i try this code. it shows result but not exactly what i want. i need exactly like image, in image i have Menu name ABOUT US and right below it has WHO WE ARE, i am stuck to call WHO WE ARE and also DROPDOWN help needed. THANKS

$defaults = array(
    'theme_location'  => '',
    'menu'            => '',
    'container'       => 'div',
    'container_class' => 'top-menu',
    'container_id'    => '',
    'menu_class'      => 'sf-menu sf-js-enabled',
    'menu_id'         => '',
    'echo'            => true,
    'fallback_cb'     => 'wp_page_menu',
    'before'          => '',
    'after'           => '',
    'link_before'     => '<span>',
    'link_after'      => '</span>',
    'items_wrap'      => '<ul class="%2$s">%3$s</ul>',
    'depth'           => 0,
    'walker'          => ''
);

wp_nav_menu( $defaults );

?>


<div class="top-menu">
                <ul class="sf-menu sf-js-enabled">
                    <li class="current_page_item sfHover"><a href="index.html">Home<span>Main Homepage</span></a></li>
                    <li class=""><a href="aboutus.html">About Us<span>Who We Are</span></a>
                        <ul style="display: none; visibility: hidden;">
                            <li><a href="alternate.html" style="margin-left: 0px;">Alternate Homepage</a></li>
                            <li><a href="full_width.html" style="margin-left: 0px;">Full Width Page</a></li>
                            <li><a href="blog_single.html" style="margin-left: 0px;">Blog Single Page</a></li>                                                      
                        </ul>
                    </li>
                    <li class=""><a href="services.html">Services<span>What We do</span></a>
                        <ul style="display: none; visibility: hidden;">
                        <!-- start:drop down menu -->
                            <li><a href="#">Web Designing</a></li>
                            <li><a href="#">HTML / CSS Coding</a></li>
                            <li><a href="#">Designing</a></li>
                            <li><a href="#">Graphics</a></li>
                            <li><a href="#">SEO Marketing</a></li>
                        </ul>
                        <!-- end:drop down menu -->
                    </li>
                    <li class=""> <a href="portfolio.html">Portfolio<span>Our Works</span></a>
                        <ul style="display: none; visibility: hidden;">
                            <!--start:drop down menu -->
                            <li><a href="#">Websites</a></li>
                            <li><a href="#">Logos</a></li>
                            <li><a href="#">Prints</a></li>
                        </ul>
                        <!-- end:drop down menu -->
                    </li>
                    <li class=""> <a href="blog.html">Blog<span>Our Community</span></a>
                        <ul style="display: none; visibility: hidden;">
                            <li><a href="blog_single.html">Blog Single Page</a></li>                            
                        </ul>
                    </li>
                    <li class=""> <a href="contact.php">Contact Us<span>Location Info</span></a> </li>
                </ul>
            </div>
4
  • Did you try reading the codex? codex.wordpress.org/Function_Reference/wp_nav_menu Commented Sep 5, 2014 at 7:38
  • yes i read this but can't find any solution. if you provide me code i'll remain thankful to you. i am stuck to fetch two menus at a time like <a href="aboutus.html">About Us<span>Who We Are</span></a> i can fetch dropdown and menus but i don't have any idea how to fetch like that. Commented Sep 5, 2014 at 8:28
  • Just saw your question on CSS-Tricks. We need more info here and please show us how you're calling wp_nav_menu in your theme template. Are you saying that wp_nav_menu doesn't output the menu item's 'description'? If so you need to look at $item->description in a menu 'walker'. Here's a good thread on it: wordpress.stackexchange.com/questions/14037/… Commented Sep 5, 2014 at 10:20
  • i add more info regarding question have a look please. thanks. Commented Sep 5, 2014 at 10:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.