<section class="swiper"> <!-- Slider main container --> <div class="swiper-container"> <!-- Additional required wrapper --> <div class="swiper-wrapper"> <!-- Slides --> <?php /** * Fires before the Twenty Fourteen featured content. * * @since Twenty Fourteen 1.0 */ do_action('tpbc_featured_posts_before'); $featured_posts = tpbc_get_featured_posts(); foreach ((array) $featured_posts as $order => $post) { setup_postdata($post); ?> <div class="swiper-slide" style="background-image: url('<?php the_post_thumbnail_url(); ?> ');"> <div> <h1 class="inverse"> <a href="<?php the_permalink(); ?> "><?php the_title(); ?>
/** * A helper conditional function that returns a boolean value. * * @return bool Whether there are featured posts. */ function tpbc_has_featured_posts() { return !is_paged() && (bool) tpbc_get_featured_posts(); }