Support » Themes and Templates » Display submenu only

  • Hi

    In previous versions of WordPress if I wanted to display a list of child pages I’d just use something like:
    <ul><?php wp_list_pages('title_li=&child_of='.$post->ID); ?> </ul>
    as described at

    I have been trying to work out how to do this with the new menu system in 3.0 and so far have found nothing. Can anyone help?


Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator keesiemeijer


    try this:
    <ul><?php wp_page_menu('title_li=&child_of='.$post->ID); ?> </ul>
    It will parse the arguments of wp_list_pages.
    if you want it in a variable

    $html = wp_page_menu('title_li=&child_of='.$post->ID. '&echo=0');
    echo $html;

    As far as I can tell that is still displaying the page structure (when I change the menu structure it still displays sub-pages as opposed to sub-menu items)


    This works but is is it possible to limit in only 1 depth?


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display submenu only’ is closed to new replies.