<?php  
   global $post ;
   $count = 0;
   $paged = get_query_var('paged');
   $query_args = array('post_type' => 'post' , 'showposts' => $num , 'order_by' => $sort , 'order' => $order, 'paged'=>$paged);
   if( $cat ) $query_args['category_name'] = $cat;
   $query = new WP_Query($query_args) ; 
   ?>
<?php if($query->have_posts()):  ?>   

<!--Sidebar Page Container-->
<div class="sidebar-page-container">
    <div class="auto-container">
        <div class="row clearfix">
            
            <!--Content Side-->
            <div class="content-side col-lg-9 col-md-8 col-sm-12 col-xs-12">
                <div class="news-list">
                    <?php while($query->have_posts()): $query->the_post();
                        global $post ; 
                        $post_meta = _WSH()->get_meta();
                    ?>
                    <!--News Block-->
                    <div class="news-block-two">
                        <div class="inner-box">
                            <div class="row clearfix">
                                <!--Image Column-->
                                <div class="image-column col-md-5 col-sm-6 col-xs-12">
                                    <div class="image">
                                        <?php the_post_thumbnail('manufacto_370x260'); ?>
                                        <a class="overlay-box" href="<?php echo esc_url(get_permalink(get_the_id()));?>"><span class="fa fa-link"></span></a>
                                    </div>
                                </div>
                                <!--Content Column-->
                                <div class="content-column col-md-7 col-sm-6 col-xs-12">
                                    <div class="inner-column">
                                        <ul class="post-meta">
                                            <li><a href="<?php echo esc_url(get_month_link(get_the_date('Y'), get_the_date('m'))); ?>"><span class="icon fa fa-calendar-o"></span><?php echo get_the_date('d M, Y');?></a></li>
                                            <li><span class="icon fa fa-tags"></span><?php the_category(', '); ?></li>
                                            <li><a href="<?php echo esc_url(get_permalink(get_the_id()).'#comments');?>"><span class="icon fa fa-comment-o"></span><?php comments_number( wp_kses_post(__('0 Comments' , 'manufacto')), wp_kses_post(__('1 Comment' , 'manufacto')), wp_kses_post(__('% Comments' , 'manufacto'))); ?></a></li>
                                        </ul>
                                        <h3><a href="<?php echo esc_url(get_permalink(get_the_id()));?>"><?php the_title(); ?></a></h3>
                                        <div class="text"><?php echo wp_kses_post(manufacto_trim(get_the_content(), $text_limit)); ?></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php endwhile;?>
                    <!--Styled Pagination-->
                    <div class="styled-pagination">
                        <div class="inner-container clearfix">
                            <div class="clearfix text-center">
                                <?php manufacto_the_pagination(array('total'=>$query->max_num_pages, 'next_text' => '<div class="pull-right next-post">Next Post <i class="fa fa-long-arrow-right"></i> </div>', 'prev_text' => '<div class="pull-left prev-post"><i class="fa fa-long-arrow-left"></i> Prev Post </div>')); ?>
                            </div>
                        </div>
                    </div>
                    
                </div>
            </div>
            
            <!--Sidebar Side-->
            <div class="sidebar-side col-lg-3 col-md-4 col-sm-12 col-xs-12">
                <aside class="sidebar default-sidebar">
                    <?php if ( is_active_sidebar( $sidebar_slug ) ) : ?>
                        <?php dynamic_sidebar( $sidebar_slug ); ?>
                    <?php endif; ?>
                </aside>
            </div>
            
       </div>
   </div>
</div>

<?php endif; wp_reset_postdata(); ?>