Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a page structure like this:

  Home

  Projects
   - Work_1
   - Work_2
   - Work_3
   - Work_4

Home and Projects are Pages. Work_1 - Work_4 are pages with Projects as their parent.

When I click the Projects page I'm using this code to get the children of Projects as a sub menu, so I get Work_1 Work_2 Work_3 Work_4 as the sub menu.

  <?php
    if($post->post_parent)
    $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
    else
    $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
    if ($children) { ?>
    <ul>
    <?php echo $children; ?>
    </ul>
  <?php } ?>

How can I include include Projects in this sub menu so I get

Projects Work_1 Work_2 Work_3 Work_4

Hope I have explained this and thanks in advance for any help.

share|improve this question
add comment

1 Answer

Found it thanks - thought I'd looked here but I must of missed it.

http://codex.wordpress.org/Function_Reference/wp_list_pages#List_Sub-Pages

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.