I have a parent page that is listing out all of it's child pages. This is done using the below:
<?php
$query = new
WP_Query('post_type=page&post_parent=80&posts_per_page=-1&orderby=menu_order&order=ASC');
while ( $query->have_posts() ) : $query->the_post(); ?>
<div class="col-sm-1" id="inside_team_list">
<a href="<?php echo get_permalink();?>">
<?php the_post_thumbnail();?>
</a>
</div>
<?php //the_title();?>
<?php endwhile;
wp_reset_postdata();
?>
Some of the child pages have different templates. What I've been trying to figure out is if it is possible to add some css design tweaks to the list of child pages based on their page templates.
E.G:
if ( is_page_template('template1.php') ){ ?>
<div style=" border-top: 3px solid #000;">
<div class="col-lg-3"id="child_thumb">
<a href="<?php echo get_permalink();?>">
<div class="work_title"><?php echo the_title(); ?></div>
<?php the_post_thumbnail();?>
</a>
</div>
</div>
<?php } else{ echo 'different'; }?>
The issue I keep running into is that the is_page_template function is only checking for the current page template, not the page templates of all the child pages.
Any help would be greatly appreciated.
Aucun commentaire:
Enregistrer un commentaire