<?php if(get_theme_mod('social_charity_slider_enable')) : ?>
  <section class="banner">
   <?php $social_charity_k=1; 
   for($social_charity_i=1;$social_charity_i<5;$social_charity_i++){
    $social_charity_slider_page[$k]=get_theme_mod('social_charity_slider_title_'.$social_charity_i);
    $social_charity_slider_button_1_title[$k]=get_theme_mod('social_charity_slider_button_1_title_'.$social_charity_i);
    $social_charity_slider_button_1_url[$k]=get_theme_mod('social_charity_slider_button_1_url_'.$social_charity_i);
    $social_charity_k=$social_charity_k+1;
  }

  $social_charity_args = array (
    'post_type'        => 'page',
    'post_per_page'    => $social_charity_social_charity_k,
    'posts_per_page'   =>4,
    'post__in'         => ($social_charity_slider_page) ? ($social_charity_slider_page) : '',
    'orderby'           =>'post__in',
  );

  $social_charity_sliderloop = new WP_Query($social_charity_args);
  $social_charity_j=1;

  if ($social_charity_sliderloop->have_posts()) :  while ($social_charity_sliderloop->have_posts()) : $social_charity_sliderloop->the_post();?>
    <div class="item">
      <div class="img">
        <?php 
        if(has_post_thumbnail()):
          the_post_thumbnail( 'social-charity-banner-1135*666' );
        endif;
        ?>  
        <div class="caption">
          <h1><?php the_title();?></h1>
          <?php the_excerpt();?>
          <?php if($social_charity_slider_button_1_title[$social_charity_j]): ?>
            <a href="<?php echo esc_url($social_charity_slider_button_1_url[$j]); ?>" class="btn btn-primary btn-lg"><?php echo esc_html($social_charity_slider_button_1_title[$social_charity_j]); ?></a>
          <?php endif;?>
        </div>
      </div>
    </div>
    <?php 
    $social_charity_j=$social_charity_j+1; endwhile;
  endif;
    wp_reset_postdata();  
  ?>
</section>
<?php endif;?>