<?php /** * The template for displaying featured content * * @package WordPress * @subpackage Ambition * @since Ambition 1.0 */ ?> <section class="featured-slider"> <div class="slider-cycle"> <?php $i = 0; $featured_posts = ambition_get_featured_posts(); foreach ((array) $featured_posts as $order => $post) { setup_postdata($post); $i++; $title_attribute = the_title_attribute(array('echo' => false)); $excerpt = get_the_excerpt(); if (1 == $i) { $classes = "slides displayblock"; } else { $classes = "slides displaynone"; } ?> <div class="<?php echo $classes; ?> "> <?php
/** * A helper conditional function that returns a boolean value. * @return bool Whether there are featured posts. */ function ambition_has_featured_posts() { return !is_paged() && (bool) ambition_get_featured_posts(); }