0

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.

0

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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