<?php
 /**
  *
  *		Template for Featured Category Area
  *
 **/
 ?>
 
 	<div id="featured-category" class="container">
	 	
	 	<h2 id="section-title"><?php echo get_theme_mod('kreatif-fc-title', ''); ?></h2>
 	
 	<?php
 	$args	=	array(
	 				'post_type'		=> 'post',
	 				'cat'	=> esc_html(get_theme_mod('kreatif-fc-select', '-')),
	 				'ignore_sticky_posts'	=> true,
	 				'posts_per_page'	=> 4
 				);
 
 	$fc1	=	new WP_Query( $args );

 				while( $fc1	-> have_posts()) : $fc1 -> the_post() ; ?>
 				
 				<div class="fc-wrapper col-lg-3 col-md-3 col-sm-6 col-xs-12">
	 				<div class="fc-thumb">
		 				<?php if (has_post_thumbnail()) : ?>
		 						<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('kreatif-fc'); ?></a>
		 					<?php else : ?>
		 						<a href="<?php the_permalink($fc1->post->ID); ?>"><img src="<?php echo get_template_directory_uri() . '/images/dthumb-fc.jpg'; ?>"></a>
		 				<?php endif; ?>
	 				</div>
	 				<div class="fc-title">
									<?php 
						if (strlen(get_the_title()) >= 30) { ?>
							<h2 class="entry-title">
								<a href="<?php the_permalink(); ?>" data-title="<?php esc_attr(get_the_title()); ?>" rel="bookmark">
									<?php echo esc_attr(substr(get_the_title(), 0, 29))."...";
								} else { ?>
									<h2 class="entry-title"><a href="<?php esc_url(the_permalink()); ?>" rel="bookmark">
								<?php	the_title_attribute();	
									}	
										 ?>
								</a>
							</h1>
						</div>
 				</div>
 				<?php endwhile; ?>
 				<?php wp_reset_query(); ?>
</div> 
