WordPress.org

Ready to get started?Download WordPress

Forums

Help with drop-down menus (4 posts)

  1. sleepy_daze
    Member
    Posted 1 year ago #

    Hey, could someone help me create a horizontal navigation drop-down menu for the Gracia theme? The following is in my header.php code:

    <div class="navcontainer">
    		<?php
                        if(function_exists('wp_nav_menu')) {
                            wp_nav_menu( 'depth=1&theme_location=menu_2&menu_id=nav&container=&fallback_cb=menu_2_default');
                        } else {
                            menu_2_default();
                        }
    
                        function menu_2_default()
                        {
                            ?>
                            <ul id="nav">
        						<li <?php if(is_home()) { echo ' class="current-cat" '; } ?>><a href="<?php bloginfo('url'); ?>">Home</a></li><!--
        						<?php wp_list_pages('depth=2&hide_empty=0&orderby=name&order=ASC&title_li=' ); ?>-->
        					</ul>
                            <?php
                        }
                    ?>		
    
    				</div>

    The second part is commented out because it reveals ALL of the pages on the website. However, I don't want it to do that. There are parent and children (and even grandchildren) pages and I want to create drop-down menus that reflects that hierarchy. Please help!

    I've created a custom menu that shows the hierarchy, so is there a way to call that custom menu (which is called "Navigation")?

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Starting a new duplicate thread makes it very difficult and frustrating for people who are trying to help -- if you have new, additional information, you can add it to the existing thread.

    http://wordpress.org/support/topic/gracia-theme-navigation?replies=21

  3. sleepy_daze
    Member
    Posted 1 year ago #

    Sorry about that! I just don't know how to delete this thread now.

  4. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    You can't delete it - no worries, just continue on the other one. It just works better as a new person will know what you've already tried, etc., rather than starting from square one here.

Topic Closed

This topic has been closed to new replies.

About this Topic