WordPress.org

Ready to get started?Download WordPress

Forums

Dynamic Menu (6 posts)

  1. bremmerm
    Member
    Posted 4 years ago #

    I am creating a menu and I know the code:

    <?php wp_list_pages('title_li=&depth=2&sort_column=menu_order&exclude=23,49,64'); ?>

    is what i use when creating a menu but all I want to do is create a dynamic menu for one menu item, all children of one item is all I want to list, is there something something like : All children of page "services" be listed?
    Maybe like....
    <?php wp_list_pages('services_li=&depth=2&sort_column=menu_order&exclude=23,49,64'); ?>

    That doesn't work but its how I might think it would...

    Thanks!

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    <?php wp_list_pages('title_li=&depth=2&sort_column=menu_order&include=xx'); ?>

    I'm not totally sure here, but using the first bit of code you pasted to display a menu, couldn't that work.....just including only the page 'services' by ID, rather than excluding the rest of the pages?

  3. bremmerm
    Member
    Posted 4 years ago #

    I will give it a try..

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    http://codex.wordpress.org/wp_list_pages#Include_Pages_in_List

    may help, if I didn't get it quite right

  5. bremmerm
    Member
    Posted 4 years ago #

    Nope, that did not work.

  6. bremmerm
    Member
    Posted 4 years ago #

    Okay, I was accidentally changing the wrong code, so techincally it worked, but heres the problem...

    <li><a href="/index.php">Home Page</a></li>
     			<li class="cnav"><a href="/request-estimate">Free Estimate</a></li>
    			<?php wp_list_pages('title_li=&depth=2&sort_column=menu_order&include=22'); ?>
    			<li><a href="/windows-and-doors">Windows and Doors </a></li>
                <li><a href="/roof-replacment">Roof Replacement  </a></li>
                <li><a href="/mold-prevention">Mold Prevention</a></li>
    			<li><a href="/testimonials">Testimonials</a></li>
    			<li><a href="/installation-pictures">Pictures of Our Installation</a></li>
    			<li><a href="/about-us">About Us</a></li>
    			<li><a href="/videos">Watch Our Videos</a></li>
                <li><a href="/faq">FAQ</a>	</li>

    That is my list, when i mouse over the dynamic item it won't list its subpages...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.