WordPress.org

Ready to get started?Download WordPress

Forums

How to Make a Page Menu Dropdown with Hierarchy? (2 posts)

  1. tankard
    Member
    Posted 2 years ago #

    Hi,

    I'm trying to make a fancy dropdown menu for my pages. Some of my pages have subpages (children), some don't. I've been playing with the wp_list_pages function but I cannot get the children to fit in. My static code looks like this and the question is how do I make it dynamic. Any ideas please?

    <ul id="menu">
    <li><a href="#">Page Element 1</a>
                        <ul class="dropdown">
    		<li><a href="#">Child 1</a></li>
                    <li><a href="#">Child 2</a></li>
                    <li><a href="#">Child 3</a></li>
    		    </ul>
                </li><!-- End Page Element -->
        </ul><!-- End Menu -->
  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    instead of trying to change the output of wp_list_pages() to match your static code, try to match the css to the output of wp_list_pages()

    http://codex.wordpress.org/Function_Reference/wp_list_pages
    http://codex.wordpress.org/Function_Reference/wp_list_pages#Markup_and_styling_of_page_items

    can you post a link to your site with the menu activ?

Topic Closed

This topic has been closed to new replies.

About this Topic