Support » Themes and Templates » get childpages content displayed in parent page

  • hi dear wordpress useres,

    i have done a two column layout: (this is still a static html version of the site, but illustrates the problem fairly well)

    the maincontent is a static page… the two modules in the sidebar are subpages of the wale page.

    so in the pageadministration area of WP 2.0.4 this willl look like this

    – “gutes gespuer”
    – “wussten sie”

    so here is the question… how do I write a pagetemplate that displays its own content in the loop (easy i know) AND the content of all of its childpages in the right sidebar (there is an own <div> for it).

    importent: I need the content and the title of each childpage (not a referer for some sort of navigation – list_pages() wont help).

    thanks for your help in advance

Viewing 5 replies - 1 through 5 (of 5 total)
  • I assume you want child Pages displayed in the sidebar while on the parent Page *or* any child Page it’s ‘related’ to. The following code example will do that:

    Looking over your demo page, I suspect you’ll be wanting more than this, though…

    Future readers, keep in mind this is designed to work only with top level parent Pages and their immediate children.

    you ultimately hit the nail on its head! very cool – it looks pretty complicated when you read it first but it gets clear after a little while.


    Greetings from Leipzig Germany!

    Hi Kafkaesqui,

    this script used to work fine until wordpress 2.1.3 came along. in 2.1.3 it causes weired output => lots of closing </p> which have never been opened and stuff like that.

    really weired… gotta check with 2.2 RC1

    Works fine in 2.2 RC1 – strange… really strange

    Is there a way to create also a list of child pages as a submenu that anchor links to the right below loaded pages?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘get childpages content displayed in parent page’ is closed to new replies.