if (($layout == 'layout1' || $layout == 'layout3') && $i == 1) { $thumb_size = 'large'; } else { $thumb_size = 'quadro-med-thumb'; } ?> <?php // Get post format $post_format = get_post_format($post_id); // Bring Feat. Image or Screenshot if video post if ($post_format != 'video' || has_post_thumbnail()) { $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), $thumb_size); $image = $image[0]; } else { $image = quadro_video_screenshot_url(get_the_content()); } $back_img = 'style="background-image: url(\'' . $image . '\');"'; ?> <article> <a href="<?php the_permalink(); ?> " rel="bookmark"> <div class="display-back-img lazy" data-original="<?php echo $image[0]; ?> " <?php echo $back_img;
<?php if ($videoposts->have_posts()) { while ($videoposts->have_posts()) { $videoposts->the_post(); ?> <li class="videos-nav-item format-video"> <?php if (has_post_thumbnail() && !post_password_required()) { ?> <?php the_post_thumbnail('thumbnail'); ?> <?php } else { // there's no thumbnail, try to bring a video screenshot echo '<img src="' . quadro_video_screenshot_url(get_the_content()) . '">'; } ?> </li> <?php } } // ends 'videoposts' loop ?> <?php wp_reset_postdata(); ?> </ul> </div> </div>