/** * A helper conditional function that returns a boolean value. * * @return bool Whether there are featured posts. */ function cover_has_featured_posts() { return !is_paged() && (bool) cover_get_featured_posts(); }
<?php /** * Include for Jetpack featured content * * @package Cover */ ?> <div class="featured-container"> <ul> <?php $img = ''; $featured_posts = cover_get_featured_posts(); foreach ((array) $featured_posts as $order => $post) { setup_postdata($post); if ('' != get_the_post_thumbnail()) { $img_arr = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail'); $img = $img_arr[0]; } ?> <li> <a href="<?php the_permalink(); ?> " rel="bookmark"> <div class="cover<?php if ('' != $img) {