Support » Themes and Templates » Template to print all subpages

  • olalindberg

    (@olalindberg)


    I’m trying to build a template that prints all pages that are a subpage to the page that uses the template. Or actually…. I’m not really sure what I do 🙂 Any help? Thanks!

    You can see my php code here http://pastebin.com/ZVPhuLsR

Viewing 4 replies - 1 through 4 (of 4 total)
  • randyttp

    (@randyttp)

    Something like this maybe – it might help you go in the right direction.

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    specifically looking at

    $subpages = get_pages(array("child_of"=>$post->ID));

    and

    if ( ($subpages != null) && ($page->ID == $post->ID) ):

    olalindberg

    (@olalindberg)

    Thanks a lot. I think you lost some code… Can you repost using pastebin?

    olalindberg

    (@olalindberg)

    I got the subscription email where your code was included and copied it from there. I think there is enough info here to solve my issue.

    http://pastebin.com/jp22JerF

    Thanks a lot!

    olalindberg

    (@olalindberg)

    Here is how I did. Seems to work fine. Thanks again!

    http://pastebin.com/CXJiqWAz

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Template to print all subpages’ is closed to new replies.