PluginProbe
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets / 4.1.4
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets v4.1.4
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 4.1.3 All 147 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.1.4, at modules/carbon-slider/widgets/carbon-slider.php

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