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

1,465 lines 38.3 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 if ($posts_per_page) {
1242 $args['posts_per_page'] = $posts_per_page;
1243 // $args['paged'] = max(1, get_query_var('paged'), get_query_var('page'));
1244 }
1245 $args = array_merge($default, $args);
1246 $this->_query = new WP_Query($args);
1247 }
1248
1249 public function render_author() {
1250
1251 if (!$this->get_settings('show_author')) {
1252 return;
1253 }
1254 ?>
1255 <div class="upk-author">
1256 <i class="upk-icon-user" aria-hidden="true"></i>
1257 <a class="upk-name" href="<?php echo esc_url( get_author_posts_url(get_the_author_meta('ID')) ); ?>">
1258 <?php echo esc_html( get_the_author() ) ?>
1259 </a>
1260 </div>
1261 <?php
1262 }
1263
1264 public function render_comments($id = 0) {
1265
1266 if (!$this->get_settings('show_comments')) {
1267 return;
1268 }
1269 ?>
1270
1271 <div class="upk-comments">
1272 <?php echo get_comments_number($id) ?>
1273 <?php echo esc_html_x('Comments', 'Frontend', 'ultimate-post-kit') ?>
1274 </div>
1275
1276 <?php
1277 }
1278
1279 public function render_header() {
1280 $id = 'upk-carbon-slider-' . $this->get_id();
1281 $settings = $this->get_settings_for_display();
1282
1283 $this->add_render_attribute('carbon-slider', 'id', $id);
1284 $this->add_render_attribute('carbon-slider', 'class', ['upk-carbon-main']);
1285
1286 $this->add_render_attribute(
1287 [
1288 'carbon-slider' => [
1289 'data-settings' => [
1290 wp_json_encode(array_filter([
1291 "autoplay" => ("yes" == $settings["autoplay"]) ? ["delay" => $settings["autoplay_speed"]] : false,
1292 "loop" => ($settings["loop"] == "yes") ? true : false,
1293 "speed" => $settings["speed"]["size"],
1294 "effect" => 'fade',
1295 "fadeEffect" => ['crossFade' => true],
1296 "lazy" => true,
1297 "parallax" => true,
1298 "grabCursor" => ($settings["grab_cursor"] === "yes") ? true : false,
1299 "pauseOnHover" => ("yes" == $settings["pauseonhover"]) ? true : false,
1300 "slidesPerView" => 1,
1301 "observer" => ($settings["observer"]) ? true : false,
1302 "observeParents" => ($settings["observer"]) ? true : false,
1303 "loopedSlides" => 4,
1304 "lazy" => [
1305 "loadPrevNext" => "true",
1306 ],
1307 "navigation" => [
1308 "nextEl" => "#$id-wrapper .upk-navigation-next",
1309 "prevEl" => "#$id-wrapper .upk-navigation-prev",
1310 ],
1311 ]))
1312 ]
1313 ]
1314 ]
1315 );
1316
1317 $this->add_render_attribute('swiper', 'class', 'swiper-carousel swiper');
1318
1319 ?>
1320 <div <?php $this->print_render_attribute_string('carbon-slider'); ?>>
1321 <div <?php echo $this->get_render_attribute_string('swiper'); ?>>
1322 <div class="swiper-wrapper">
1323 <?php
1324 }
1325
1326 public function render_footer() {
1327 $settings = $this->get_settings_for_display();
1328
1329 ?>
1330
1331 </div>
1332 </div>
1333 </div>
1334 <?php
1335 }
1336
1337 public function render_post_grid_item($post_id, $image_size, $excerpt_length) {
1338 $settings = $this->get_settings_for_display();
1339
1340 $this->add_render_attribute('slider-item', 'class', 'upk-item swiper-slide', true);
1341
1342 ?>
1343 <div <?php $this->print_render_attribute_string('slider-item'); ?>>
1344 <?php if ($settings['show_image']) : ?>
1345 <div class="upk-image-wrap">
1346 <?php $this->render_image(get_post_thumbnail_id($post_id), $image_size); ?>
1347 </div>
1348 <?php endif; ?>
1349 <div class="upk-content">
1350 <?php if ($settings['show_category']) : ?>
1351 <div class="upk-category-and-comment" data-swiper-parallax-x="-300" data-swiper-parallax-duration="600">
1352 <?php $this->render_category(); ?>
1353 </div>
1354 <?php endif; ?>
1355 <?php if ($settings['show_title']) : ?>
1356 <div data-swiper-parallax-x="-300" data-swiper-parallax-duration="800">
1357 <?php $this->render_title(substr($this->get_name(), 4)); ?>
1358 </div>
1359 <?php endif; ?>
1360
1361 <?php if ($settings['show_author'] or $settings['show_comments'] or $settings['show_reading_time']) : ?>
1362 <div class="upk-meta" data-swiper-parallax-x="-300" data-swiper-parallax-duration="1000">
1363 <?php $this->render_author(); ?>
1364 <?php if (_is_upk_pro_activated()) :
1365 if ('yes' === $settings['show_reading_time']) : ?>
1366 <div class="upk-reading-time" data-separator="<?php echo esc_html($settings['meta_separator']); ?>">
1367 <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'] ) ); ?>
1368 </div>
1369 <?php endif; ?>
1370 <?php endif; ?>
1371
1372 <?php if ($settings['show_comments']) : ?>
1373 <div data-separator="<?php echo esc_html($settings['meta_separator']); ?>">
1374 <?php $this->render_comments($post_id); ?>
1375 </div>
1376 <?php endif; ?>
1377 </div>
1378 <?php endif; ?>
1379
1380 <?php if ($settings['show_excerpt']) : ?>
1381 <div data-swiper-parallax-x="-300" data-swiper-parallax-duration="1200">
1382 <?php $this->render_excerpt($excerpt_length); ?>
1383 </div>
1384 <?php endif; ?>
1385 </div>
1386 </div>
1387
1388 <?php
1389 }
1390
1391 public function render_thumbnav($post_id, $image_size) {
1392 $settings = $this->get_settings_for_display();
1393 $this->add_render_attribute('thumb-item', 'class', 'upk-item swiper-slide', true);
1394 ?>
1395 <div <?php $this->print_render_attribute_string('thumb-item'); ?>>
1396 <?php if ($settings['show_date']) : ?>
1397 <div class="upk-date-wrap upk-flex upk-flex-center">
1398 <?php $this->render_date(); ?>
1399 </div>
1400 <?php endif; ?>
1401 <div class="upk-dot"></div>
1402 </div>
1403 <?php
1404 }
1405
1406 public function render() {
1407 $settings = $this->get_settings_for_display();
1408 $id_wrapper = 'upk-carbon-slider-' . $this->get_id() . '-wrapper';
1409
1410 $this->query_posts($settings['item_limit']['size']);
1411 $wp_query = $this->get_query();
1412
1413 if (!$wp_query->found_posts) {
1414 return;
1415 }
1416
1417 $this->add_render_attribute('swiper-thumbs', 'class', 'upk-carbon-thumbs swiper');
1418
1419 ?>
1420 <div class="upk-carbon-slider-wrap" id="<?php echo esc_html($id_wrapper); ?>">
1421 <?php
1422
1423 $this->render_header();
1424
1425 while ($wp_query->have_posts()) {
1426 $wp_query->the_post();
1427 $thumbnail_size = $settings['primary_thumbnail_size'];
1428
1429 $this->render_post_grid_item(get_the_ID(), $thumbnail_size, $settings['excerpt_length']);
1430 }
1431
1432 $this->render_footer();
1433
1434 ?>
1435 <div thumbsSlider="" <?php $this->print_render_attribute_string('swiper-thumbs'); ?>>
1436 <div class="swiper-wrapper">
1437 <?php
1438
1439 while ($wp_query->have_posts()) {
1440 $wp_query->the_post();
1441 $thumbnail_size = $settings['primary_thumbnail_size'];
1442
1443 $this->render_thumbnav(get_the_ID(), $thumbnail_size);
1444 }
1445
1446 ?>
1447 </div>
1448 <?php if ($settings['show_navigation']) : ?>
1449 <div class="upk-navigation-wrap">
1450 <div class="upk-navigation-button upk-navigation-prev">
1451 <i class="upk-icon-arrow-left-<?php echo esc_html($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i>
1452 </div>
1453 <div class="upk-navigation-button upk-navigation-next">
1454 <i class="upk-icon-arrow-right-<?php echo esc_html($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i>
1455 </div>
1456 </div>
1457 <?php endif; ?>
1458
1459 </div>
1460 </div>
1461 <?php
1462 wp_reset_postdata();
1463 }
1464 }
1465