<?php
/**
 * content.php
 *
 * The default template for displaying content.
 */

$blog_author_show = (isset($settings['show_author'])) 
						? $settings['show_author'] 
						: vinkmag_option( 'blog_author_show', 'yes' );
						
$blog_author_image_show = (isset($settings['show_author_image'])) 
						? $settings['show_author_image'] 
						: vinkmag_option( 'blog_author_image_show', 'yes' );

$blog_date_show			= (isset($settings['show_date'])) 
						? $settings['show_date'] 
						: vinkmag_option( 'blog_date_show', 'yes' );
$blog_cat_show			= (isset($settings['show_cat'])) 
						? $settings['show_cat'] 
						: vinkmag_option( 'blog_cat_show', 'yes' );
$crop					= (isset($settings['post_title_crop']))
						? $settings['post_title_crop']
						: 200;
						$desc_limit			= (isset($settings['desc_limit']))
						? $settings['desc_limit']
						: 35;
						
$desc_limit = vinkmag_desc_limit($desc_limit);

?>
<div <?php post_class('item post-content-box'); ?>>
<?php $cat = get_the_category(); ?>

	<div class="ts-post-thumb">
		<a href="<?php the_permalink() ?>">
			<img 
				class="img-fluid" 
				src="<?php echo esc_url(vinkmag_post_thumbnail(get_the_ID())); ?>" 
				alt="<?php echo esc_attr(vinkmag_alt(get_the_ID())); ?>">
		</a>
   </div>
   
	<div class="post-content">
		<?php if($blog_cat_show == 'yes'): ?> 
		<a 
			class="post-cat no-bg" 
			href="<?php echo get_category_link($cat[0]->term_id); ?>"
			style="<?php echo esc_attr(vinkmag_cat_style($cat[0]->term_id, 'color_only')); ?>"
			>
			<?php echo get_cat_name($cat[0]->term_id); ?>
		</a>
		<?php endif; ?>
		<h3 class="post-title">
			<a href="<?php the_permalink(); ?>"><?php echo esc_html(vinkmag_limited_title(get_the_title(), $crop)); ?></a>
		</h3>
      <?php if($blog_date_show == 'yes'): ?>
         <span class="post-date-info">
            <i class="fa fa-clock-o"></i> <?php echo get_the_date(); ?>
         </span>
      <?php endif; ?>
	</div>
</div>