'orderby' => 'menu_order'
);
-
+ $post_parent = $post->ID;
$parent = new WP_Query( $args );
foreach ($parent as $p){
// echo '<pre>', print_r($p), '</pre>';
<div class="row">
<?php if ( $parent->have_posts() ) : ?>
<?php while ( $parent->have_posts() ) : $parent->the_post(); ?>
- <?php $id = get_the_ID(); ?>
-
- <?php
- $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($id), 'glm_block');
-// echo $image_data;
+ <?php $id = get_the_ID();
+ if(get_post_thumbnail_id($id)){
+ $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($id), 'glm_block');
+ } else {
+ $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post_parent), 'glm_block');
+ }
?>
<div id="<?php the_ID(); ?>" class="small-12 medium-4 large-3 columns child-page">