/** * A helper conditional function that returns a boolean value. * * @return bool Whether there are featured posts. */ function adirondack_has_featured_posts() { return !is_paged() && (bool) adirondack_get_featured_posts(); }
<?php /** * The template for displaying featured content * * @package Adirondack */ global $in_featured; $in_featured = true; ?> <div id="featured-content" class="featured-content"> <div class="featured-content-inner"> <?php $featured_posts = adirondack_get_featured_posts(); foreach ((array) $featured_posts as $order => $post) { setup_postdata($post); // Include the featured content template. get_template_part('content', 'featured-post'); } wp_reset_postdata(); $in_featured = false; ?> </div><!-- .featured-content-inner --> </div><!-- #featured-content .featured-content -->