<?php ob_start(); 

$limit = ( $excerpt ) ? $excerpt : 20;
$query_args = array('post_type' => 'post' , 'showposts' => $num , 'order_by' => $sort , 'order' => $order);

if( $exclude) $query_args['post__not_in'] = explode(',', $exclude);

if( $cat ) $query_args['category'] = $cat;

$query = new WP_Query($query_args) ; ?>

	
	<!-- #blog  -->
			<div id="blog" class="section padding bg-secondary">

				<div class="container">
					<div class="row blog-masonry">

						<?php while( $query->have_posts() ): $query->the_post(); ?>

							<div class="col-md-4 blog-post-masonry">
								<article class="blog-post">

									<?php $size = (( $query->current_post % 2 ) == 0 ) ? '800x400' : '370x370'; ?>

									<div class="blog-post-media">
										<a href="assets/images/blog/blog-2.jpg" class="lightbox">
											<?php the_post_thumbnail($size); ?>
										</a>
									</div> <!-- / .blog-post-media -->
									
									<div class="blog-post-info">
										<small><?php echo get_the_date(); ?> / <?php the_author(); ?></small>
										<h3 class="uppercase title"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
									</div> <!-- / .blog-post-info -->

									<div class="blog-post-content">
										<p><?php echo balanceTags(_sh_trim(get_the_content(), $limit)); ?></p>
										<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" class="btn btn-primary read-more"><?php esc_html_e('Read More', SH_NAME); ?></a>
									</div> <!-- / .blog-post-content -->

								</article> <!-- / .blog-post -->
							</div> <!-- / .blog-post-masonry -->
						
						<?php endwhile; ?>

					</div> <!-- / .row .blog-masonry -->
				</div> <!-- / .container -->

			</div>
			<!-- / #blog -->


<?php wp_reset_postdata();
return ob_get_clean();