 <!--===// Start: Slider
    =================================--> 
<?php 
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! function_exists( 'avril_lite_slider' ) ) :
	function avril_lite_slider() {
	$avril_aera_slider 						= get_theme_mod('slider',avril_get_slider_default());
?>	
<style type="text/css">
	.theme-slider:after {
		background: #d61523;
	}
</style>
    <section id="slider-section" class="slider-wrapper">
        <div class="main-slider owl-carousel owl-theme">
			<?php
				if ( ! empty( $avril_aera_slider ) ) {
				$avril_aera_slider = json_decode( $avril_aera_slider );
				foreach ( $avril_aera_slider as $avril_aera_slide_item ) {
					$avril_aera_repeater_title = ! empty( $avril_aera_slide_item->title ) ? apply_filters( 'avril_translate_single_string', $avril_aera_slide_item->title, 'slider section' ) : '';
					$avril_aera_repeater_subtitle = ! empty( $avril_aera_slide_item->subtitle ) ? apply_filters( 'avril_translate_single_string', $avril_aera_slide_item->subtitle, 'slider section' ) : '';
					$avril_aera_repeater_text = ! empty( $avril_aera_slide_item->text ) ? apply_filters( 'avril_translate_single_string', $avril_aera_slide_item->text, 'slider section' ) : '';
					$avril_aera_repeater_button = ! empty( $avril_aera_slide_item->text2) ? apply_filters( 'avril_translate_single_string', $avril_aera_slide_item->text2,'slider section' ) : '';
					$avril_aera_repeater_link = ! empty( $avril_aera_slide_item->link ) ? apply_filters( 'avril_translate_single_string', $avril_aera_slide_item->link, 'slider section' ) : '';
					$avril_aera_repeater_image = ! empty( $avril_aera_slide_item->image_url ) ? apply_filters( 'avril_translate_single_string', $avril_aera_slide_item->image_url, 'slider section' ) : '';
					$avril_aera_repeater_image2 = ! empty( $avril_aera_slide_item->image_url2 ) ? apply_filters( 'avril_translate_single_string', $avril_aera_slide_item->image_url2, 'slider section' ) : '';
					$avril_aera_repeater_open_new_tab = ! empty( $avril_aera_slide_item->open_new_tab ) ? apply_filters( 'avril_translate_single_string', $avril_aera_slide_item->open_new_tab, 'slider section' ) : '';
					//$avril_aera_repeater_align = $avril_aera_slide_item->slide_align;
					$avril_aera_repeater_align = ! empty( $avril_aera_slide_item->slide_align ) ? apply_filters( 'avril_translate_single_string', $avril_aera_slide_item->slide_align, 'slider section' ) : '';
			?>
			<?php if ( ! empty( $avril_aera_repeater_image ) ) : ?>
        	<div class="item" style="background-image:url('<?php echo esc_url( $avril_aera_repeater_image ); ?>')">
			<?php else : ?>
			<div class="item">
			<?php endif; ?>
                <div class="theme-slider">
                    <div class="theme-table">
                        <div class="theme-table-cell">
                            <div class="av-container">                                
                                <div class="av-columns-area theme-content text-<?php echo esc_attr($avril_aera_repeater_align); ?>">
                                	<?php if ( ! empty( $avril_aera_repeater_image2 ) ) { ?>
                                	<div class="av-column-7 my-auto">
                                	<?php } else { ?>
                            		<div class="av-column-12">
                            		<?php } ?>
										<?php if ( ! empty( $avril_aera_repeater_title ) ) : ?>
											<h3 data-animation="fadeInUp" data-delay="150ms"><?php echo esc_html($avril_aera_repeater_title); ?></h3>
										<?php endif; ?>
										
										<?php if ( ! empty( $avril_aera_repeater_subtitle ) ) : ?>
											<h1 data-animation="fadeInUp" data-delay="200ms"><span><?php echo esc_html($avril_aera_repeater_subtitle); ?></h1>
	                                    <?php endif; ?>
										
										<?php if ( ! empty( $avril_aera_repeater_text ) ) : ?>
											<p data-animation="fadeInUp" data-delay="500ms"><?php echo esc_html($avril_aera_repeater_text); ?></p>
										<?php endif; ?>	
										<?php if ( ! empty( $avril_aera_repeater_button ) ) : ?>
											<a data-animation="fadeInUp" data-delay="800ms" href="<?php echo esc_url( $avril_aera_repeater_link ); ?>" <?php if($avril_aera_repeater_open_new_tab== 'yes' || $avril_aera_repeater_open_new_tab== '1') { echo "target='_blank'"; } ?> class="av-btn av-btn-primary"><?php echo esc_html($avril_aera_repeater_button); ?></a>
										<?php endif; ?>
									</div>
									<?php if ( ! empty( $avril_aera_repeater_image2 ) ) : ?>
									<div class="av-column-5 mb-av-0 mx-auto my-auto">
										<div class="aera-img">
											<img src="<?php echo esc_url( $avril_aera_repeater_image2 ); ?>" data-img-url="<?php echo esc_url( $avril_aera_repeater_image2 ); ?>" <?php if ( ! empty( $avril_aera_repeater_title ) ) : ?> alt="<?php echo esc_attr($avril_aera_repeater_title); ?>" title="<?php echo esc_attr($avril_aera_repeater_subtitle); ?>" <?php endif; ?> />
										</div>
									</div>
									<?php endif; ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
			<?php } } ?>
        </div>
        <div class="svg-clip-art">
            <svg xmlns="http://www.w3.org/2000/svg" width="100%" viewBox="0 0 100 100" version="1.1" preserveAspectRatio="none"><path stroke-width="0" d="M0 0 C50 100 50 100 100 0 L100 100 0 100"></path></svg>
        </div>
    </section>
<?php	
	}
endif;
if ( function_exists( 'avril_lite_slider' ) ) {
$cleverfox_section_priority = apply_filters( 'avril_section_priority', 11, 'avril_lite_slider' );
add_action( 'avril_sections', 'avril_lite_slider', absint( $cleverfox_section_priority ) );
}
?>
<!-- End: Slider
=================================-->