	<!-- featured posts -->
	
	
    <div class="container">
		<?php
		
	   $enable_featured_post    = get_theme_mod('ivory_enable_featured_post');
	    $show_title             = get_theme_mod('ivory_sel_category_post')?>
		   <?php
		 
			if ($show_title ) : ?>
				<div class="col-md-12 featured-area-header">
					<h3>
						<span><?php echo esc_html($show_title ); ?></span>
					</h3>
				</div>
				<?php endif;?>	
	<?php
	
    $number_of_posts         = get_theme_mod('ivory_posts_count');

	if (get_theme_mod('ivory_enable_featured_post', true) == true) :
		$args = array(
			'posts_per_page'  => $number_of_posts,
			'posts_type'      => 'posts',
	        'category_name'   =>  $show_title
			);

			$my_ivory_query = new WP_Query($args);?>
			
		<?php
		
		if ($my_ivory_query->have_posts()):?>
		 <div class="row custom-loop">
		
		  <?php
		 while($my_ivory_query->have_posts()): 
		   $my_ivory_query->the_post(); ?>
		    <div class="col-md-3 col-sm-12">
			<a href="<?php the_permalink(); ?>">
			<?php if(has_post_thumbnail()) : 
			  the_post_thumbnail(); ?></a><?php
			 else:?>
				<img src="<?php echo esc_url( get_template_directory_uri()."/img/thumbnail.jpg" ); ?>">
                <?php endif;?>

				<figure> 
					<a href="<?php the_permalink(); ?>">
					
					<p class="category"><?php the_category(', '); ?></p>
					<div class="info">
							<h3>
							  <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
					     	</h3>
				     <p class="details"><a href="<?php the_author_posts() ?>"></a> 
		         	 <?php echo get_the_date('F j, Y'); ?></p>
					</div><!--info-->
				</figure>
			

	     	</div><!--col-md-3-->
		
		    <?php
		   endwhile;
		endif;
	endif;
 wp_reset_postdata();?>
</div><!--row--->
</div><!---container--->