Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function kids_education_pro_render_slider_section( $content_details = array() ) {
- $options = kids_education_pro_get_theme_options();
- $read_more_button = $options['main_slider_learn_more_text'];
- $content_type = $options['main_slider_type'];
- $slider_effect = ( $options['main_slider_type'] == 'demo' ) ? 'cubic-bezier(0.250, 0.100, 0.250, 1.000)' : $options['slider_content_effect'];
- $slider_control = ( $options['enable_slider_controls'] == true ) ? 'true' : 'false';
- $slider_dragable = ( $options['enable_slider_dragable'] == true ) ? 'true' : 'false';
- $slider_pause = ( $options['slider_pause_on_hover'] == true ) ? 'true' : 'false';
- $slider_divider_enable = $options['slider_divider_enable'];
- if( $content_type == 'demo' ) {
- $data_slick_value = '{"slidesToShow": 1, "slidesToScroll": 1, "infinite": true, "speed": 8000, "dots": false, "arrows": true, "autoplay": true, "fade": false }';
- }
- else {
- $data_slick_value = '{"slidesToShow": 1, "slidesToScroll": 1, "infinite": true, "speed": 800, "dots": false, "autoplay": true, "pauseOnHover":'. esc_attr( $slider_pause ).', "arrows": '. esc_attr( $slider_control ).', "draggable":'.esc_attr( $slider_dragable ).', "fade": false }';
- }
- if ( empty( $content_details ) ) {
- return;
- } ?>
- <section id="main-slider">
- <div class="regular" data-effect="<?php echo esc_attr( $slider_effect ); ?>" data-slick=<?php echo "'" . $data_slick_value . "'"; ?>>
- <?php foreach ($content_details as $content_detail ) : ?>
- <div class="slider-item" style="background-image: url('<?php echo esc_url( $content_detail['img_array'][0] ); ?>')">
- <a href="<?php echo esc_url( $content_detail['url'] ); ?>">
- <div class="black-overlay"></div></a>
- <div class="main-slider-contents">
- <?php if( !empty( $content_detail['title'] ) ){ ?>
- <h2 class="title"><a href="<?php echo esc_url( $content_detail['url'] ); ?>"><?php echo esc_html( $content_detail['title'] );?></a></h2>
- <?php }
- if( !empty( $content_detail['content'] ) ){ ?>
- <p><?php echo esc_html( $content_detail['content'] );?></p>
- <?php }
- $learn_more_link = ( 'demo' == $content_type ) ? '#' : $content_detail['url'];
- if( !empty( $read_more_button ) ) :
- ?>
- <a href="<?php echo esc_url( $learn_more_link ); ?>" class="btn btn-default"><?php echo esc_html( $read_more_button );?></a>
- <?php endif; ?>
- </div><!-- .main-slider-contents -->
- </div><!-- .slider-item -->
- <?php endforeach; ?>
- </div><!-- .regular -->
- <?php if( $slider_divider_enable ) : ?>
- <div class="divider">
- <img src="<?php echo get_template_directory_uri() .'/assets/uploads/slider-divider.png'; ?>" alt="<?php esc_attr_e( 'Slider divider', 'kids-education-pro' ); ?>">
- </div><!-- .divider -->
- <?php endif; ?>
- </section><!-- #main-slider -->
- <?php
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement