<?php 
/**
 * Trending news home slider
**/ 
?>
<?php
function wide_slider() {?>
<div id="slider-container">
	<div class="wide-slider">
		<ul class="slides">
			<?php $tn_posts = new WP_Query(array( 'tag' => get_option('tn_wide_tags'), 'posts_per_page' => 5)); while($tn_posts->have_posts()) : $tn_posts->the_post();?>
			<li>
				<?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) { ?>
				<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
				<?php the_post_thumbnail('slider-img');?>
				</a>
				<?php } ?>
				<div class="slider-text-box">
                	<span class="slide-date"><?php echo get_the_date(); ?></span>		
					<div class="slide-title"><h2><a href="<?php the_permalink() ?>">
						<?php the_title(); ?>
						</a></h2>
					</div><!--slider-text-box-->
					<div class="slide-info">
						<span class="slide-excerpt">
							<?php  $tn_subtitle = get_post_meta(get_the_ID(), 'tn_sub_title', true); if(empty($tn_subtitle)) { echo excerpt(22); }  else { echo $tn_subtitle;}  ?>                         
						</span>
					</div><!--slider-info-->
				</div><!--slider-text-box-->
			</li>
			<?php endwhile; ?>
		</ul>
	</div><!--flexslider-->
</div><!--slider-container-->




<div class="wide-slider-control">
	<ul>
		<?php $tn_posts = new WP_Query(array( 'tag' => get_option('tn_wide_tags'), 'posts_per_page' => 5)); while($tn_posts->have_posts()) : $tn_posts->the_post();?>
		<li>
			<div class="wide-slider-thumb">
				<?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) { ?>
				<a href="#" title="<?php the_title(); ?>">
				<?php the_post_thumbnail('slider-thumb'); ?>
				</a>
				<?php } ?>
			</div><!---wide-slider-thumb--> 
		</li>
		<?php endwhile; ?>
	</ul>
</div><!--wide-slider-control-->





<?php }; ?>