So, I've developed a one page theme that pulls in child pages of the parent in order create the layout. I also have it set up to pull each sub pages page template and display the content accordingly, like so.
<?php /* Template Name: Page- Home */ get_header(); ?> <?php $this_page=get_query_var('page_id'); $loop = new WP_Query( array('post_type'=>'page', 'posts_per_page' => -1, 'post_parent' => $this_page, 'orderby' => 'menu_order', 'order' => 'ASC') ); while ( $loop->have_posts() ) : $loop->the_post(); $template = get_post_meta( $post->ID, '_wp_page_template', true ); ?> <?php include(locate_template($template)); ?> <?php endwhile; wp_reset_postdata(); ?> <?php get_footer(); ?>
This works perfectly on the homepage, but I'm running into a problem trying to create another parent page with the same template for the company information. As I said, I have the same code in this new template, but something has gotten messed up, and in the About page, it only displays from the
<head> section to the end of my
<header>. The footer and beyond doesn't display. What I've found though is that I can comment out the include and it works perfectly.
Any ideas? Thanks!