PluginProbe
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets / 4.5.6
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets v4.5.6
4.5.6 4.5.5 4.5.4 4.2.1 4.2.2 4.2.3 4.5.0 4.5.2 4.5.3 4.2.0 4.1.18 4.1.17 4.1.16 4.1.15 4.1.14 4.1.13 4.1.12 4.1.11 4.1.10 4.1.9 4.1.8 4.0.9 4.1.0 4.1.1 4.1.2 All 148 releases
ultimate-post-kit / modules / carbon-slider / widgets / carbon-slider.php

carbon-slider.php in Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets 4.5.6, at modules/carbon-slider/widgets/carbon-slider.php

1,471 lines 38.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace UltimatePostKit\Modules\CarbonSlider\Widgets;
4
5 use Elementor\Controls_Manager;
6 use Elementor\Group_Control_Border;
7 use Elementor\Group_Control_Box_Shadow;
8 use Elementor\Group_Control_Typography;
9 use Elementor\Group_Control_Text_Shadow;
10 use Elementor\Group_Control_Text_Stroke;
11 use Elementor\Group_Control_Image_Size;
12 use Elementor\Group_Control_Background;
13 use Elementor\Utils;
14 use Elementor\Plugin;
15
16 use UltimatePostKit\Traits\Global_Widget_Controls;
17 use UltimatePostKit\Traits\Global_Widget_Functions;
18 use UltimatePostKit\Includes\Controls\GroupQuery\Group_Control_Query;
19 use WP_Query;
20
21 if (!defined('ABSPATH')) exit; // Exit if accessed directly
22
23 class Carbon_Slider extends Group_Control_Query {
24
25 use Global_Widget_Controls;
26 use Global_Widget_Functions;
27
28 private $_query = null;
29
30 public function get_name() {
31 return 'upk-carbon-slider';
32 }
33
34 public function get_title() {
35 return BDTUPK . esc_html__('Carbon Slider', 'ultimate-post-kit');
36 }
37
38 public function get_icon() {
39 return 'upk-widget-icon upk-icon-carbon-slider';
40 }
41
42 public function get_categories() {
43 return ['ultimate-post-kit'];
44 }
45
46 public function get_keywords() {
47 return ['post', 'carousel', 'blog', 'recent', 'news', 'slider', 'carbon', 'horizontal', 'timeline'];
48 }
49
50 public function get_style_depends() {
51 if ($this->upk_is_edit_mode()) {
52 return ['swiper', 'upk-all-styles'];
53 } else {
54 return ['swiper', 'upk-font', 'upk-carbon-slider'];
55 }
56 }
57
58 public function get_script_depends() {
59 if ($this->upk_is_edit_mode()) {
60 return ['swiper', 'upk-all-scripts'];
61 } else {
62 return ['swiper', 'upk-carbon-slider'];
63 }
64 }
65
66 public function get_custom_help_url() {
67 return 'https://youtu.be/1NNnJRZxxpc';
68 }
69
70
71 public function get_query() {
72 return $this->_query;
73 }
74
75 public function has_widget_inner_wrapper(): bool {
76 return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
77 }
78
79
80 protected function register_controls() {
81 $this->start_controls_section(
82 'section_content_layout',
83 [
84 'label' => esc_html__('Layout', 'ultimate-post-kit'),
85 ]
86 );
87
88 $this->add_responsive_control(
89 'content_max_width',
90 [
91 'label' => esc_html__('Content Max Width', 'ultimate-post-kit'),
92 'type' => Controls_Manager::SLIDER,
93 'size_units' => ['px', 'vw', '%'],
94 'range' => [
95 'px' => [
96 'min' => 200,
97 'max' => 1080,
98 ],
99 'vw' => [
100 'min' => 10,
101 'max' => 100,
102 ],
103 '%' => [
104 'min' => 10,
105 'max' => 100,
106 ],
107 ],
108 'selectors' => [
109 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-content, {{WRAPPER}} .upk-carbon-slider-wrap .upk-image-wrap' => 'max-width: {{SIZE}}{{UNIT}};',
110 ],
111 ]
112 );
113
114 $this->add_responsive_control(
115 'content_text_alignment',
116 [
117 'label' => __('Alignment', 'ultimate-post-kit'),
118 'type' => Controls_Manager::CHOOSE,
119 'default' => 'center',
120 'options' => [
121 'left' => [
122 'title' => __('Left', 'ultimate-post-kit'),
123 'icon' => 'eicon-h-align-left',
124 ],
125 'center' => [
126 'title' => __('Center', 'ultimate-post-kit'),
127 'icon' => 'eicon-h-align-center',
128 ],
129 'right' => [
130 'title' => __('Right', 'ultimate-post-kit'),
131 'icon' => 'eicon-h-align-right',
132 ],
133 ],
134 'selectors' => [
135 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-content, {{WRAPPER}} .upk-carbon-slider-wrap .upk-image-wrap' => 'text-align: {{VALUE}};',
136 ],
137 ]
138 );
139
140 $this->add_control(
141 'show_image',
142 [
143 'label' => esc_html__('Show Image', 'ultimate-post-kit'),
144 'type' => Controls_Manager::SWITCHER,
145 'separator' => 'before'
146 ]
147 );
148
149 $this->add_group_control(
150 Group_Control_Image_Size::get_type(),
151 [
152 'name' => 'primary_thumbnail',
153 // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Elementor widget query built from user-configured controls; expected behaviour.
154 'exclude' => ['custom'],
155 'default' => 'full',
156 'condition' => [
157 'show_image' => 'yes'
158 ]
159 ]
160 );
161
162 $this->add_control(
163 'hr_1',
164 [
165 'type' => Controls_Manager::DIVIDER,
166 ]
167 );
168
169 //Global Title Controls
170 $this->register_title_controls();
171 $this->register_text_controls();
172
173 $this->add_control(
174 'show_category',
175 [
176 'label' => esc_html__('Show Category', 'ultimate-post-kit'),
177 'type' => Controls_Manager::SWITCHER,
178 'default' => 'yes',
179 'separator' => 'before'
180 ]
181 );
182
183 $this->add_control(
184 'show_author',
185 [
186 'label' => esc_html__('Show Author', 'ultimate-post-kit'),
187 'type' => Controls_Manager::SWITCHER,
188 'default' => 'yes',
189 ]
190 );
191
192 $this->add_control(
193 'meta_separator',
194 [
195 'label' => __('Separator', 'ultimate-post-kit'),
196 'type' => Controls_Manager::TEXT,
197 'default' => '//',
198 'label_block' => false,
199 ]
200 );
201
202 $this->add_control(
203 'show_comments',
204 [
205 'label' => esc_html__('Show Comments', 'ultimate-post-kit'),
206 'type' => Controls_Manager::SWITCHER,
207 'default' => 'yes',
208 ]
209 );
210
211 //Global Reading Time Controls
212 $this->register_reading_time_controls();
213
214 //Global Date Controls
215 $this->register_date_controls();
216
217 $this->add_control(
218 'show_navigation',
219 [
220 'label' => esc_html__('Show Navigation', 'ultimate-post-kit'),
221 'type' => Controls_Manager::SWITCHER,
222 'default' => 'yes',
223 'separator' => 'before'
224 ]
225 );
226
227 $this->end_controls_section();
228
229 // Query Settings
230 $this->start_controls_section(
231 'section_post_query_builder',
232 [
233 'label' => __('Query', 'ultimate-post-kit'),
234 'tab' => Controls_Manager::TAB_CONTENT,
235 ]
236 );
237
238 $this->add_control(
239 'item_limit',
240 [
241 'label' => esc_html__('Item Limit', 'ultimate-post-kit'),
242 'type' => Controls_Manager::SLIDER,
243 'range' => [
244 'px' => [
245 'min' => 1,
246 'max' => 20,
247 ],
248 ],
249 'default' => [
250 'size' => 12,
251 ],
252 'condition' => [
253 'posts_source!' => 'current_query',
254 ]
255 ]
256 );
257
258 $this->register_query_builder_controls();
259
260 $this->end_controls_section();
261
262 $this->start_controls_section(
263 'section_carousel_settings',
264 [
265 'label' => __('Slider Settings', 'ultimate-post-kit'),
266 ]
267 );
268
269 $this->add_control(
270 'autoplay',
271 [
272 'label' => __('Autoplay', 'ultimate-post-kit'),
273 'type' => Controls_Manager::SWITCHER,
274 'default' => 'yes',
275
276 ]
277 );
278
279 $this->add_control(
280 'autoplay_speed',
281 [
282 'label' => esc_html__('Autoplay Speed', 'ultimate-post-kit'),
283 'type' => Controls_Manager::NUMBER,
284 'default' => 5000,
285 'condition' => [
286 'autoplay' => 'yes',
287 ],
288 ]
289 );
290
291 $this->add_control(
292 'pauseonhover',
293 [
294 'label' => esc_html__('Pause on Hover', 'ultimate-post-kit'),
295 'type' => Controls_Manager::SWITCHER,
296 'condition' => [
297 'autoplay' => 'yes',
298 ],
299 ]
300 );
301
302 $this->add_control(
303 'grab_cursor',
304 [
305 'label' => __('Grab Cursor', 'ultimate-post-kit'),
306 'type' => Controls_Manager::SWITCHER,
307 ]
308 );
309
310 $this->add_control(
311 'loop',
312 [
313 'label' => __('Loop', 'ultimate-post-kit'),
314 'type' => Controls_Manager::SWITCHER,
315 'default' => 'yes',
316
317 ]
318 );
319
320 $this->add_control(
321 'speed',
322 [
323 'label' => __('Animation Speed (ms)', 'ultimate-post-kit'),
324 'type' => Controls_Manager::SLIDER,
325 'default' => [
326 'size' => 500,
327 ],
328 'range' => [
329 'px' => [
330 'min' => 100,
331 'max' => 5000,
332 'step' => 50,
333 ],
334 ],
335 ]
336 );
337
338 $this->add_control(
339 'observer',
340 [
341 'label' => __('Observer', 'ultimate-post-kit'),
342 'description' => __('When you use carousel in any hidden place (in tabs, accordion etc) keep it yes.', 'ultimate-post-kit'),
343 'type' => Controls_Manager::SWITCHER,
344 ]
345 );
346
347 $this->end_controls_section();
348
349 //Style
350 $this->start_controls_section(
351 'upk_section_style_image',
352 [
353 'label' => esc_html__('Image', 'ultimate-post-kit'),
354 'tab' => Controls_Manager::TAB_STYLE,
355 'condition' => [
356 'show_image' => 'yes'
357 ],
358 ]
359 );
360
361 $this->add_responsive_control(
362 'image_height',
363 [
364 'label' => esc_html__('Height', 'ultimate-post-kit'),
365 'type' => Controls_Manager::SLIDER,
366 'size_units' => ['px'],
367 'range' => [
368 'px' => [
369 'min' => 100,
370 'max' => 500,
371 ]
372 ],
373 'selectors' => [
374 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-image-wrap .upk-img' => 'height: {{SIZE}}{{UNIT}};',
375 ],
376 ]
377 );
378
379 $this->add_responsive_control(
380 'image_width',
381 [
382 'label' => esc_html__('Width', 'ultimate-post-kit'),
383 'type' => Controls_Manager::SLIDER,
384 'size_units' => ['px'],
385 'range' => [
386 'px' => [
387 'min' => 100,
388 'max' => 800,
389 ],
390 ],
391 'selectors' => [
392 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-image-wrap .upk-img' => 'width: {{SIZE}}{{UNIT}};',
393 ],
394 ]
395 );
396
397 $this->add_group_control(
398 Group_Control_Border::get_type(),
399 [
400 'name' => 'image_border',
401 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-image-wrap .upk-img',
402 ]
403 );
404
405 $this->add_responsive_control(
406 'image_border_radius',
407 [
408 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
409 'type' => Controls_Manager::DIMENSIONS,
410 'size_units' => ['px', '%'],
411 'selectors' => [
412 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-image-wrap .upk-img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
413 ],
414 ]
415 );
416
417 $this->add_responsive_control(
418 'image_margin',
419 [
420 'label' => esc_html__('Margin', 'ultimate-post-kit'),
421 'type' => Controls_Manager::DIMENSIONS,
422 'size_units' => ['px', 'em', '%'],
423 'selectors' => [
424 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-image-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
425 ],
426 ]
427 );
428
429 $this->end_controls_section();
430
431 $this->start_controls_section(
432 'section_style_title',
433 [
434 'label' => esc_html__('Title', 'ultimate-post-kit'),
435 'tab' => Controls_Manager::TAB_STYLE,
436 'condition' => [
437 'show_title' => 'yes',
438 ],
439 ]
440 );
441
442 $this->add_control(
443 'title_style',
444 [
445 'label' => esc_html__('Style', 'ultimate-post-kit'),
446 'type' => Controls_Manager::SELECT,
447 'default' => '',
448 'options' => [
449 '' => esc_html__('Default', 'ultimate-post-kit'),
450 'underline' => esc_html__('Underline', 'ultimate-post-kit'),
451 'middle-underline' => esc_html__('Middle Underline', 'ultimate-post-kit'),
452 'overline' => esc_html__('Overline', 'ultimate-post-kit'),
453 'middle-overline' => esc_html__('Middle Overline', 'ultimate-post-kit'),
454 ],
455 ]
456 );
457
458 $this->add_control(
459 'title_color',
460 [
461 'label' => esc_html__('Color', 'ultimate-post-kit'),
462 'type' => Controls_Manager::COLOR,
463 'selectors' => [
464 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-title a' => 'color: {{VALUE}};',
465 ],
466 ]
467 );
468
469 $this->add_control(
470 'title_hover_color',
471 [
472 'label' => esc_html__('Hover Color', 'ultimate-post-kit'),
473 'type' => Controls_Manager::COLOR,
474 'selectors' => [
475 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-title a:hover' => 'color: {{VALUE}};',
476 ],
477 ]
478 );
479
480 $this->add_responsive_control(
481 'title_padding',
482 [
483 'label' => esc_html__('Padding', 'ultimate-post-kit') . BDTUPK_NC,
484 'type' => Controls_Manager::DIMENSIONS,
485 'size_units' => ['px', 'em', '%'],
486 'selectors' => [
487 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
488 ],
489 ]
490 );
491
492 $this->add_responsive_control(
493 'title_margin',
494 [
495 'label' => esc_html__('Margin', 'ultimate-post-kit'),
496 'type' => Controls_Manager::DIMENSIONS,
497 'size_units' => ['px', 'em', '%'],
498 'selectors' => [
499 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
500 ],
501 ]
502 );
503
504 $this->add_group_control(
505 Group_Control_Typography::get_type(),
506 [
507 'name' => 'title_typography',
508 'label' => esc_html__('Typography', 'ultimate-post-kit'),
509 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-title',
510 ]
511 );
512
513 $this->add_group_control(
514 Group_Control_Text_Shadow::get_type(),
515 [
516 'name' => 'title_text_shadow',
517 'label' => __('Text Shadow', 'ultimate-post-kit'),
518 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-title a',
519 ]
520 );
521
522 $this->add_group_control(
523 Group_Control_Text_Stroke::get_type(),
524 [
525 'name' => 'title_text_stroke',
526 'label' => __('Text Stroke', 'ultimate-post-kit') . BDTUPK_NC,
527 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-title a',
528 ]
529 );
530
531 $this->end_controls_section();
532
533 $this->start_controls_section(
534 'section_style_meta',
535 [
536 'label' => esc_html__('Meta', 'ultimate-post-kit'),
537 'tab' => Controls_Manager::TAB_STYLE,
538 'conditions' => [
539 'relation' => 'or',
540 'terms' => [
541 [
542 'name' => 'show_author',
543 'value' => 'yes'
544 ],
545 [
546 'name' => 'show_comments',
547 'value' => 'yes'
548 ],
549 ]
550 ],
551 ]
552 );
553
554 $this->add_control(
555 'meta_color',
556 [
557 'label' => esc_html__('Color', 'ultimate-post-kit'),
558 'type' => Controls_Manager::COLOR,
559 'selectors' => [
560 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-meta,
561 {{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-meta .upk-author a' => 'color: {{VALUE}};',
562 ],
563 ]
564 );
565
566 $this->add_control(
567 'meta_hover_color',
568 [
569 'label' => esc_html__('Hover Color', 'ultimate-post-kit'),
570 'type' => Controls_Manager::COLOR,
571 'selectors' => [
572 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-meta .upk-author a:hover' => 'color: {{VALUE}};',
573 ],
574 ]
575 );
576
577 $this->add_responsive_control(
578 'meta_space_between',
579 [
580 'label' => esc_html__('Space Between', 'ultimate-post-kit'),
581 'type' => Controls_Manager::SLIDER,
582 'range' => [
583 'px' => [
584 'min' => 0,
585 'max' => 50,
586 ],
587 ],
588 'selectors' => [
589 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-meta > div:before' => 'margin: 0 {{SIZE}}{{UNIT}};',
590 ],
591 ]
592 );
593
594 $this->add_responsive_control(
595 'meta_margin',
596 [
597 'label' => esc_html__('Margin', 'ultimate-post-kit'),
598 'type' => Controls_Manager::DIMENSIONS,
599 'size_units' => ['px', 'em', '%'],
600 'selectors' => [
601 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-meta' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
602 ],
603 ]
604 );
605
606 $this->add_group_control(
607 Group_Control_Typography::get_type(),
608 [
609 'name' => 'meta_typography',
610 'label' => esc_html__('Typography', 'ultimate-post-kit'),
611 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-meta',
612 ]
613 );
614
615 $this->end_controls_section();
616
617 $this->start_controls_section(
618 'section_style_category_comments',
619 [
620 'label' => esc_html__('Category', 'ultimate-post-kit'),
621 'tab' => Controls_Manager::TAB_STYLE,
622 'condition' => [
623 'show_category' => 'yes'
624 ],
625 ]
626 );
627
628 $this->start_controls_tabs('tabs_category_style');
629
630 $this->start_controls_tab(
631 'tab_category_normal',
632 [
633 'label' => esc_html__('Normal', 'ultimate-post-kit'),
634 ]
635 );
636
637 $this->add_control(
638 'category_comments_color',
639 [
640 'label' => esc_html__('Color', 'ultimate-post-kit'),
641 'type' => Controls_Manager::COLOR,
642 'selectors' => [
643 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-category a' => 'color: {{VALUE}};',
644 ],
645 ]
646 );
647
648 $this->add_group_control(
649 Group_Control_Background::get_type(),
650 [
651 'name' => 'category_background',
652 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-category a',
653 ]
654 );
655
656 $this->add_group_control(
657 Group_Control_Border::get_type(),
658 [
659 'name' => 'category_border',
660 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-category a',
661 ]
662 );
663
664 $this->add_responsive_control(
665 'category_border_radius',
666 [
667 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
668 'type' => Controls_Manager::DIMENSIONS,
669 'size_units' => ['px', '%'],
670 'selectors' => [
671 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-category a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
672 ],
673 ]
674 );
675
676 $this->add_responsive_control(
677 'category_padding',
678 [
679 'label' => esc_html__('Padding', 'ultimate-post-kit'),
680 'type' => Controls_Manager::DIMENSIONS,
681 'size_units' => ['px', 'em', '%'],
682 'selectors' => [
683 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-category a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
684 ],
685 ]
686 );
687
688 $this->add_responsive_control(
689 'category_margin',
690 [
691 'label' => esc_html__('Margin', 'ultimate-post-kit'),
692 'type' => Controls_Manager::DIMENSIONS,
693 'size_units' => ['px', 'em', '%'],
694 'selectors' => [
695 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-category-and-comment' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
696 ],
697 ]
698 );
699
700 $this->add_responsive_control(
701 'category_spacing',
702 [
703 'label' => esc_html__('Space Between', 'ultimate-post-kit'),
704 'type' => Controls_Manager::SLIDER,
705 'range' => [
706 'px' => [
707 'min' => 0,
708 'max' => 50,
709 ],
710 ],
711 'selectors' => [
712 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-category a+a' => 'margin-left: {{SIZE}}{{UNIT}};',
713 ],
714 ]
715 );
716
717 $this->add_group_control(
718 Group_Control_Typography::get_type(),
719 [
720 'name' => 'category_typography',
721 'label' => esc_html__('Typography', 'ultimate-post-kit'),
722 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-category a',
723 ]
724 );
725
726 $this->add_group_control(
727 Group_Control_Box_Shadow::get_type(),
728 [
729 'name' => 'category_shadow',
730 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-category a',
731 ]
732 );
733
734 $this->end_controls_tab();
735
736 $this->start_controls_tab(
737 'tab_category_hover',
738 [
739 'label' => esc_html__('Hover', 'ultimate-post-kit'),
740 'condition' => [
741 'show_category' => 'yes'
742 ]
743 ]
744 );
745
746 $this->add_control(
747 'category_hover_color',
748 [
749 'label' => esc_html__('Color', 'ultimate-post-kit'),
750 'type' => Controls_Manager::COLOR,
751 'selectors' => [
752 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-category a:hover' => 'color: {{VALUE}};',
753 ],
754 ]
755 );
756
757 $this->add_group_control(
758 Group_Control_Background::get_type(),
759 [
760 'name' => 'category_hover_background',
761 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-category a:hover',
762 ]
763 );
764
765 $this->add_control(
766 'category_hover_border_color',
767 [
768 'label' => esc_html__('Border Color', 'ultimate-post-kit'),
769 'type' => Controls_Manager::COLOR,
770 'condition' => [
771 'category_border_border!' => '',
772 ],
773 'selectors' => [
774 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-category a:hover' => 'border-color: {{VALUE}};',
775 ],
776 ]
777 );
778
779 $this->end_controls_tab();
780
781 $this->end_controls_tabs();
782
783 $this->end_controls_section();
784
785 $this->start_controls_section(
786 'section_style_description',
787 [
788 'label' => esc_html__('Text', 'ultimate-post-kit'),
789 'tab' => Controls_Manager::TAB_STYLE,
790 'condition' => [
791 'show_excerpt' => 'yes'
792 ]
793 ]
794 );
795
796 $this->add_control(
797 'description_color',
798 [
799 'label' => esc_html__('Color', 'ultimate-post-kit'),
800 'type' => Controls_Manager::COLOR,
801 'selectors' => [
802 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-text' => 'color: {{VALUE}};',
803 ],
804 ]
805 );
806
807 $this->add_responsive_control(
808 'text_margin',
809 [
810 'label' => esc_html__('Margin', 'ultimate-post-kit'),
811 'type' => Controls_Manager::DIMENSIONS,
812 'size_units' => ['px', 'em', '%'],
813 'selectors' => [
814 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
815 ],
816 ]
817 );
818
819 $this->add_group_control(
820 Group_Control_Typography::get_type(),
821 [
822 'name' => 'description_typography',
823 'label' => esc_html__('Typography', 'ultimate-post-kit'),
824 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-main .upk-text',
825 ]
826 );
827
828 $this->end_controls_section();
829
830
831 $this->start_controls_section(
832 'section_style_thumbs',
833 [
834 'label' => esc_html__('Thumbs', 'ultimate-post-kit'),
835 'tab' => Controls_Manager::TAB_STYLE,
836 ]
837 );
838
839 $this->start_controls_tabs('style_tabs_thumbs_style');
840
841 $this->start_controls_tab(
842 'tab_thumbs_date',
843 [
844 'label' => esc_html__('Date', 'ultimate-post-kit'),
845 ]
846 );
847
848 $this->add_control(
849 'thumbs_date_color',
850 [
851 'label' => esc_html__('Color', 'ultimate-post-kit'),
852 'type' => Controls_Manager::COLOR,
853 'selectors' => [
854 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-thumbs .upk-date' => 'color: {{VALUE}};',
855 ],
856 ]
857 );
858 $this->add_group_control(
859 Group_Control_Typography::get_type(),
860 [
861 'name' => 'thumbs_date_typography',
862 'label' => esc_html__('Typography', 'ultimate-post-kit'),
863 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-thumbs .upk-date',
864 ]
865 );
866
867 $this->add_responsive_control(
868 'date_spacing',
869 [
870 'label' => esc_html__('Space Between', 'ultimate-post-kit'),
871 'type' => Controls_Manager::SLIDER,
872 'range' => [
873 'px' => [
874 'min' => 0,
875 'max' => 50,
876 ],
877 ],
878 'selectors' => [
879 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-thumbs .upk-post-time' => 'margin-left: {{SIZE}}{{UNIT}};',
880 ],
881 ]
882 );
883
884 $this->end_controls_tab();
885
886 $this->start_controls_tab(
887 'tab_thumbs_line',
888 [
889 'label' => esc_html__('Line', 'ultimate-post-kit'),
890 ]
891 );
892
893 $this->add_control(
894 'thumbs_line_color',
895 [
896 'label' => esc_html__('Color', 'ultimate-post-kit'),
897 'type' => Controls_Manager::COLOR,
898 'selectors' => [
899 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-thumbs::before' => 'background-image: linear-gradient(to right, transparent, {{VALUE}}, transparent);',
900 ],
901 ]
902 );
903
904 $this->add_responsive_control(
905 'thumbs_border_height',
906 [
907 'label' => esc_html__('Height', 'ultimate-post-kit'),
908 'type' => Controls_Manager::SLIDER,
909 'range' => [
910 'px' => [
911 'min' => 1,
912 'max' => 10,
913 ],
914 ],
915 'selectors' => [
916 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-thumbs::before' => 'height: {{SIZE}}{{UNIT}};',
917 ],
918 ]
919 );
920
921 $this->end_controls_tab();
922 $this->end_controls_tabs();
923
924 $this->add_control(
925 'thumbs_dits_heading',
926 [
927 'label' => esc_html__('DOTS', 'ultimate-post-kit'),
928 'type' => Controls_Manager::HEADING,
929 'separator' => 'before'
930 ]
931 );
932
933 $this->start_controls_tabs(
934 'style_tabs_thumbs_dots'
935 );
936
937 $this->start_controls_tab(
938 'style_normal_tab',
939 [
940 'label' => esc_html__('Normal', 'ultimate-post-kit'),
941 ]
942 );
943
944 $this->add_group_control(
945 Group_Control_Background::get_type(),
946 [
947 'name' => 'thumbs_dots_background',
948 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-thumbs .upk-dot::after',
949 ]
950 );
951
952 $this->add_group_control(
953 Group_Control_Border::get_type(),
954 [
955 'name' => 'thumbs_dots_border',
956 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-thumbs .upk-dot::after',
957 ]
958 );
959
960 $this->add_responsive_control(
961 'thumbs_dots_border_radius',
962 [
963 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
964 'type' => Controls_Manager::DIMENSIONS,
965 'size_units' => ['px', '%'],
966 'selectors' => [
967 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-thumbs .upk-dot::after' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
968 ],
969 ]
970 );
971
972 $this->add_responsive_control(
973 'thumbs_dots_size',
974 [
975 'label' => esc_html__('Dots Size', 'ultimate-post-kit'),
976 'type' => Controls_Manager::SLIDER,
977 'range' => [
978 'px' => [
979 'min' => 0,
980 'max' => 50,
981 ],
982 ],
983 'selectors' => [
984 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-thumbs .upk-dot::after' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
985 ],
986 ]
987 );
988
989 $this->end_controls_tab();
990
991 $this->start_controls_tab(
992 'style_hover_tab',
993 [
994 'label' => esc_html__('Hover', 'ultimate-post-kit'),
995 ]
996 );
997
998 $this->add_group_control(
999 Group_Control_Background::get_type(),
1000 [
1001 'name' => 'thumbs_dots_hover_background',
1002 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-thumbs .upk-dot:hover::after',
1003 ]
1004 );
1005
1006 $this->add_group_control(
1007 Group_Control_Border::get_type(),
1008 [
1009 'name' => 'thumbs_dots_hover_border',
1010 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-thumbs .upk-dot:hover::after',
1011 ]
1012 );
1013 $this->end_controls_tab();
1014
1015 $this->start_controls_tab(
1016 'style_active_tab',
1017 [
1018 'label' => esc_html__('Active', 'ultimate-post-kit'),
1019 ]
1020 );
1021
1022 $this->add_group_control(
1023 Group_Control_Background::get_type(),
1024 [
1025 'name' => 'thumbs_dots_active_background',
1026 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-thumbs .upk-item.swiper-slide-active .upk-dot::after',
1027 ]
1028 );
1029
1030 $this->add_group_control(
1031 Group_Control_Border::get_type(),
1032 [
1033 'name' => 'thumbs_dots_active__border',
1034 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-carbon-thumbs .upk-item.swiper-slide-active .upk-dot::after',
1035 ]
1036 );
1037 $this->end_controls_tab();
1038
1039 $this->end_controls_tabs();
1040
1041 $this->add_control(
1042 'thumbs_arrows_heading',
1043 [
1044 'label' => esc_html__('ARROWS', 'ultimate-post-kit'),
1045 'type' => Controls_Manager::HEADING,
1046 'separator' => 'before',
1047 'condition' => [
1048 'show_navigation' => 'yes'
1049 ]
1050 ]
1051 );
1052
1053 $this->add_control(
1054 'nav_arrows_icon',
1055 [
1056 'label' => esc_html__('Arrows Icon', 'ultimate-post-kit') . BDTUPK_NC,
1057 'type' => Controls_Manager::SELECT,
1058 'default' => '0',
1059 'options' => [
1060 '0' => esc_html__('Default', 'ultimate-post-kit'),
1061 '1' => esc_html__('Style 1', 'ultimate-post-kit'),
1062 '2' => esc_html__('Style 2', 'ultimate-post-kit'),
1063 '3' => esc_html__('Style 3', 'ultimate-post-kit'),
1064 '4' => esc_html__('Style 4', 'ultimate-post-kit'),
1065 '5' => esc_html__('Style 5', 'ultimate-post-kit'),
1066 '6' => esc_html__('Style 6', 'ultimate-post-kit'),
1067 '7' => esc_html__('Style 7', 'ultimate-post-kit'),
1068 '8' => esc_html__('Style 8', 'ultimate-post-kit'),
1069 '9' => esc_html__('Style 9', 'ultimate-post-kit'),
1070 '10' => esc_html__('Style 10', 'ultimate-post-kit'),
1071 '11' => esc_html__('Style 11', 'ultimate-post-kit'),
1072 '12' => esc_html__('Style 12', 'ultimate-post-kit'),
1073 '13' => esc_html__('Style 13', 'ultimate-post-kit'),
1074 '14' => esc_html__('Style 14', 'ultimate-post-kit'),
1075 '15' => esc_html__('Style 15', 'ultimate-post-kit'),
1076 '16' => esc_html__('Style 16', 'ultimate-post-kit'),
1077 '17' => esc_html__('Style 17', 'ultimate-post-kit'),
1078 '18' => esc_html__('Style 18', 'ultimate-post-kit'),
1079 'circle-1' => esc_html__('Style 19', 'ultimate-post-kit'),
1080 'circle-2' => esc_html__('Style 20', 'ultimate-post-kit'),
1081 'circle-3' => esc_html__('Style 21', 'ultimate-post-kit'),
1082 'circle-4' => esc_html__('Style 22', 'ultimate-post-kit'),
1083 'square-1' => esc_html__('Style 23', 'ultimate-post-kit'),
1084 ],
1085 'condition' => [
1086 'show_navigation' => 'yes'
1087 ]
1088 ]
1089 );
1090
1091 $this->start_controls_tabs('tabs_navigation_arrows_style');
1092
1093 $this->start_controls_tab(
1094 'tabs_nav_arrows_normal',
1095 [
1096 'label' => __('Normal', 'ultimate-post-kit'),
1097 'condition' => [
1098 'show_navigation' => 'yes'
1099 ]
1100 ]
1101 );
1102
1103 $this->add_control(
1104 'arrows_icon_color',
1105 [
1106 'label' => __('Color', 'ultimate-post-kit'),
1107 'type' => Controls_Manager::COLOR,
1108 'selectors' => [
1109 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-navigation-button' => 'color: {{VALUE}}',
1110 ],
1111 'condition' => [
1112 'show_navigation' => 'yes'
1113 ]
1114 ]
1115 );
1116
1117 $this->add_group_control(
1118 Group_Control_Background::get_type(),
1119 [
1120 'name' => 'arrows_background',
1121 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-navigation-button',
1122 'condition' => [
1123 'show_navigation' => 'yes'
1124 ]
1125 ]
1126 );
1127
1128 $this->add_group_control(
1129 Group_Control_Border::get_type(),
1130 [
1131 'name' => 'arrows_border',
1132 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-navigation-button',
1133 'condition' => [
1134 'show_navigation' => 'yes'
1135 ]
1136 ]
1137 );
1138
1139 $this->add_responsive_control(
1140 'arrows_border_radius',
1141 [
1142 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
1143 'type' => Controls_Manager::DIMENSIONS,
1144 'size_units' => ['px', '%'],
1145 'selectors' => [
1146 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-navigation-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1147 ],
1148 'condition' => [
1149 'show_navigation' => 'yes'
1150 ]
1151 ]
1152 );
1153
1154 $this->add_responsive_control(
1155 'arrows_icon_size',
1156 [
1157 'label' => esc_html__('Size', 'ultimate-post-kit'),
1158 'type' => Controls_Manager::SLIDER,
1159 'selectors' => [
1160 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-navigation-button' => 'font-size: {{SIZE}}{{UNIT}};',
1161 ],
1162 'condition' => [
1163 'show_navigation' => 'yes'
1164 ]
1165 ]
1166 );
1167
1168 $this->add_responsive_control(
1169 'navigation_padding',
1170 [
1171 'label' => __('Padding', 'ultimate-post-kit'),
1172 'type' => Controls_Manager::DIMENSIONS,
1173 'size_units' => ['px', 'em', '%'],
1174 'selectors' => [
1175 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-navigation-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1176 ],
1177 'condition' => [
1178 'show_navigation' => 'yes'
1179 ]
1180 ]
1181 );
1182
1183 $this->end_controls_tab();
1184
1185 $this->start_controls_tab(
1186 'tabs_nav_arrows_hover',
1187 [
1188 'label' => __('Hover', 'ultimate-post-kit'),
1189 'condition' => [
1190 'show_navigation' => 'yes'
1191 ]
1192 ]
1193 );
1194
1195 $this->add_control(
1196 'arrows_hover_color',
1197 [
1198 'label' => __('Color', 'ultimate-post-kit'),
1199 'type' => Controls_Manager::COLOR,
1200 'selectors' => [
1201 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-navigation-button:hover' => 'color: {{VALUE}}',
1202 ],
1203 'condition' => [
1204 'show_navigation' => 'yes'
1205 ]
1206 ]
1207 );
1208
1209 $this->add_group_control(
1210 Group_Control_Background::get_type(),
1211 [
1212 'name' => 'arrows_hover_background',
1213 'selector' => '{{WRAPPER}} .upk-carbon-slider-wrap .upk-navigation-button:hover',
1214 'condition' => [
1215 'show_navigation' => 'yes'
1216 ]
1217 ]
1218 );
1219
1220 $this->add_control(
1221 'arrows_hover_border_color',
1222 [
1223 'label' => esc_html__('Border Color', 'ultimate-post-kit'),
1224 'type' => Controls_Manager::COLOR,
1225 'condition' => [
1226 'arrows_border_border!' => '',
1227 'show_navigation' => 'yes'
1228 ],
1229 'selectors' => [
1230 '{{WRAPPER}} .upk-carbon-slider-wrap .upk-navigation-button:hover' => 'border-color: {{VALUE}};',
1231 ],
1232 ]
1233 );
1234 $this->end_controls_tab();
1235
1236 $this->end_controls_tabs();
1237
1238 $this->end_controls_section();
1239 }
1240
1241 /**
1242 * Main query render for this widget
1243 * @param $posts_per_page number item query limit
1244 */
1245 public function query_posts($posts_per_page) {
1246
1247 $default = $this->getGroupControlQueryArgs();
1248 $args = [];
1249 if ($posts_per_page) {
1250 $args['posts_per_page'] = $posts_per_page;
1251 }
1252 $args = array_merge($default, $args);
1253 $this->_query = new WP_Query($args);
1254 }
1255
1256 public function render_author() {
1257
1258 if (!$this->get_settings('show_author')) {
1259 return;
1260 }
1261 ?>
1262 <div class="upk-author">
1263 <i class="upk-icon-user" aria-hidden="true"></i>
1264 <a class="upk-name" href="<?php echo esc_url( get_author_posts_url(get_the_author_meta('ID')) ); ?>">
1265 <?php echo esc_html( get_the_author() ) ?>
1266 </a>
1267 </div>
1268 <?php
1269 }
1270
1271 public function render_comments($id = 0) {
1272
1273 if (!$this->get_settings('show_comments')) {
1274 return;
1275 }
1276 ?>
1277
1278 <div class="upk-comments">
1279 <?php echo esc_html( $this->upk_get_formatted_comments_count( $id ) ); ?>
1280 </div>
1281
1282 <?php
1283 }
1284
1285 public function render_header() {
1286 $id = 'upk-carbon-slider-' . $this->get_id();
1287 $settings = $this->get_settings_for_display();
1288
1289 $this->add_render_attribute('carbon-slider', 'id', $id);
1290 $this->add_render_attribute('carbon-slider', 'class', ['upk-carbon-main']);
1291
1292 $this->add_render_attribute(
1293 [
1294 'carbon-slider' => [
1295 'data-settings' => [
1296 wp_json_encode(array_filter([
1297 "autoplay" => ("yes" == $settings["autoplay"]) ? ["delay" => $settings["autoplay_speed"]] : false,
1298 "loop" => ($settings["loop"] == "yes") ? true : false,
1299 "speed" => $settings["speed"]["size"],
1300 "effect" => 'fade',
1301 "fadeEffect" => ['crossFade' => true],
1302 "lazy" => true,
1303 "parallax" => true,
1304 "grabCursor" => ($settings["grab_cursor"] === "yes") ? true : false,
1305 "pauseOnHover" => ("yes" == $settings["pauseonhover"]) ? true : false,
1306 "slidesPerView" => 1,
1307 "observer" => ($settings["observer"]) ? true : false,
1308 "observeParents" => ($settings["observer"]) ? true : false,
1309 "loopedSlides" => 4,
1310 "lazy" => [
1311 "loadPrevNext" => "true",
1312 ],
1313 "navigation" => [
1314 "nextEl" => "#$id-wrapper .upk-navigation-next",
1315 "prevEl" => "#$id-wrapper .upk-navigation-prev",
1316 ],
1317 ]))
1318 ]
1319 ]
1320 ]
1321 );
1322
1323 $this->add_render_attribute('swiper', 'class', 'swiper-carousel swiper');
1324
1325 ?>
1326 <div <?php $this->print_render_attribute_string('carbon-slider'); ?>>
1327 <div <?php $this->print_render_attribute_string('swiper'); ?>>
1328 <div class="swiper-wrapper">
1329 <?php
1330 }
1331
1332 public function render_footer() {
1333 $settings = $this->get_settings_for_display();
1334
1335 ?>
1336
1337 </div>
1338 </div>
1339 </div>
1340 <?php
1341 }
1342
1343 public function render_post_grid_item($post_id, $image_size, $excerpt_length) {
1344 $settings = $this->get_settings_for_display();
1345
1346 $this->add_render_attribute('slider-item', 'class', 'upk-item swiper-slide', true);
1347
1348 ?>
1349 <div <?php $this->print_render_attribute_string('slider-item'); ?>>
1350 <?php if ($settings['show_image']) : ?>
1351 <div class="upk-image-wrap">
1352 <?php $this->render_image(get_post_thumbnail_id($post_id), $image_size); ?>
1353 </div>
1354 <?php endif; ?>
1355 <div class="upk-content">
1356 <?php if ($settings['show_category']) : ?>
1357 <div class="upk-category-and-comment" data-swiper-parallax-x="-300" data-swiper-parallax-duration="600">
1358 <?php $this->render_category(); ?>
1359 </div>
1360 <?php endif; ?>
1361 <?php if ($settings['show_title']) : ?>
1362 <div data-swiper-parallax-x="-300" data-swiper-parallax-duration="800">
1363 <?php $this->render_title(substr($this->get_name(), 4)); ?>
1364 </div>
1365 <?php endif; ?>
1366
1367 <?php if ($settings['show_author'] or $settings['show_comments'] or $settings['show_reading_time']) : ?>
1368 <div class="upk-meta" data-swiper-parallax-x="-300" data-swiper-parallax-duration="1000">
1369 <?php $this->render_author(); ?>
1370 <?php if (_is_upk_pro_activated()) :
1371 if ('yes' === $settings['show_reading_time']) : ?>
1372 <div class="upk-reading-time" data-separator="<?php echo esc_attr($settings['meta_separator']); ?>">
1373 <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'], $settings['hide_seconds'] ?? 'no', $settings['hide_minutes'] ?? 'no' ) ); ?>
1374 </div>
1375 <?php endif; ?>
1376 <?php endif; ?>
1377
1378 <?php if ($settings['show_comments']) : ?>
1379 <div data-separator="<?php echo esc_attr($settings['meta_separator']); ?>">
1380 <?php $this->render_comments($post_id); ?>
1381 </div>
1382 <?php endif; ?>
1383 </div>
1384 <?php endif; ?>
1385
1386 <?php if ($settings['show_excerpt']) : ?>
1387 <div data-swiper-parallax-x="-300" data-swiper-parallax-duration="1200">
1388 <?php $this->render_excerpt($excerpt_length); ?>
1389 </div>
1390 <?php endif; ?>
1391 </div>
1392 </div>
1393
1394 <?php
1395 }
1396
1397 public function render_thumbnav($post_id, $image_size) {
1398 $settings = $this->get_settings_for_display();
1399 $this->add_render_attribute('thumb-item', 'class', 'upk-item swiper-slide', true);
1400 ?>
1401 <div <?php $this->print_render_attribute_string('thumb-item'); ?>>
1402 <?php if ($settings['show_date']) : ?>
1403 <div class="upk-date-wrap upk-flex upk-flex-center">
1404 <?php $this->render_date(); ?>
1405 </div>
1406 <?php endif; ?>
1407 <div class="upk-dot"></div>
1408 </div>
1409 <?php
1410 }
1411
1412 public function render() {
1413 $settings = $this->get_settings_for_display();
1414 $id_wrapper = 'upk-carbon-slider-' . $this->get_id() . '-wrapper';
1415
1416 $this->query_posts($settings['item_limit']['size']);
1417 $wp_query = $this->get_query();
1418
1419 if (!$wp_query->found_posts) {
1420 return;
1421 }
1422
1423 $this->add_render_attribute('swiper-thumbs', 'class', 'upk-carbon-thumbs swiper');
1424
1425 ?>
1426 <div class="upk-carbon-slider-wrap" id="<?php echo esc_attr($id_wrapper); ?>">
1427 <?php
1428
1429 $this->render_header();
1430
1431 while ($wp_query->have_posts()) {
1432 $wp_query->the_post();
1433 $thumbnail_size = $settings['primary_thumbnail_size'];
1434
1435 $this->render_post_grid_item(get_the_ID(), $thumbnail_size, $settings['excerpt_length']);
1436 }
1437
1438 $this->render_footer();
1439
1440 ?>
1441 <div thumbsSlider="" <?php $this->print_render_attribute_string('swiper-thumbs'); ?>>
1442 <div class="swiper-wrapper">
1443 <?php
1444
1445 while ($wp_query->have_posts()) {
1446 $wp_query->the_post();
1447 $thumbnail_size = $settings['primary_thumbnail_size'];
1448
1449 $this->render_thumbnav(get_the_ID(), $thumbnail_size);
1450 }
1451
1452 ?>
1453 </div>
1454 <?php if ($settings['show_navigation']) : ?>
1455 <div class="upk-navigation-wrap">
1456 <div class="upk-navigation-button upk-navigation-prev">
1457 <i class="upk-icon-arrow-left-<?php echo esc_attr($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i>
1458 </div>
1459 <div class="upk-navigation-button upk-navigation-next">
1460 <i class="upk-icon-arrow-right-<?php echo esc_attr($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i>
1461 </div>
1462 </div>
1463 <?php endif; ?>
1464
1465 </div>
1466 </div>
1467 <?php
1468 wp_reset_postdata();
1469 }
1470 }
1471