WordPress.org

Ready to get started?Download WordPress

Forums

get childpages content displayed in parent page (6 posts)

  1. julietjaxx
    Member
    Posted 7 years ago #

    hi dear wordpress useres,

    i have done a two column layout:

    http://lamar-reisen.de/wale.html (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

    wale
    - "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

  2. Kafkaesqui

    Posted 7 years ago #

    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:

    http://wordpress.pastebin.ca/219234

    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.

  3. julietjaxx
    Member
    Posted 7 years ago #

    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.

    THANK YOU VERY VERY MUCH!

    Greetings from Leipzig Germany!

  4. julietjaxx
    Member
    Posted 7 years ago #

    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

  5. julietjaxx
    Member
    Posted 7 years ago #

    Works fine in 2.2 RC1 - strange... really strange

  6. emanoelmelo
    Member
    Posted 7 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic