

<div class="fws2" id="fws2-instance1">
    <div class="slider_container">

	<?php 
    $featucat = get_option('op_feat_cat');
	$slides = get_option('op_feat_slides');
	if (get_option('op_recent_featured_flex') == 'Recent posts') {
	$my_query = new WP_Query('showposts='. $slides .'');	
	} else {
    $my_query = new WP_Query('showposts='. $slides .'&category_name='. $featucat .'');	
	}
    if ($my_query->have_posts()) :
    ?>					
		
    <?php while ($my_query->have_posts()) : $my_query->the_post();$do_not_duplicate = $post->ID; ?>	
		
            <div class="slide"> 
            <?php $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'post-thumbnails', false, '' ); $thumbnailSrc = $src[0]; ?>	
	        <?php $image = aq_resize( $thumbnailSrc, 1240, 500, true ); ?>
	     	<img alt="<?php the_title(); ?>" src="<?php echo $image ?>" />
			
			<div class="slide_content_box">
                <div class="slide_content">
                    <div class="slide_content_wrap">
					
                    <div class="slide_time"><?php the_time('F j, Y'); ?></div>

					<div class="slide_cats">  

					<?php
					$categories_string = '';
					foreach((get_the_category()) as $category) {
                    $category_term = $category->category_nicename . '';
					$categories_string .= '<a class="custom_cat_class '. $category_term .'" href="'.get_category_link( $category->term_id ).'" title="' . esc_attr( sprintf( __( "%s", 'my-text-domain' ), $category->name ) ) . '">'.$category->cat_name.'</a>';
	                } 
					$categories_string = trim($categories_string);
					echo $categories_string;
					?>

					</div>
					
                    <div class="clear"></div>
					
                    <h1 class="title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?> &raquo;</a></h1>

                   </div>
                </div>
            </div>
            </div>
     
        <?php endwhile; wp_reset_query(); ?> 
        <?php endif; ?>      
           

        </div>

        <div class="timers"></div>

        <div class="slidePrev"><span></span></div>
        <div class="slideNext"><span></span></div>

</div> 

<?php 
wp_enqueue_script('fwslider', BASE_URL . 'js/fwslider.js', false, '', true);
?>


