have_posts() ) { while ( $block_query->have_posts() ) { $block_query->the_post(); if ( has_post_thumbnail() ) { $post_img = 'has-image'; } else { $post_img = 'no-image'; } ?>