hybrid_get_setting( 'featured_category' ), 'showposts' => hybrid_get_setting( 'featured_posts' ), 'ignore_sticky_posts' => 1, 'post_status' => 'publish', 'no_found_rows' => true, ); // No selected categories, use Sticky Posts else : $feature_query = array( 'post__in' => get_option( 'sticky_posts' ), 'showposts' => hybrid_get_setting( 'featured_posts' ), 'post_status' => 'publish', 'no_found_rows' => true, ); endif; ?> have_posts() ) : ?>

have_posts() ) : $loop->the_post(); ?>
'slider', 'attachment' => false, 'meta_key' => null, // Don't allow to set thumbnail with custom field. That way you can have 2 thumbnails. One for the post and one for the slider 'image_class' => 'thumbnail', 'echo' => false ) ); $thumbnail_size = cakifo_get_image_size( 'slider' ); // There's a thumbnail! if ( $thumbnail ) : echo $thumbnail; /** * Try to embed a video from the post content */ elseif ( has_post_format( 'video' ) ) : // oEmbed stores the video HTML in a custom field that starts with '_oembed_' $post_metas = get_post_custom_keys(); if ( ! empty( $post_metas ) ) : foreach( $post_metas as $post_meta_key ) : if ( '_oembed_' == substr( $post_meta_key, 0, 8 ) ) { $video = get_post_meta( get_the_ID(), $post_meta_key, true ); // Continue looping if the oEmbed is broken if ( '{{unknown}}' == $video ) continue; // We only want the first video break; } endforeach; endif; // There's a video! if ( isset( $video ) ) { // Get the original width and height preg_match('/width="(\d+)(px)?" height="(\d+)(px)?"/', $video, $matches); $width = intval( $matches[1] ); $height = intval( $matches[3] ); // Calculate the new height to maintain the right aspect ratio $new_width = $thumbnail_size['width']; $new_height = intval( $new_width * $height / $width ); // Change the width and height attributes $video = preg_replace('/width="(\d+)(px)?" height="(\d+)(px)?"/', 'width="' . $new_width . '" height="' . $new_height . '"', $video); echo '
' . $video . '
'; } endif; unset( $thumbnail, $video ); endif; ?>
»', 'cakifo' ); ?>