<?php $ngo_disaster_relief_args = array(
  'post_type' => 'post',
  'post_status' => 'publish',
  'category_name' =>  get_theme_mod('ngo_disaster_relief_blog_slide_category'),
  'posts_per_page' => get_theme_mod('ngo_disaster_relief_blog_slide_number'),
); ?>

<?php if ( get_theme_mod('ngo_disaster_relief_blog_box_enable',false) ) : ?>
  <div class="slider">
    <div class="slider-box">
      <div class="slider-inner-banner">
          <div class="owl-carousel">
            <?php $ngo_disaster_relief_arr_posts = new WP_Query( $ngo_disaster_relief_args );
            $i = 1;
            if ( $ngo_disaster_relief_arr_posts->have_posts() ) :
              while ( $ngo_disaster_relief_arr_posts->have_posts() ) :
                $ngo_disaster_relief_arr_posts->the_post();
                ?>
                <div class="slider-box wow fadeInUp">
                  <div class="slider-image">
                    <?php
                      if ( has_post_thumbnail() ) :
                        the_post_thumbnail();
                      else:
                        ?>
                        <div class="slider-alternate">
                          <img src="<?php echo get_stylesheet_directory_uri() . '/assets/images/slider.png'; ?>">
                        </div>
                        <?php
                      endif;
                    ?>
                  </div>
                  <div class="slider-owl-position">
                    <h4 class="mb-3 short-text"><?php echo esc_html(get_theme_mod('ngo_disaster_relief_slider_short_heading'));?></h4>
                    <h3 class="mb-3"><?php the_title(); ?></h3>
                    <p class="slider-button mb-0">
                      <a href="<?php echo esc_url(get_permalink($post->ID)); ?>"><?php esc_html_e('donate now','ngo-disaster-relief'); ?></a>
                    </p>
                  </div>
                  <?php if ( get_theme_mod('ngo_disaster_relief_slider_section_price_heading') || get_theme_mod('ngo_disaster_relief_slider_section_price_text') ) : ?>
                    <div class="circle-box">
                      <div class="circle"></div>
                      <h4 class="mb-2"><?php echo esc_html(get_theme_mod('ngo_disaster_relief_slider_section_price_heading'));?></h4>
                      <p class="mb-0"><?php echo esc_html(get_theme_mod('ngo_disaster_relief_slider_section_price_text'));?></p>
                    </div>
                  <?php endif; ?>
                </div>
              <?php
              $i++;
            endwhile;
            wp_reset_postdata();
            endif; ?>
          </div>
      </div>
    </div>
  </div>
<?php endif; ?>