| 1 |
<?php |
| 2 |
/** |
| 3 |
* The template for Element Categories Grid. |
| 4 |
* This is the template that elementor element grid, categories results |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly. |
| 10 |
} |
| 11 |
|
| 12 |
?> |
| 13 |
|
| 14 |
<?php |
| 15 |
$results_page = wmvc_show_data('conf_link', $settings); |
| 16 |
if(!is_array($results_page) && !empty($results_page)) { |
| 17 |
$results_page = get_permalink($results_page); |
| 18 |
} else { |
| 19 |
$results_page = get_permalink(wdk_get_option('wdk_results_page')); |
| 20 |
} |
| 21 |
?> |
| 22 |
|
| 23 |
<div class="wdk-element" id="wdk_el_<?php echo esc_html($id_element);?>"> |
| 24 |
<div class="wdk-categories-grid"> |
| 25 |
<?php if(wmvc_show_data('layout_carousel_enable', $settings) == 'yes'):?> |
| 26 |
<div class="wdk-carousel_ini"> |
| 27 |
<?php else:?> |
| 28 |
<div class="wdk-row"> |
| 29 |
<?php endif;?> |
| 30 |
<?php if(count($results) > 0):?> |
| 31 |
<?php foreach ($results as $key => $value):?> |
| 32 |
<?php if(wmvc_show_data('layout_carousel_enable', $settings) != 'yes'):?> |
| 33 |
<div class="wdk-col"> |
| 34 |
<?php endif;?> |
| 35 |
<div class="wdk-categories-card"> |
| 36 |
<div class="wdk-thumbnail"> |
| 37 |
<?php if(wmvc_show_data('layout_image_type', $settings) == 'icon'):?> |
| 38 |
<img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-icon"> |
| 39 |
<?php else:?> |
| 40 |
<img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-image"> |
| 41 |
<?php endif;?> |
| 42 |
</div> |
| 43 |
<h3 class="wdk-title"><?php echo wmvc_show_data('category_title', $value);?></h3> |
| 44 |
<a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $value)));?>#results" class="wdk-link"></a> |
| 45 |
</div> |
| 46 |
<?php if(wmvc_show_data('layout_carousel_enable', $settings) != 'yes'):?> |
| 47 |
</div> |
| 48 |
<?php endif;?> |
| 49 |
<?php endforeach;?> |
| 50 |
<?php else:?> |
| 51 |
<div class="wdk-col wdk-col-full wdk-col-full-always"> |
| 52 |
<p class="wdk_alert wdk_alert-danger"><?php echo esc_html__('Categories not found', 'wpdirectorykit');?></p> |
| 53 |
</div> |
| 54 |
<?php endif;?> |
| 55 |
</div> |
| 56 |
</div> |
| 57 |
</div> |
| 58 |
<?php if(wmvc_show_data('layout_carousel_enable', $settings) == 'yes'):?> |
| 59 |
<script> |
| 60 |
jQuery(document).ready(function($){ |
| 61 |
$('#wdk_el_<?php echo esc_html($id_element);?> .wdk-carousel_ini').slick({ |
| 62 |
<?php if(!empty($results) && wmvc_show_data('layout_carousel_columns', $settings,1) < wmvc_count($results)):?> |
| 63 |
dots: true, |
| 64 |
<?php else:?> |
| 65 |
dots: false, |
| 66 |
<?php endif;?> |
| 67 |
arrows: false, |
| 68 |
<?php if($settings['layout_carousel_center']=='yes'):?> |
| 69 |
centerMode: true, |
| 70 |
<?php endif;?> |
| 71 |
<?php if($settings['layout_carousel_variableWidth']=='yes'):?> |
| 72 |
variableWidth: true, |
| 73 |
<?php endif;?> |
| 74 |
speed: '<?php echo esc_html($settings['layout_carousel_speed'], '100');?>', |
| 75 |
slidesToShow: <?php echo wmvc_show_data('layout_carousel_columns', $settings, 1);?>, |
| 76 |
slidesToScroll: <?php echo wmvc_show_data('layout_carousel_columns', $settings,1);?>, |
| 77 |
<?php if(!empty(wmvc_show_data('layout_carousel_is_infinite', $settings))):?> |
| 78 |
infinite: <?php echo wmvc_show_data('layout_carousel_is_infinite', $settings, 'true');?>, |
| 79 |
<?php endif;?> |
| 80 |
<?php if(!empty(wmvc_show_data('layout_carousel_is_autoplay', $settings))):?> |
| 81 |
autoplay: <?php echo wmvc_show_data('layout_carousel_is_autoplay', $settings, 'false');?>, |
| 82 |
autoplaySpeed: <?php echo wmvc_show_data('layout_carousel_autoplaySpeed', $settings, '1500');?>, |
| 83 |
<?php endif;?> |
| 84 |
<?php if(wmvc_show_data('layout_carousel_columns', $settings, 1) == 1 && in_array($settings['layout_carousel_animation_style'], ['fade','fade_in_in'])):?> |
| 85 |
fade: true, |
| 86 |
<?php endif;?> |
| 87 |
cssEase: '<?php echo esc_html($settings['layout_carousel_cssease'], 'linear');?>', |
| 88 |
responsive: [ |
| 89 |
{ |
| 90 |
breakpoint: 600, |
| 91 |
settings: { |
| 92 |
slidesToShow: 1, |
| 93 |
slidesToScroll: 1 |
| 94 |
} |
| 95 |
}, |
| 96 |
] |
| 97 |
}); |
| 98 |
}) |
| 99 |
</script> |
| 100 |
<?php endif;?> |