This is my code to call the subpages of a parent page:
<?php $args = array( 'post_type' => 'page', 'numberposts' => -1, 'post_status' => null, 'post_parent' => '934', 'order' => ASC, 'orderby' => date ); $subpages = get_posts($args); foreach($subpages as $post) : setup_postdata($post); ?> <div class="tabs-content"> <?php the_content(); ?> </div> <?php endforeach; ?>
In this way i get the correct content from a page but obviously not his page template.
I tried to use:
<?php if (is_page_template( 'template-name.php' )) : ?>
I can’t figure out. Please someone knows a solution?
- The topic ‘Get a Page Template outstide the loop’ is closed to new replies.