Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sparkling_featured_slider() {
- if ( is_front_page() && of_get_option( 'sparkling_slider_checkbox' ) == 1 ) {
- echo '<div class="flexslider">';
- echo '<ul class="slides">';
- $count = of_get_option( 'sparkling_slide_number' );
- $slidecat = of_get_option( 'sparkling_slide_categories' );
- $query = new WP_Query( array(
- 'cat' => $slidecat,
- 'posts_per_page' => $count,
- 'meta_query' => array(
- array(
- 'key' => '_thumbnail_id',
- 'compare' => 'EXISTS'
- ),
- ),
- ) );
- if ( $query->have_posts() ) :
- while ( $query->have_posts() ) : $query->the_post();
- if ( of_get_option( 'sparkling_slider_link_checkbox', 1 ) == 1 ) {
- echo '<li><a href="' . get_permalink() . '">';
- } else {
- echo '<li>';
- }
- if ( (function_exists( 'has_post_thumbnail' )) && ( has_post_thumbnail() ) ) :
- if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'photon' ) ) {
- $feat_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
- $args = array(
- 'resize' => '1920,550',
- );
- $photon_url = jetpack_photon_url( $feat_image_url[0], $args );
- echo '<img src="' . $photon_url . '">';
- } else {
- echo get_the_post_thumbnail( get_the_ID(), 'activello-slider' );
- }
- endif;
- echo '<div class="flex-caption">';
- if ( get_the_title() != '' ) { echo '<h2 class="entry-title">' . get_the_title() . '</h2>';
- }
- if ( get_the_excerpt() != '' ) { echo '<div class="excerpt">' . get_the_excerpt() . '</div>';
- }
- echo '</div>';
- echo '</a></li>';
- endwhile;
- endif;
- wp_reset_postdata();
- echo '</ul>';
- echo ' </div>';
- }// End if().
- }
Add Comment
Please, Sign In to add comment