<?php if(get_theme_mod( 'social_charity_events_enable' )):
  $social_charity_event_title = get_theme_mod( 'social_charity_events_text', __( 'Our Events', 'social-charity' ) );
  ?>
  <section class="events mgb-md">
    <div class="container">
      <div class="main-title">
        <h2><?php echo esc_html($social_charity_event_title);?></h2>
      </div>
      <div class="row">
        <?php  
        $social_charity_event_category_id =  get_theme_mod('social_charity_events_category_id');
        $social_charity_event_number =  get_theme_mod('social_charity_events_number');
        $social_charity_args = array(
          'post_type' => 'post',
          'posts_per_page' => $social_charity_event_number,
          'post_status' => 'publish',
          'paged' => 1,
          'cat' => $social_charity_event_category_id,

        );
        $social_charity_eventloop = new WP_Query($social_charity_args);
        if ( $social_charity_eventloop->have_posts() ) :
          while ($social_charity_eventloop->have_posts()) : $social_charity_eventloop->the_post(); 
            ?>

            <div class="col-lg-6">
              <div class="media md-media">
                <a href="<?php the_permalink();?>" class="img-holder">
                  <?php the_post_thumbnail('social-charity-events-image');?>
                </a>
                <div class="media-body">
                  <span class="tag-date"><?php echo esc_html(get_post_time('j F'));?></span>
                  <h4><a href="<?php the_permalink();?>"><?php the_title();?></a></h4>
                  <?php the_excerpt();?>
                </div>
              </div>
            </div>
          <?php endwhile;
        endif;
          wp_reset_postdata();
        ?>
      </div>
    </div>
  </section>
  <?php endif;?>