<?php 
    $cat = get_query_var('cat');
  	$thiscat = get_category ($cat);
	$sticky = get_option( 'sticky_posts' );
	$args = array(
		'posts_per_page'      => 3,
		'post__in'            => $sticky,
		'cat'		  => $cat
	);
		$the_query = new WP_Query( $args );
		$colsize = (12/$the_query->found_posts);
		$colsize = max($colsize, 4);
		if ( $the_query->have_posts() ) {
		?>
<div class="wrapper" id="blog">
    	<div class="container">
        	<div class="content-heading">
    			<h2><?php the_field("stick_section_title", $thiscat); ?></h2>
                <small><?php the_field("stick_section_subtitle", $thiscat); ?></small>
                <span></span>
            </div>
       <div class="row featuredposts stickypoststop">  
       <?php while ( $the_query->have_posts() ) {
		$the_query->the_post();
		global $featured_ids;
		$featured_ids[] = $post->ID;
		?>
				<div class="col-sm-<?php echo esc_html($colsize); ?>">
                	<div class="post">
                    	<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                        <div class="titleheight">
                        <h2><?php the_title(); ?></h2>
                        <small><?php _e( 'Author: ', 'activehost');?><?php the_author();?></small> 
                        <small><?php _e( 'Category: ', 'activehost');?><?php
						$category = get_the_category();
						$i = 0;
						foreach($category as $cat){$i++;
							if($i!=1){
								echo esc_html(", ".$cat->cat_name);
							}else{
								echo esc_html($cat->cat_name);
							}
						}
						?></small>
                        </div>
                        <div class="post-image"><?php the_post_thumbnail(); ?><span><i class="glyphicon glyphicon-calendar"></i><?php the_time('jS M'); ?></span></div>
                        <?php the_excerpt(); ?>
                    </div>
                </div>

			<?php }?>
            </div> 
		</div>
    </div>
<?php } 
?>