<?php
/**
 *
 * @package Slider Premium
 */
?>
<?php $showContent = get_theme_mod('slider_section_show_content', 'on'); ?>
<div class="slider_section" id="slider">
    
    <div id="ht-bx-slider">
    
    <?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(); 
            

            if( get_theme_mod('slider_areaOpacity',true) ) {
                $slider_areaOpacity = 'opacity:'.esc_attr(get_theme_mod('slider_areaOpacity')).';';
            }

             $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="ht-slide">
            <div class="overlay"></div>
            <div class="sliderimg animated bounceInDown">
                <div class="imgflsh"></div>
            <?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_content">
                <div class="title animated bounceInDown"><?php echo (get_the_title()); ?></div>
                <div class="sub-title animated zoomIn"><?php echo (get_the_content()); ?></div>        
                <div class="slider-btn"> 
                    <ul>
                    <?php
                        $sliderbtn1url = get_post_meta($post->ID, 'sliderbtn1url', false);
                        $slider1_btn_url = !empty($sliderbtn1url[0]) ? $sliderbtn1url[0] : '';

                    ?>
                    <?php if ($test_slider1btntext) { ?>
                        <li class="animated zoomIn"><a class="btn btn-lg f-btn" href="<?php echo $slider1_btn_url; ?>"><span><?php echo ($test_slider1btntext); ?></span></a>
                        </li>
                    <?php } ?>

                    <?php
                        $designation = get_post_meta($post->ID, 'designation', false);
                        $slider2_btn_url = !empty($designation[0]) ? $designation[0] : '';
                    ?>
                    <?php if ($test_slider2btntext) { ?>
                        <li class="animated zoomIn"><a class="btn btn-lg s-btn" href="<?php echo $slider2_btn_url; ?>"><span><?php echo ($test_slider2btntext); ?></span></a>
                        </li>
                                <?php }?>
                    </ul>
                </div>
            </div>
                <?php }?>
        </div>

        <?php
            endwhile;
        }else{ 
            for($i=0;$i<6;$i++){?>
        <div class="ht-slide"> 
            <div class="overlay"></div>
              <div class="sliderimg animated bounceInDown">
                <div class="imgflsh"></div>
                <?php echo '<img class="slide-mainimg" alt="Slider" src="'. esc_html(get_template_directory_uri()) .'/images/slider.png">';?>
              </div>

            <?php if($showContent == 'on'){?>
              <div class="slider_content">
                <div class="title animated bounceInDown" >Welding & Iron Works Services</div>
                    <div class="sub-title animated zoomIn">There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form.</div>  
                    <div class="slider-btn"> 
                        <ul>
                        <li class="animated bounceInUp"><a class="btn btn-lg f-btn" href="#"><span><?php _e( 'Read More', 'luzuk-premium' ); ?></span></a></li>
                        <li class="animated bounceInUp"><a class="btn btn-lg s-btn" href="#"><span><?php _e( 'About Us', 'luzuk-premium' ); ?></span></a></li>
                        </ul>
                    </div>
              </div>
                <?php }?>
        </div>
            <?php }
        }?>
    </div>
    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1503" height="155.28" viewBox="0 0 1503 155.28">
  <defs>
    <linearGradient id="linear-gradient" x1="0.993" y1="0.621" x2="0.007" y2="0.631" gradientUnits="objectBoundingBox">
      <stop offset="0" stop-color="#ffa200"/>
      <stop offset="1" stop-color="#ff6f00"/>
    </linearGradient>
  </defs>
  <path id="Rectangle_1" data-name="Rectangle 1" d="M-110,910H363.809c38.048,0,107.433-110.548,172.834-104H1393l-.46,154H-110Z" transform="translate(110 -805.72)" fill-rule="evenodd" fill="url(#linear-gradient)"/>
  <path id="Rectangle_1-2" data-name="Rectangle 1" d="M-110,915H379.783c38.175,0,103.87-106.548,169.488-100H1392V951H-110Z" transform="translate(110 -795.72)" fill="#222a35" fill-rule="evenodd"/>
</svg>
</div>
