WordPress.org

Ready to get started?Download WordPress

Forums

combine main menu and sub menu help please (3 posts)

  1. cannon303
    Member
    Posted 2 years ago #

    Hi I'm sure this query will have been brought up before now but searching only brings up people who want to display side nav sub menus only. My query is differentAnyway here is what I need a quick answer to:

    I have a 3 tier hierarchy navigation in a vertical side bar and only want to display the sub menu when you are on the parent page:

    Lets say you are on the home page and it doesn't have any children then the nav would be:

    <ul>
    	<li><a href="#">Home</a></li>
    	<li><a href="#">Services</a></li>
    	<li><a href="#">Contact</a></li>
    </ul>

    Now let's say you are on the Services page which does have children the nav would be:

    <ul>
    	<li><a href="#">Home</a></li>
    	<li><a href="#">Services</a>
                <ul>
                    <li><a href="#">Repairs</a></li>
                    <li><a href="#">Replacements</a></li>
                </ul>
            </li>
    	<li><a href="#">Contact</li>
    </ul>

    And now lets say you are on the repairs page which also has children:

    <ul>
    	<li><a href="#">Home</a></li>
    	<li><a href="#">Services</a>
                <ul>
                    <li><a href="#">Repairs</a>
                           <ul>
                              <li><a href="#">Punctures</a></li>
                              <li><a href="#">Headlights</a></li>
                           </ul>
                    </li>
                    <li><a href="#">Replacements</a></li>
                </ul>
            </li>
    	<li><a href="#">Contact</li>
    </ul>

    Is there any plugin that will easily help me do this?

    Alternatively I've tried building a menu in the wordpress menu tab but that displays all pages regardless of where you are on the site, is there any way to hack or specify some argument for it?

    Also in the pages menu I can specify that some pages are sub pages by using the "parent" drop down but again this displays a full nested list on the page.

    I want to only show the nested list when you are on the relevant page.

    Any help is much apreciated.

    Thanks

    Chris

  2. fonglh
    Member
    Posted 2 years ago #

  3. cannon303
    Member
    Posted 2 years ago #

    Hi fonglh thanks for your response, however I've already got my menu tab enabled and it works but I don't know how to modify it to meet my requirements as described above. It just outputs all of the nested lists regardless of where you are in the site.

Topic Closed

This topic has been closed to new replies.

About this Topic