| 1 |
<?php |
| 2 |
/** |
| 3 |
* The template for Element Categories Catousel. |
| 4 |
* This is the template that elementor element carousel, slider, categories |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly. |
| 10 |
} |
| 11 |
|
| 12 |
?> |
| 13 |
<?php |
| 14 |
$results_page = wmvc_show_data('conf_link', $settings); |
| 15 |
if(!is_array($results_page) && !empty($results_page)) { |
| 16 |
|
| 17 |
if(function_exists('pll_get_post')) |
| 18 |
$results_page = pll_get_post($results_page); |
| 19 |
|
| 20 |
$results_page = get_permalink($results_page); |
| 21 |
} else { |
| 22 |
|
| 23 |
$results_page = wdk_get_option('wdk_results_page'); |
| 24 |
|
| 25 |
if(function_exists('pll_get_post')) |
| 26 |
$results_page = pll_get_post($results_page); |
| 27 |
|
| 28 |
$results_page = get_permalink($results_page); |
| 29 |
|
| 30 |
} |
| 31 |
?> |
| 32 |
|
| 33 |
<div class="wdk-element" id="wdk_el_<?php echo esc_html($id_element);?>"> |
| 34 |
<div class="wdk-categories-carousel"> |
| 35 |
<div class="wdk-category-slider-box <?php echo esc_attr($settings['layout_carousel_animation_style']).'_animation';?> <?php echo esc_attr(join(' ', [$settings['t_styles_dots_position_style'], $settings['t_styles_arrows_position_style'],$settings['t_styles_arrows_position'],$settings['t_styles_arrows_position_style']]));?>"> |
| 36 |
<div class="wdk-categories-carousel_ini <?php echo esc_html($settings['t_styles_img_des_type']);?> "> |
| 37 |
<?php foreach ($results as $key => $item):?> |
| 38 |
<div class="wdk-slider-item"> |
| 39 |
<img src="<?php echo esc_url(wdk_image_src($item, 'full', NULL,'image_id', 'image_path'));?>" class="wdk-slider-item_thumbnail" alt="<?php echo esc_html(wmvc_show_data('category_title', $item));?>"> |
| 40 |
<div class="wdk-categories-carousel_mask"></div> |
| 41 |
<?php if(!empty(wmvc_show_data('category_title', $item))):?> |
| 42 |
<div class="wdk-slider-item_box_line"> <div class="wdk-slider-item_box_title"> <?php echo esc_html(wmvc_show_data('category_title', $item));?> </div></div> |
| 43 |
<?php endif;?> |
| 44 |
<div class="wdk-slider-item_box_line"> <div class="wdk-slider-item_box_content"> <?php echo esc_html(wmvc_show_data('listings_counter', $item));?> <?php echo esc_html__('Listings','wpdirectorykit');?> </div></div> |
| 45 |
<div class="wdk-slider-item_box_line"> <a class="wdk-slider-item_box_link" href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $item)));?>#results"> <?php echo esc_html($settings['t_content_basic_link_text']);?> </a></div> |
| 46 |
<?php if(!wmvc_show_data('complete_link_enable', $item) == 'yes'):?> |
| 47 |
<a class="wdk-slider-complete_link" href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $item)));?>#results"></a> |
| 48 |
<?php endif;?> |
| 49 |
</div> |
| 50 |
<?php endforeach;?> |
| 51 |
</div> |
| 52 |
<?php if(!empty($results) && wmvc_show_data('layout_carousel_columns', $settings,1) < wmvc_count($results)):?> |
| 53 |
<div class="wdk-categories-carousel_arrows"> |
| 54 |
<a class="wdk-slider-prev wdk-categories-carousel_arrow"> |
| 55 |
<?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_left'], [ 'aria-hidden' => 'true' ] ); ?> |
| 56 |
</a> |
| 57 |
<a class="wdk-slider-next wdk-categories-carousel_arrow"> |
| 58 |
<?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_right'], [ 'aria-hidden' => 'true' ] ); ?> |
| 59 |
</a> |
| 60 |
</div> |
| 61 |
<?php endif;?> |
| 62 |
</div> |
| 63 |
</div> |
| 64 |
</div> |
| 65 |
<script> |
| 66 |
jQuery(document).ready(function($){ |
| 67 |
$('#wdk_el_<?php echo esc_html($id_element);?> .wdk-categories-carousel_ini').slick({ |
| 68 |
<?php if(!empty($results) && wmvc_show_data('layout_carousel_columns', $settings,1) < wmvc_count($results)):?> |
| 69 |
dots: true, |
| 70 |
arrows: true, |
| 71 |
<?php else:?> |
| 72 |
dots: false, |
| 73 |
arrows: false, |
| 74 |
<?php endif;?> |
| 75 |
<?php if($settings['layout_carousel_center']=='yes'):?> |
| 76 |
centerMode: true, |
| 77 |
<?php endif;?> |
| 78 |
<?php if($settings['layout_carousel_variableWidth']=='yes'):?> |
| 79 |
variableWidth: true, |
| 80 |
<?php endif;?> |
| 81 |
speed: '<?php echo esc_html($settings['layout_carousel_speed'], '100');?>', |
| 82 |
slidesToShow: <?php echo wmvc_show_data('layout_carousel_columns', $settings, 1);?>, |
| 83 |
slidesToScroll: <?php echo wmvc_show_data('layout_carousel_columns', $settings,1);?>, |
| 84 |
<?php if(!empty(wmvc_show_data('layout_carousel_is_infinite', $settings))):?> |
| 85 |
infinite: <?php echo wmvc_show_data('layout_carousel_is_infinite', $settings, 'true');?>, |
| 86 |
<?php endif;?> |
| 87 |
<?php if(!empty(wmvc_show_data('layout_carousel_is_autoplay', $settings))):?> |
| 88 |
autoplay: <?php echo wmvc_show_data('layout_carousel_is_autoplay', $settings, 'false');?>, |
| 89 |
autoplaySpeed: <?php echo wmvc_show_data('layout_carousel_autoplaySpeed', $settings, '1500');?>, |
| 90 |
<?php endif;?> |
| 91 |
<?php if(wmvc_show_data('layout_carousel_columns', $settings, 1) == 1 && in_array($settings['layout_carousel_animation_style'], ['fade','fade_in_in'])):?> |
| 92 |
fade: true, |
| 93 |
<?php endif;?> |
| 94 |
cssEase: '<?php echo esc_html($settings['layout_carousel_cssease'], 'linear');?>', |
| 95 |
nextArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk-categories-carousel_arrows .wdk-slider-next'), |
| 96 |
prevArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk-categories-carousel_arrows .wdk-slider-prev'), |
| 97 |
customPaging: function(slider, i) { |
| 98 |
// this example would render "tabs" with titles |
| 99 |
return '<span class="wdk_lr_dot"><?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_dots_position_style'], [ 'aria-hidden' => 'true' ] ); ?></span>'; |
| 100 |
}, |
| 101 |
responsive: [ |
| 102 |
{ |
| 103 |
breakpoint: 600, |
| 104 |
settings: { |
| 105 |
slidesToShow: 1, |
| 106 |
slidesToScroll: 1 |
| 107 |
} |
| 108 |
}, |
| 109 |
] |
| 110 |
}); |
| 111 |
}) |
| 112 |
</script> |