<?php 
/**
 * Template part for displaying Featured Classes Section
 *
 * @package Plumber Workshop
 */

$plumber_workshop_args = array(
  'post_type' => 'post',
  'post_status' => 'publish',
  'category_name' =>  get_theme_mod('plumber_workshop_student_category'),
); 
$plumber_workshop_classes = get_theme_mod( 'plumber_workshop_classes_setting',false );
$plumber_workshop_section_title = get_theme_mod( 'plumber_workshop_section_title' );
$plumber_workshop_section_text = get_theme_mod( 'plumber_workshop_section_text' );
$plumber_workshop_hot_products_cat = get_theme_mod('plumber_workshop_hot_products_cat');
?>
<?php if ( $plumber_workshop_classes ){?>
<div class="our-classes text-center">
    <div class="container">
        <?php if ( $plumber_workshop_section_title ){?>
            <span><img src="<?php echo get_stylesheet_directory_uri() . '/images/pipe_1.png'; ?>"></span>
            <span><h3 class="class_head"><?php echo esc_html( $plumber_workshop_section_title );?></h3></span>
            <span><img src="<?php echo get_stylesheet_directory_uri() . '/images/pipe_2.png'; ?>"></span>
        <?php } ?>
        <?php if ( $plumber_workshop_section_text ){?>
            <p><?php echo esc_html( $plumber_workshop_section_text );?></p>
        <?php } ?>
        <div class="owl-carousel">
                <?php 
                    $plumber_workshop_catergory_name = get_theme_mod('plumber_workshop_blog_args_');
                    $args = array(
                        'post_type'           => 'post',
                        'category_name'       => $plumber_workshop_catergory_name,
                        'orderby'             => 'post__in',
                        'ignore_sticky_posts' => true,
                    );?>
                    <?php
                    $loop = new WP_Query($args);
                    if ( $loop->have_posts() ) :
                        while ($loop->have_posts()) : $loop->the_post(); ?>
                            <div class=" align-self-center px-0">
                                <div class="box wow zoomIn delay-1000" data-wow-duration="2s">
                                    <?php
                                        if ( has_post_thumbnail() ) : ?>
                                        <div class="image-blog">
                                          <?php the_post_thumbnail();?>
                                        </div>
                                        <?php else:
                                          ?>
                                          <div class="image-blog">
                                            <img src="<?php echo get_stylesheet_directory_uri() . '/images/default-header.png'; ?>">
                                          </div>
                                          <?php
                                        endif;
                                      ?>
                                </div>
                                <div class="blog-title"><h5 class="title"><a href="<?php the_permalink();?>"><?php the_title();?></a><i class="fas fa-faucet"></i></h5></div>
                                
                                </div>
                        <?php endwhile;
                    endif;
                ?>
            </div>
    </div>
</div>
<?php } ?>