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

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