Ejemplo n.º 1
0
/**
 * A helper conditional function that returns a boolean value.
 *
 * @since Shopera 1.0
 *
 * @return bool Whether there are featured posts.
 */
function shopera_has_featured_posts()
{
    return !is_paged() && (bool) shopera_get_featured_posts();
}
Ejemplo n.º 2
0
 * @subpackage Shopera
 * @since Shopera 1.0
 */
?>

<div class="featured-slider">
	<div id="featured-content" class="featured-content swiper-container">
		<div class="featured-content-inner swiper-wrapper">
		<?php 
/**
 * Fires before the Shopera 1.0 featured content.
 *
 * @since Shopera 1.0
 */
do_action('shopera_featured_posts_before');
$featured_posts = shopera_get_featured_posts();
foreach ((array) $featured_posts as $order => $post) {
    setup_postdata($post);
    // Include the featured content template.
    get_template_part('content', 'featured-post');
}
/**
 * Fires after the Shopera 1.0 featured content.
 *
 * @since Shopera 1.0
 */
do_action('shopera_featured_posts_after');
wp_reset_postdata();
?>
		</div><!-- .featured-content-inner -->
	</div><!-- #featured-content .featured-content -->