WordPress.org

Ready to get started?Download WordPress

Forums

Loading child pages into parent page (6 posts)

  1. mortalwombat
    Member
    Posted 2 years ago #

    I am building a theme for a wedding photographer and need a little help in the best way to go about working up their layout for the pages

    Let me first explain their sitemap, which will explain what I am trying to do. They want 3 major sections, plus the blog. Each section has similar content, but some parts will be changed. The sitemap looks like this:

    Home (Pick section)
    - Weddings
    - About
    - Portfolio
    - Products
    - Contact
    - Families
    - About
    - Portfolio
    - Products
    - Contact
    - Seniors
    - About
    - Portfolio
    - Products
    - Contact
    - Blog

    (parent pages are in bold)

    So the child pages, even though they are named the same, will have unique content to match the section name. Here's where my problem comes in: Each section will display as a single page, but should be individual pages in the control panel. That means I need to create a page (Weddings, for example) that will load all of it's children pages, creating a long scrolling page of seperate sections for About, Portfolio, Product, and Contacts.

    What is the best way to go about this? I would love to use parent/child pages in the control panel, and have the code call them in order. That way they can add/remove sections as they see fit. Also, I would prefer not to use a plugin, if possible, so the layout won't break if there is an update that fails.

  2. mortalwombat
    Member
    Posted 2 years ago #

    Just a note of progress. I found this , and am investigating how to use it to do what I need. If someone wants to help, I would be very thankful.

  3. mortalwombat
    Member
    Posted 2 years ago #

    So I can use the link above to display the array of children pages. That works great, but I have no idea how to take the output of that and turn it into a loop that will display the title and content of each child page. My looping skills are weak.

  4. mortalwombat
    Member
    Posted 2 years ago #

    FOUND IT! Thanks for all the help. Here it is for anyone who stumbles upon this looking for help:
    http://codex.wordpress.org/Function_Reference/get_pages#Displaying_Child_pages_of_the_current_page_in_post_format

  5. imischa
    Member
    Posted 1 year ago #

    Thank you for posting! Very helpfull :)

  6. imischa
    Member
    Posted 1 year ago #

    BTW using pages is the way to go for doing SEO!

Topic Closed

This topic has been closed to new replies.

About this Topic