<?php
/**
 * 
 * @package Slider Premium
 */
?> 
<?php $showContent = get_theme_mod('slider_section_show_content', 'on'); ?>
<div class="slider-area" id="slider">
    <div class="<?php if(get_theme_mod('peccular_slider_section_width','Full Width') == 'Full Width'){ ?>container-fluid pd-0 <?php } elseif(get_theme_mod('peccular_slider_section_width','Full Width') == 'Box Width'){ ?> container <?php }?>">
     <section class="hero-slider hero-style">
        <div class="swiper-container">
          <div class="swiper-wrapper">

            <?php
            $args = array( 'post_type' => 'slider', 'orderby'   => 'id', 'order' => 'DESC',);
            if(!empty($pageId)){
                $args['page_id'] = absint($pageId);
            }
            $text = '';
            $query = new WP_Query($args);
            if($query->have_posts()){
                while($query->have_posts()) : $query->the_post(); 
                    $slider1btntext = get_post_meta($post->ID, 'slider1btntext', false);
                    $test_slider1btntext = !empty($slider1btntext[0]) ? $slider1btntext[0] : '';

                // $slider2btntext = get_post_meta($post->ID, 'slider2btntext', false);
                    // $test_slider2btntext = !empty($slider2btntext[0]) ? $slider2btntext[0] : '';
                    ?>

                    <div class="swiper-slide">
                        <div class="slide-inner slide-bg-image">
                           <div class="peccular-slider-mainoverlay"></div>

                           <div class="sliderimg"> 
                            <?php 
                            if(has_post_thumbnail()){
                                $total_slider_image = wp_get_attachment_image_src(get_post_thumbnail_id(),'full');  
                                echo '<img class="slide-mainimg" alt="'. esc_html(get_the_title()) .'" src="'.esc_url($total_slider_image[0]).'">';
                            }?>
                        </div>
                        <?php if($showContent == 'on'){?>
                            <div class="slider-inner-mainbox">
                                <?php if( get_theme_mod('slideranimations_icon_display','show' ) == 'show') :
                                    ?>
                                    <?php  
                                    echo '<img alt="about us" src="'.get_template_directory_uri().'/images/snakeline.png" class="snake" />';
                                    ?>
                                    <?php  
                                    echo '<img alt="about us" src="'.get_template_directory_uri().'/images/circle.png" class="circle" />';
                                    ?>
                                    <?php  
                                    echo '<img alt="about us" src="'.get_template_directory_uri().'/images/triangledot.png" class="triangle" />';
                                    ?>
                                <?php endif ?>     
                                <div class="slider-inner-box">
                                    <div class="slide-title animated fadeInDownBig">
                                        <h2><?php echo (get_the_title()); ?></h2>                                       
                                    </div>
                                    <div class="slide-text animated fadeInLeftBig"><p><?php echo (get_the_content()); ?></p></div>
                                    <div class="clearfix"></div>  
                                    <?php
                                    $sliderbtn1url = get_post_meta($post->ID, 'sliderbtn1url', false);
                                    $slider1_btn_url = !empty($sliderbtn1url[0]) ? $sliderbtn1url[0] : '';
                                    ?>
                                    <ul></ul>
                                    <?php if ($slider1_btn_url) { ?>
                                        <div class="slide-btns-1 animated fadeInDownBig">
                                            <a class="ReadMore" href="<?php echo $slider1_btn_url; ?>"> 
                                                <span><?php echo ($test_slider1btntext); ?></span> 
                                            </a></div>
                                        <?php } ?>
                                  </div>
                                  <?php if( get_theme_mod('slideranimations_icon_display','show' ) == 'show') :
                                    ?>
                                    <?php  
                                    echo '<img alt="about us" src="'.get_template_directory_uri().'/images/circledot.png" class="circledot" />';
                                    ?>
                                    <?php  
                                    echo '<img alt="about us" src="'.get_template_directory_uri().'/images/triangle.png" class="tri" />';
                                    ?>
                                    <?php  
                                    echo '<img alt="about us" src="'.get_template_directory_uri().'/images/snakeline.png" class="snake2" />';
                                    ?>
                                <?php endif ?>     
                            </div>
                        <?php }?>
                        

                    </div>
                </div> 

                <?php
            endwhile;
        }else{ 
            for($i=0;$i<1;$i++){?>

                <div class="swiper-slide">
                    <div class="slide-inner slide-bg-image">
                        <div class="peccular-slider-mainoverlay"></div>
                        <div class="sliderimg">
                            <?php echo '<img class="slide-mainimg" alt="Slider" src="'. esc_html(get_template_directory_uri()) .'/images/sliderimg.jpg">';?>
                        </div>
                        <?php if($showContent == 'on'){?>
                            <div class="slider-inner-mainbox">

                                <?php if( get_theme_mod('slideranimations_icon_display','show' ) == 'show') :
                                    ?>
                                    <?php  
                                    echo '<img alt="about us" src="'.get_template_directory_uri().'/images/snakeline.png" class="snake" />';
                                    ?>
                                    <?php  
                                    echo '<img alt="about us" src="'.get_template_directory_uri().'/images/circle.png" class="circle" />';
                                    ?>
                                    <?php  
                                    echo '<img alt="about us" src="'.get_template_directory_uri().'/images/triangledot.png" class="triangle" />';
                                    ?>
                                <?php endif ?>    
                                <!-- <img src="/images/triangle.png" class="triangle"> -->
                                <div class="trion2"></div>
                                <div class="slider-inner-box">
                                    <div class="slide-title animated fadeInDownBig"><h2>Solar <span>Services</span></h2>                                    
                                    </div>
                                    <div class="slide-text animated fadeInLeftBig"><p>THERE ARE <span>MANY VARIATIONS</span> OF</p></div>  
                                    <div class="clearfix"></div>
                                    <ul>
                                        <div class="slide-btns-1 animated fadeInDownBig"> <a class="ReadMore" href="<?php echo $slider1_btn_url; ?>"> <span>Read more</span> 
                                            <!-- <div class="transition"></div> -->
                                        </a>
                                    </div>

                                </ul>
                                <div class="clearfix"></div>
                            </div>
                            <div class="clearfix"></div>
                            <?php if( get_theme_mod('slideranimations_icon_display','show' ) == 'show') :
                                ?>
                                <?php  
                                echo '<img alt="about us" src="'.get_template_directory_uri().'/images/circledot.png" class="circledot" />';
                                ?>
                                <?php  
                                echo '<img alt="about us" src="'.get_template_directory_uri().'/images/triangle.png" class="tri" />';
                                ?>
                                <?php  
                                echo '<img alt="about us" src="'.get_template_directory_uri().'/images/snakeline.png" class="snake2" />';
                                ?>
                            <?php endif ?> 
                        </div>
                    <?php }?>
                </div> 
            </div> 
        <?php }
    }?>
</div>
<div class="swiper-pagination"></div>
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
</div>
</section>
</div>
</div>