displaying subpages on a page using different templates
-
Hello
I’m teaching myself WordPress by starting with the blankslate template and converting a previously designed website into a WordPress based site. One of the problems I haven’t been able to figure out is pulling content through different templates onto a single display page.
So, I have my Home page which is running a certain template and pulling content from a Static Page. I’d like to drop in another template that will pull content from a few other Static Pages (which are subpages of the Home page).
I’ve tried
get_post($id)->post_content
but that pulls only the sub-page content without running it through the template. (The correct template is assigned to the sub-pages). I’d also prefer to do it programtically by targeting all sub-pages rather than manually calling them by id.I was also looking at
get_template_part('sub-page-template')
but I don’t understand how to run the correct query to pull the correct sub-page content from the database and have it run through the template.Thank you!
- The topic ‘displaying subpages on a page using different templates’ is closed to new replies.