Advertisement
patrickc

Untitled

Jan 3rd, 2014
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.15 KB | None | 0 0
  1. <?php
  2. global $smof_data;
  3. $show=get_post_meta($post->ID, 'reedwan_slider_show', TRUE);
  4. $category=get_post_meta($post->ID, 'reedwan_slider_category', TRUE);
  5. $number=get_post_meta($post->ID, 'reedwan_slider_count', TRUE);
  6. $excerpt=get_post_meta($post->ID, 'reedwan_slider_excerpt_length', TRUE);
  7. $rotate=get_post_meta($post->ID, 'reedwan_slider_rotate', TRUE);
  8. $show_headline=$smof_data['reedwan_show_headline'];
  9. ?>
  10. <div class="row_outer">
  11.     <div class="wpb_row vc_row-fluid">
  12.         <div class="slider-wrap">
  13.             <?php if($show_headline):?>
  14.                 <?php get_template_part( 'includes/headline' ); ?>
  15.             <?php endif; ?>
  16.             <?php if(is_page_template('template-homepage.php') && $show && $category!=''):?>
  17.             <div class="home_slider_wrap">
  18.             <div class="home_slider flexslider" data-interval="<?php echo $rotate; ?>" data-flex_fx="fade">
  19.                 <ul class="slides">
  20.                     <?php
  21.                     if ($category == -1) $slider = new WP_Query(array('showposts' => $number,'post_type' => 'post'));
  22.                     else $slider = new WP_Query(array('showposts' => $number,'post_type' => 'post', 'cat' => $category));
  23.                     while($slider->have_posts()): $slider->the_post();
  24.                     $videoURL = get_post_meta(get_the_ID(), 'reedwan_video_url', TRUE);
  25.                     if(has_post_format('video') && $videoURL){$video = '<a href="'.$videoURL.'" title="'.__('Play Video', 'realnews').'" class="play-video caption-type"><i class="icon-play-1"></i></a>';}
  26.                     else{$video ='';}
  27.                     $post_thumbnail = $thumb_size ='';
  28.                     $thumb_size = '679x380';
  29.                     $post_thumbnail = wpb_getImageBySize(array( 'post_id' => $post->ID, 'thumb_size' => $thumb_size ));
  30.                     $thumbnail = $post_thumbnail['thumbnail'];
  31.                     ?>
  32.                         <li>
  33.                             <div class="wpb_row vc_row-fluid">
  34.                                 <div class="desk"> 
  35.                                     <div class="home-slide-caption vc_span5 wpb_column">
  36.                                         <div class="cal">
  37.                                             <span class="date"><?php the_time('d') ?></span>
  38.                                             <span class="year"><?php the_time('Y') ?></span>
  39.                                             <span class="month"><?php the_time('F') ?></span>
  40.                                         </div>
  41.                                         <h1 class="title">
  42.                                             <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
  43.                                         </h1>
  44.                                         <div class="clear"></div>
  45.                                         <div class="excerpt">
  46.                                             <p><?php echo string_limit_words(get_the_excerpt(),$excerpt)?></p>
  47.                                             <span class="readmore"><a href="<?php the_permalink(); ?>">&#40; <?php _e(' Read More','realnews') ?> &#41;</a></span>
  48.                                         </div>
  49.                                     </div>
  50.                                     <div class="home-slide-image vc_span7 wpb_column">
  51.                                         <?php if(has_post_thumbnail()): ?>
  52.                                             <a href="<?php the_permalink(); ?>"><?php echo $thumbnail; ?></a>
  53.                                         <?php endif; ?>
  54.                                         <?php echo $video; ?>
  55.                                     </div>
  56.                                 </div>
  57.                                 <div class="excerpt mobile">
  58.                                     <div class="clear"></div>
  59.                                     <p><?php echo string_limit_words(get_the_excerpt(),$excerpt)?></p>
  60.                                     <span class="readmore"><a href="<?php the_permalink(); ?>"><?php _e(' read more &rarr;','realnews') ?></a></span>
  61.                                 </div>
  62.                             </div>
  63.                         </li>
  64.                     <?php
  65.                     endwhile;
  66.                     wp_reset_query();
  67.                     ?>
  68.                 </ul>
  69.             </div>
  70.             </div>
  71.             <?php endif; ?>
  72.         </div>
  73.     </div>
  74. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement