<?php if(get_theme_mod( 'social_charity_blog_enable' )):
  $social_charity_blog_title = get_theme_mod('social_charity_blog_text',__('Latest Blog','social-charity'));
  ?>
  <section class="blog blog-slider mgb-lg">
    <div class="container">
      <div class="main-title">
        <h2><?php echo esc_html($social_charity_blog_title);?></h2>
      </div>
      <div class="row">

        <?php
        $social_charity_blog_catId = esc_attr(get_theme_mod( 'social_charity_blog_category_id'));
        $social_charity_blog_number = get_theme_mod('social_charity_blog_number');
        $social_charity_args = array(
          'post_type' => 'post',
          'posts_per_page' => $social_charity_blog_number,
          'post_status' => 'publish',
          'cat' => $social_charity_blog_catId,

        );

        $social_charity_blogloop = new WP_Query($social_charity_args);

        while ($social_charity_blogloop->have_posts()) : 
          $social_charity_blogloop->the_post(); 
          ?>
          <div class="col-lg-4">
            <div class="b-card">
              <a href="<?php the_permalink();?>" class="img-holder">
                <?php 
                  if(has_post_thumbnail()):
                    the_post_thumbnail('social-charity-blog-image');
                  endif;
                  ?>
              </a>
              <div class="b-body">
                <div class="b-date">
                  <span class="num"><?php echo esc_html(get_post_time('j'));?></span>
                  <span class="month"><?php echo esc_html(get_post_time('F'));?></span>
                </div>
                <div class="text">
                  <h4><a href="<?php the_permalink();?>"><?php the_title();?></a></h4>
                  <?php the_excerpt();?>
                </div>
              </div>
            </div>
          </div>
        <?php endwhile;
        wp_reset_postdata();
        ?>
      </div>
    </div>
  </section>
  <?php endif;?>