<?php 
/**
 * Template part for displaying Featured Classes Section
 *
 * @package Kids Birthday Party
 */

$kids_birthday_party_classes = get_theme_mod( 'kids_birthday_party_classes_setting',false );
$kids_birthday_party_service_title = get_theme_mod( 'kids_birthday_party_service_title' );?>
<?php if ( $kids_birthday_party_classes ){?>
<div class="our-classes text-center">
    <div class="container">
        <div class="service">
            <div class="side-border">
                <?php if ( $kids_birthday_party_service_title ){?>
                    <h3 class="mb-5"><?php echo esc_html( $kids_birthday_party_service_title );?></h3>
                <?php } ?>                       
            </div>
            <div class="owl-carousel">
                <?php 
                    $kids_birthday_party_catergory_name = get_theme_mod('kids_birthday_party_blog_args_');
                    $args = array(
                        'post_type'           => 'post',
                        'category_name'       => $kids_birthday_party_catergory_name,
                        'orderby'             => 'post__in',
                        'ignore_sticky_posts' => true,
                    );
                    ?>
                    <?php
                    $loop = new WP_Query($args);
                    if ( $loop->have_posts() ) :
                        $i=1;
                        while ($loop->have_posts()) : $loop->the_post(); ?>
                                <div class="upper-box <?php echo ('catebox-'.$i); ?>">
                                    <div class="box">
                                        <?php
                                            if ( has_post_thumbnail() ) : ?>
                                            <div class="image-blog wow zoomIn delay-1000" data-wow-duration="2s">
                                              <?php the_post_thumbnail();?>
                                            </div>
                                            <?php else:
                                              ?>
                                              <div class="image-blog wow zoomIn delay-1000" data-wow-duration="2s">
                                                <img src="<?php echo get_stylesheet_directory_uri() . '/images/default-header.png'; ?>">
                                              </div>
                                              <?php
                                            endif;
                                          ?>
                                        <div class="box-content">
                                            <h4 class="title mb-2"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
                                            <p class="mb-5"><?php echo wp_trim_words( get_the_content(), 15 ); ?></p>
                                            <span class="service-dot"></span>
                                        </div>
                                    </div>
                                </div>
                        <?php  $i++; endwhile;
                    endif;
                ?>
            </div>
        </div>
    </div>
</div>
<?php } ?>