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

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