PluginProbe
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets / 4.2.3
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets v4.2.3
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 / paradox-slider / widgets / paradox-slider.php

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

2,445 lines 60.7 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\ParadoxSlider\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
14 use UltimatePostKit\Traits\Global_Widget_Controls;
15 use UltimatePostKit\Traits\Global_Widget_Functions;
16 use UltimatePostKit\Includes\Controls\GroupQuery\Group_Control_Query;
17 use WP_Query;
18
19 if (!defined('ABSPATH')) exit; // Exit if accessed directly
20
21 class Paradox_Slider extends Group_Control_Query {
22
23 use Global_Widget_Controls;
24 use Global_Widget_Functions;
25
26 private $_query = null;
27
28 public function get_name() {
29 return 'upk-paradox-slider';
30 }
31
32 public function get_title() {
33 return BDTUPK . esc_html__('Paradox Slider', 'ultimate-post-kit');
34 }
35
36 public function get_icon() {
37 return 'upk-widget-icon upk-icon-paradox-slider';
38 }
39
40 public function get_categories() {
41 return ['ultimate-post-kit'];
42 }
43
44 public function get_keywords() {
45 return ['post', 'carousel', 'blog', 'recent', 'news', 'slider', 'paradox'];
46 }
47
48 public function get_style_depends() {
49 if ($this->upk_is_edit_mode()) {
50 return ['swiper', 'upk-all-styles'];
51 } else {
52 return ['swiper', 'upk-font', 'upk-paradox-slider'];
53 }
54 }
55
56 public function get_script_depends() {
57 if ( $this->upk_is_edit_mode() ) {
58 return [ 'swiper', 'upk-all-scripts' ];
59 } else {
60 return [ 'swiper', 'upk-paradox-slider' ];
61 }
62 }
63
64 public function get_custom_help_url() {
65 return 'https://youtu.be/2ZYnLz__uA4';
66 }
67
68 public function get_query() {
69 return $this->_query;
70 }
71
72 public function has_widget_inner_wrapper(): bool {
73 return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
74 }
75
76
77 protected function register_controls() {
78 $this->start_controls_section(
79 'section_content_layout',
80 [
81 'label' => esc_html__('Layout', 'ultimate-post-kit'),
82 ]
83 );
84
85 $this->add_responsive_control(
86 'item_height',
87 [
88 'label' => esc_html__('Height', 'ultimate-post-kit'),
89 'type' => Controls_Manager::SLIDER,
90 'size_units' => [ 'px', 'vh' ],
91 'range' => [
92 'px' => [
93 'min' => 200,
94 'max' => 1080,
95 ],
96 'vh' => [
97 'min' => 10,
98 'max' => 100,
99 ],
100 ],
101 'selectors' => [
102 '{{WRAPPER}} .upk-paradox-slider .upk-item' => 'height: {{SIZE}}{{UNIT}};',
103 ],
104 ]
105 );
106
107 $this->add_responsive_control(
108 'content_width',
109 [
110 'label' => esc_html__('Content Max Width', 'ultimate-post-kit'),
111 'type' => Controls_Manager::SLIDER,
112 'range' => [
113 'px' => [
114 'min' => 200,
115 'max' => 1200,
116 ],
117 ],
118 'selectors' => [
119 '{{WRAPPER}} .upk-paradox-slider .upk-content-box' => 'max-width: {{SIZE}}px;',
120 ],
121 ]
122 );
123
124 $this->add_control(
125 'content_alignment',
126 [
127 'label' => __( 'Content Alignment', 'ultimate-post-kit' ),
128 'type' => Controls_Manager::CHOOSE,
129 'options' => [
130 'left' => [
131 'title' => __( 'Left', 'ultimate-post-kit' ),
132 'icon' => 'eicon-text-align-left',
133 ],
134 'center' => [
135 'title' => __( 'Center', 'ultimate-post-kit' ),
136 'icon' => 'eicon-text-align-center',
137 ],
138 'right' => [
139 'title' => __( 'Right', 'ultimate-post-kit' ),
140 'icon' => 'eicon-text-align-right',
141 ],
142 ],
143 'prefix_class' => 'upk-content--',
144 'render_type' => 'template',
145 ]
146 );
147
148 $this->add_group_control(
149 Group_Control_Image_Size::get_type(),
150 [
151 'name' => 'primary_thumbnail',
152 'exclude' => ['custom'],
153 'default' => 'full',
154 ]
155 );
156
157 $this->add_control(
158 'hr_1',
159 [
160 'type' => Controls_Manager::DIVIDER,
161 ]
162 );
163
164 //Global Title Controls
165 $this->register_title_controls();
166 $this->register_text_controls();
167
168 $this->add_control(
169 'show_category',
170 [
171 'label' => esc_html__('Show Category', 'ultimate-post-kit'),
172 'type' => Controls_Manager::SWITCHER,
173 'default' => 'yes',
174 ]
175 );
176
177 $this->add_control(
178 'show_author',
179 [
180 'label' => esc_html__('Show Author', 'ultimate-post-kit'),
181 'type' => Controls_Manager::SWITCHER,
182 'default' => 'yes',
183 ]
184 );
185
186 //Global Date Controls
187 $this->register_date_controls();
188
189 $this->add_control(
190 'meta_separator',
191 [
192 'label' => __('Separator', 'ultimate-post-kit'),
193 'type' => Controls_Manager::TEXT,
194 'default' => '.',
195 'label_block' => false,
196 ]
197 );
198
199 //Global Reading Time Controls
200 $this->register_reading_time_controls();
201
202 $this->add_control(
203 'global_link',
204 [
205 'label' => __('Item Wrapper Link', 'ultimate-post-kit'),
206 'type' => Controls_Manager::SWITCHER,
207 'prefix_class' => 'upk-global-link-',
208 'description' => __('Be aware! When Item Wrapper Link activated then title link and read more link will not work', 'ultimate-post-kit'),
209 'separator' => 'before'
210 ]
211 );
212
213 $this->end_controls_section();
214
215 // Query Settings
216 $this->start_controls_section(
217 'section_post_query_builder',
218 [
219 'label' => __( 'Query', 'ultimate-post-kit' ),
220 'tab' => Controls_Manager::TAB_CONTENT,
221 ]
222 );
223
224 $this->add_control(
225 'item_limit',
226 [
227 'label' => esc_html__('Item Limit', 'ultimate-post-kit'),
228 'type' => Controls_Manager::SLIDER,
229 'range' => [
230 'px' => [
231 'min' => 1,
232 'max' => 20,
233 ],
234 ],
235 'default' => [
236 'size' => 3,
237 ],
238 'condition' => [
239 'posts_source!' => 'current_query',
240 ]
241 ]
242 );
243
244 $this->register_query_builder_controls();
245
246 $this->end_controls_section();
247
248 $this->start_controls_section(
249 'section_content_navigation',
250 [
251 'label' => __( 'Navigation', 'ultimate-post-kit' ),
252 ]
253 );
254
255 $this->add_control(
256 'navigation',
257 [
258 'label' => __( 'Navigation', 'ultimate-post-kit' ),
259 'type' => Controls_Manager::SELECT,
260 'default' => 'both',
261 'options' => [
262 'both' => esc_html__( 'Arrows and Dots', 'ultimate-post-kit' ),
263 'arrows-fraction' => esc_html__( 'Arrows and Fraction', 'ultimate-post-kit' ),
264 'arrows' => esc_html__( 'Arrows', 'ultimate-post-kit' ),
265 'dots' => esc_html__( 'Dots', 'ultimate-post-kit' ),
266 'progressbar' => esc_html__( 'Progress', 'ultimate-post-kit' ),
267 'none' => esc_html__( 'None', 'ultimate-post-kit' ),
268 ],
269 'prefix_class' => 'upk-navigation-type-',
270 'render_type' => 'template',
271 ]
272 );
273
274 $this->add_control(
275 'dynamic_bullets',
276 [
277 'label' => __( 'Dynamic Bullets?', 'ultimate-post-kit' ),
278 'type' => Controls_Manager::SWITCHER,
279 'condition' => [
280 'navigation' => [ 'dots', 'both' ],
281 ],
282 ]
283 );
284
285 $this->add_control(
286 'show_scrollbar',
287 [
288 'label' => __( 'Show Scrollbar?', 'ultimate-post-kit' ),
289 'type' => Controls_Manager::SWITCHER,
290 ]
291 );
292
293 $this->add_control(
294 'both_position',
295 [
296 'label' => __( 'Arrows and Dots Position', 'ultimate-post-kit' ),
297 'type' => Controls_Manager::SELECT,
298 'default' => 'center',
299 'options' => ultimate_post_kit_navigation_position(),
300 'condition' => [
301 'navigation' => 'both',
302 ],
303
304 ]
305 );
306
307 $this->add_control(
308 'arrows_fraction_position',
309 [
310 'label' => __( 'Arrows and Fraction Position', 'ultimate-post-kit' ),
311 'type' => Controls_Manager::SELECT,
312 'default' => 'center',
313 'options' => ultimate_post_kit_navigation_position(),
314 'condition' => [
315 'navigation' => 'arrows-fraction',
316 ],
317
318 ]
319 );
320
321 $this->add_control(
322 'arrows_position',
323 [
324 'label' => __( 'Arrows Position', 'ultimate-post-kit' ),
325 'type' => Controls_Manager::SELECT,
326 'default' => 'center',
327 'options' => ultimate_post_kit_navigation_position(),
328 'condition' => [
329 'navigation' => 'arrows',
330 ],
331
332 ]
333 );
334
335 $this->add_control(
336 'dots_position',
337 [
338 'label' => __( 'Dots Position', 'ultimate-post-kit' ),
339 'type' => Controls_Manager::SELECT,
340 'default' => 'bottom-center',
341 'options' => ultimate_post_kit_pagination_position(),
342 'condition' => [
343 'navigation' => 'dots',
344 ],
345
346 ]
347 );
348
349 $this->add_control(
350 'progress_position',
351 [
352 'label' => __( 'Progress Position', 'ultimate-post-kit' ),
353 'type' => Controls_Manager::SELECT,
354 'default' => 'bottom',
355 'options' => [
356 'bottom' => esc_html__('Bottom', 'ultimate-post-kit'),
357 'top' => esc_html__('Top', 'ultimate-post-kit'),
358 ],
359 'condition' => [
360 'navigation' => 'progressbar',
361 ],
362
363 ]
364 );
365
366 $this->add_control(
367 'nav_arrows_icon',
368 [
369 'label' => esc_html__( 'Arrows Icon', 'ultimate-post-kit' ),
370 'type' => Controls_Manager::SELECT,
371 'default' => '0',
372 'options' => [
373 '0' => esc_html__( 'Default', 'ultimate-post-kit' ),
374 '1' => esc_html__('Style 1', 'ultimate-post-kit'),
375 '2' => esc_html__('Style 2', 'ultimate-post-kit'),
376 '3' => esc_html__('Style 3', 'ultimate-post-kit'),
377 '4' => esc_html__('Style 4', 'ultimate-post-kit'),
378 '5' => esc_html__('Style 5', 'ultimate-post-kit'),
379 '6' => esc_html__('Style 6', 'ultimate-post-kit'),
380 '7' => esc_html__('Style 7', 'ultimate-post-kit'),
381 '8' => esc_html__('Style 8', 'ultimate-post-kit'),
382 '9' => esc_html__('Style 9', 'ultimate-post-kit'),
383 '10' => esc_html__('Style 10', 'ultimate-post-kit'),
384 '11' => esc_html__('Style 11', 'ultimate-post-kit'),
385 '12' => esc_html__('Style 12', 'ultimate-post-kit'),
386 '13' => esc_html__('Style 13', 'ultimate-post-kit'),
387 '14' => esc_html__('Style 14', 'ultimate-post-kit'),
388 '15' => esc_html__('Style 15', 'ultimate-post-kit'),
389 '16' => esc_html__('Style 16', 'ultimate-post-kit'),
390 '17' => esc_html__('Style 17', 'ultimate-post-kit'),
391 '18' => esc_html__('Style 18', 'ultimate-post-kit'),
392 'circle-1' => esc_html__('Style 19', 'ultimate-post-kit'),
393 'circle-2' => esc_html__('Style 20', 'ultimate-post-kit'),
394 'circle-3' => esc_html__('Style 21', 'ultimate-post-kit'),
395 'circle-4' => esc_html__('Style 22', 'ultimate-post-kit'),
396 'square-1' => esc_html__('Style 23', 'ultimate-post-kit'),
397 ],
398 'condition' => [
399 'navigation' => ['arrows-fraction', 'both', 'arrows'],
400 ],
401 ]
402 );
403
404 $this->add_control(
405 'hide_arrow_on_mobile',
406 [
407 'label' => __( 'Hide Arrow on Mobile', 'ultimate-post-kit' ),
408 'type' => Controls_Manager::SWITCHER,
409 'default' => 'yes',
410 'condition' => [
411 'navigation' => [ 'arrows-fraction', 'arrows', 'both' ],
412 ],
413 ]
414 );
415
416 $this->end_controls_section();
417
418 $this->start_controls_section(
419 'section_carousel_settings',
420 [
421 'label' => __( 'Carousel Settings', 'ultimate-post-kit' ),
422 ]
423 );
424
425 $this->add_control(
426 'autoplay',
427 [
428 'label' => __( 'Autoplay', 'ultimate-post-kit' ),
429 'type' => Controls_Manager::SWITCHER,
430 'default' => 'yes',
431
432 ]
433 );
434
435 $this->add_control(
436 'autoplay_speed',
437 [
438 'label' => esc_html__( 'Autoplay Speed', 'ultimate-post-kit' ),
439 'type' => Controls_Manager::NUMBER,
440 'default' => 5000,
441 'condition' => [
442 'autoplay' => 'yes',
443 ],
444 ]
445 );
446
447 $this->add_control(
448 'pauseonhover',
449 [
450 'label' => esc_html__( 'Pause on Hover', 'ultimate-post-kit' ),
451 'type' => Controls_Manager::SWITCHER,
452 'condition' => [
453 'autoplay' => 'yes',
454 ],
455 ]
456 );
457
458 $this->add_control(
459 'grab_cursor',
460 [
461 'label' => __( 'Grab Cursor', 'ultimate-post-kit' ),
462 'type' => Controls_Manager::SWITCHER,
463 ]
464 );
465
466 $this->add_control(
467 'loop',
468 [
469 'label' => __( 'Loop', 'ultimate-post-kit' ),
470 'type' => Controls_Manager::SWITCHER,
471 'default' => 'yes',
472
473 ]
474 );
475
476
477 $this->add_control(
478 'speed',
479 [
480 'label' => __( 'Animation Speed (ms)', 'ultimate-post-kit' ),
481 'type' => Controls_Manager::SLIDER,
482 'default' => [
483 'size' => 500,
484 ],
485 'range' => [
486 'px' => [
487 'min' => 100,
488 'max' => 5000,
489 'step' => 50,
490 ],
491 ],
492 ]
493 );
494
495 $this->add_control(
496 'observer',
497 [
498 'label' => __( 'Observer', 'ultimate-post-kit' ),
499 'description' => __( 'When you use carousel in any hidden place (in tabs, accordion etc) keep it yes.', 'ultimate-post-kit' ),
500 'type' => Controls_Manager::SWITCHER,
501 ]
502 );
503
504 $this->end_controls_section();
505
506 //Style
507 $this->start_controls_section(
508 'upk_section_style',
509 [
510 'label' => esc_html__('Items', 'ultimate-post-kit'),
511 'tab' => Controls_Manager::TAB_STYLE,
512 ]
513 );
514
515 $this->add_control(
516 'item_overlay_color',
517 [
518 'label' => esc_html__('Overlay Color', 'ultimate-post-kit'),
519 'type' => Controls_Manager::COLOR,
520 'selectors' => [
521 '{{WRAPPER}} .upk-paradox-slider .upk-image-wrapper:before' => 'background: {{VALUE}};',
522 ],
523 ]
524 );
525
526 $this->add_responsive_control(
527 'content_padding',
528 [
529 'label' => __('Content Padding', 'ultimate-post-kit'),
530 'type' => Controls_Manager::DIMENSIONS,
531 'size_units' => ['px', 'em', '%'],
532 'selectors' => [
533 '{{WRAPPER}} .upk-paradox-slider .upk-content-box' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
534 ],
535 ]
536 );
537
538 // border
539 $this->add_group_control(
540 Group_Control_Border::get_type(),
541 [
542 'name' => 'slider_item_border',
543 'label' => esc_html__('Border', 'ultimate-post-kit'),
544 'selector' => '{{WRAPPER}} .upk-paradox-slider .upk-item',
545 ]
546 );
547
548 // border radius
549 $this->add_responsive_control(
550 'slider_item_border_radius',
551 [
552 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
553 'type' => Controls_Manager::DIMENSIONS,
554 'size_units' => ['px', 'em', '%'],
555 'selectors' => [
556 '{{WRAPPER}} .upk-paradox-slider .upk-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
557 ],
558 ]
559 );
560
561 $this->end_controls_section();
562
563 $this->start_controls_section(
564 'section_style_title',
565 [
566 'label' => esc_html__('Title', 'ultimate-post-kit'),
567 'tab' => Controls_Manager::TAB_STYLE,
568 'condition' => [
569 'show_title' => 'yes',
570 ],
571 ]
572 );
573
574 $this->add_control(
575 'title_style',
576 [
577 'label' => esc_html__('Style', 'ultimate-post-kit') . BDTUPK_NC,
578 'type' => Controls_Manager::SELECT,
579 'default' => '',
580 'options' => [
581 '' => esc_html__('Default', 'ultimate-post-kit'),
582 'underline' => esc_html__('Underline', 'ultimate-post-kit'),
583 'middle-underline' => esc_html__('Middle Underline', 'ultimate-post-kit'),
584 'overline' => esc_html__('Overline', 'ultimate-post-kit'),
585 'middle-overline' => esc_html__('Middle Overline', 'ultimate-post-kit'),
586 ],
587 ]
588 );
589
590 $this->add_control(
591 'title_color',
592 [
593 'label' => esc_html__('Color', 'ultimate-post-kit'),
594 'type' => Controls_Manager::COLOR,
595 'selectors' => [
596 '{{WRAPPER}} .upk-paradox-slider .upk-title a' => 'color: {{VALUE}};',
597 ],
598 ]
599 );
600
601 $this->add_control(
602 'title_hover_color',
603 [
604 'label' => esc_html__('Hover Color', 'ultimate-post-kit'),
605 'type' => Controls_Manager::COLOR,
606 'selectors' => [
607 '{{WRAPPER}} .upk-paradox-slider .upk-title a:hover' => 'color: {{VALUE}};',
608 ],
609 ]
610 );
611
612 $this->add_responsive_control(
613 'title_spacing',
614 [
615 'label' => esc_html__('Spacing', 'ultimate-post-kit'),
616 'type' => Controls_Manager::SLIDER,
617 'range' => [
618 'px' => [
619 'min' => 0,
620 'max' => 50,
621 ],
622 ],
623 'selectors' => [
624 '{{WRAPPER}} .upk-paradox-slider .upk-title' => 'padding-bottom: {{SIZE}}{{UNIT}};',
625 ],
626 ]
627 );
628
629 $this->add_group_control(
630 Group_Control_Typography::get_type(),
631 [
632 'name' => 'title_typography',
633 'label' => esc_html__('Typography', 'ultimate-post-kit'),
634 'selector' => '{{WRAPPER}} .upk-paradox-slider .upk-title',
635 ]
636 );
637
638 $this->add_group_control(
639 Group_Control_Text_Shadow::get_type(),
640 [
641 'name' => 'title_text_shadow',
642 'label' => __('Text Shadow', 'ultimate-post-kit'),
643 'selector' => '{{WRAPPER}} .upk-paradox-slider .upk-title a',
644 ]
645 );
646
647 $this->add_group_control(
648 Group_Control_Text_Stroke::get_type(),
649 [
650 'name' => 'title_text_stroke',
651 'label' => __('Text Stroke', 'ultimate-post-kit'),
652 'selector' => '{{WRAPPER}} .upk-paradox-slider .upk-title a',
653 ]
654 );
655
656 $this->end_controls_section();
657
658
659 $this->start_controls_section(
660 'section_style_text',
661 [
662 'label' => esc_html__('Text', 'ultimate-post-kit'),
663 'tab' => Controls_Manager::TAB_STYLE,
664 'condition' => [
665 'show_excerpt' => 'yes',
666 ],
667 ]
668 );
669
670 $this->add_control(
671 'text_color',
672 [
673 'label' => esc_html__('Color', 'ultimate-post-kit'),
674 'type' => Controls_Manager::COLOR,
675 'selectors' => [
676 '{{WRAPPER}} .upk-paradox-slider .upk-text' => 'color: {{VALUE}};',
677 ],
678 ]
679 );
680
681
682 $this->add_responsive_control(
683 'text_spacing',
684 [
685 'label' => esc_html__('Spacing', 'ultimate-post-kit'),
686 'type' => Controls_Manager::SLIDER,
687 'range' => [
688 'px' => [
689 'min' => 0,
690 'max' => 50,
691 ],
692 ],
693 'selectors' => [
694 '{{WRAPPER}} .upk-paradox-slider .upk-text' => 'padding-bottom: {{SIZE}}{{UNIT}};',
695 ],
696 ]
697 );
698
699 $this->add_group_control(
700 Group_Control_Typography::get_type(),
701 [
702 'name' => 'text_typography',
703 'label' => esc_html__('Typography', 'ultimate-post-kit'),
704 'selector' => '{{WRAPPER}} .upk-paradox-slider .upk-text',
705 ]
706 );
707
708 $this->end_controls_section();
709
710 $this->start_controls_section(
711 'section_style_author',
712 [
713 'label' => esc_html__('Author', 'ultimate-post-kit'),
714 'tab' => Controls_Manager::TAB_STYLE,
715 'condition' => [
716 'show_author' => 'yes',
717 ],
718 ]
719 );
720
721 $this->add_responsive_control(
722 'author_avatar_size',
723 [
724 'label' => esc_html__('Avatar Size', 'ultimate-post-kit'),
725 'type' => Controls_Manager::SLIDER,
726 'range' => [
727 'px' => [
728 'min' => 20,
729 'max' => 100,
730 ],
731 ],
732 'selectors' => [
733 '{{WRAPPER}} .upk-paradox-slider .upk-author-image img' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}};',
734 ],
735 ]
736 );
737
738 $this->add_control(
739 'author_color',
740 [
741 'label' => esc_html__('Text Color', 'ultimate-post-kit'),
742 'type' => Controls_Manager::COLOR,
743 'selectors' => [
744 '{{WRAPPER}} .upk-paradox-slider .upk-author-name a, {{WRAPPER}} .upk-paradox-slider .upk-author-role' => 'color: {{VALUE}};',
745 ],
746 ]
747 );
748
749 $this->add_responsive_control(
750 'author_spacing',
751 [
752 'label' => esc_html__('Spacing', 'ultimate-post-kit'),
753 'type' => Controls_Manager::SLIDER,
754 'range' => [
755 'px' => [
756 'min' => 0,
757 'max' => 50,
758 ],
759 ],
760 'selectors' => [
761 '{{WRAPPER}} .upk-paradox-slider .upk-author-image img' => 'margin-right: {{SIZE}}{{UNIT}};',
762 ],
763 ]
764 );
765
766 $this->add_group_control(
767 Group_Control_Typography::get_type(),
768 [
769 'name' => 'author_name_typography',
770 'label' => esc_html__('Name Typography', 'ultimate-post-kit'),
771 'selector' => '{{WRAPPER}} .upk-paradox-slider .upk-author-name a',
772 ]
773 );
774
775 $this->add_group_control(
776 Group_Control_Typography::get_type(),
777 [
778 'name' => 'author_role_typography',
779 'label' => esc_html__('Role Typography', 'ultimate-post-kit'),
780 'selector' => '{{WRAPPER}} .upk-paradox-slider .upk-author-role',
781 ]
782 );
783
784 $this->end_controls_section();
785
786 $this->start_controls_section(
787 'section_style_date',
788 [
789 'label' => esc_html__('Meta', 'ultimate-post-kit'),
790 'tab' => Controls_Manager::TAB_STYLE,
791 'conditions' => [
792 'relation' => 'or',
793 'terms' => [
794 [
795 'name' => 'show_date',
796 'value' => 'yes'
797 ],
798 [
799 'name' => 'show_reading_time',
800 'value' => 'yes'
801 ]
802 ]
803 ],
804 ]
805 );
806
807 $this->add_control(
808 'date_color',
809 [
810 'label' => esc_html__('Color', 'ultimate-post-kit'),
811 'type' => Controls_Manager::COLOR,
812 'selectors' => [
813 '{{WRAPPER}} .upk-paradox-slider .upk-meta' => 'color: {{VALUE}};',
814 ],
815 ]
816 );
817
818 $this->add_responsive_control(
819 'date_spacing',
820 [
821 'label' => esc_html__('Left Spacing', 'ultimate-post-kit'),
822 'type' => Controls_Manager::SLIDER,
823 'range' => [
824 'px' => [
825 'min' => 0,
826 'max' => 50,
827 'step' => 2,
828 ],
829 ],
830 'selectors' => [
831 '{{WRAPPER}} .upk-paradox-slider .upk-meta' => 'padding-left: {{SIZE}}{{UNIT}};',
832 ],
833 ]
834 );
835 $this->add_responsive_control(
836 'meta_space_between',
837 [
838 'label' => esc_html__('Space Between', 'ultimate-post-kit'),
839 'type' => Controls_Manager::SLIDER,
840 'range' => [
841 'px' => [
842 'min' => 0,
843 'max' => 50,
844 ],
845 ],
846 'selectors' => [
847 '{{WRAPPER}} .upk-paradox-slider .upk-meta > div:before' => 'margin: 0 {{SIZE}}{{UNIT}};',
848 ],
849 ]
850 );
851
852 $this->add_group_control(
853 Group_Control_Typography::get_type(),
854 [
855 'name' => 'date_typography',
856 'label' => esc_html__('Typography', 'ultimate-post-kit'),
857 'selector' => '{{WRAPPER}} .upk-paradox-slider .upk-meta',
858 ]
859 );
860
861 $this->end_controls_section();
862
863 $this->start_controls_section(
864 'section_style_category',
865 [
866 'label' => esc_html__('Category', 'ultimate-post-kit'),
867 'tab' => Controls_Manager::TAB_STYLE,
868 'condition' => [
869 'show_category' => 'yes'
870 ],
871 ]
872 );
873
874 $this->add_responsive_control(
875 'category_bottom_spacing',
876 [
877 'label' => esc_html__('Spacing', 'ultimate-post-kit'),
878 'type' => Controls_Manager::SLIDER,
879 'range' => [
880 'px' => [
881 'min' => 0,
882 'max' => 50,
883 'step' => 2,
884 ],
885 ],
886 'selectors' => [
887 '{{WRAPPER}} .upk-paradox-slider .upk-category-date-wrap' => 'padding-bottom: {{SIZE}}{{UNIT}};',
888 ],
889 ]
890 );
891
892 $this->start_controls_tabs('tabs_category_style');
893
894 $this->start_controls_tab(
895 'tab_category_normal',
896 [
897 'label' => esc_html__('Normal', 'ultimate-post-kit'),
898 ]
899 );
900
901 $this->add_control(
902 'category_color',
903 [
904 'label' => esc_html__('Color', 'ultimate-post-kit'),
905 'type' => Controls_Manager::COLOR,
906 'selectors' => [
907 '{{WRAPPER}} .upk-paradox-slider .upk-category a' => 'color: {{VALUE}};',
908 ],
909 ]
910 );
911
912 $this->add_group_control(
913 Group_Control_Background::get_type(),
914 [
915 'name' => 'category_background',
916 'selector' => '{{WRAPPER}} .upk-paradox-slider .upk-category a',
917 ]
918 );
919
920 $this->add_group_control(
921 Group_Control_Border::get_type(),
922 [
923 'name' => 'category_border',
924 'selector' => '{{WRAPPER}} .upk-paradox-slider .upk-category a',
925 ]
926 );
927
928 $this->add_responsive_control(
929 'category_border_radius',
930 [
931 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
932 'type' => Controls_Manager::DIMENSIONS,
933 'size_units' => ['px', '%'],
934 'selectors' => [
935 '{{WRAPPER}} .upk-paradox-slider .upk-category a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
936 ],
937 ]
938 );
939
940 $this->add_responsive_control(
941 'category_padding',
942 [
943 'label' => esc_html__('Padding', 'ultimate-post-kit'),
944 'type' => Controls_Manager::DIMENSIONS,
945 'size_units' => ['px', 'em', '%'],
946 'selectors' => [
947 '{{WRAPPER}} .upk-paradox-slider .upk-category a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
948 ],
949 ]
950 );
951
952 $this->add_responsive_control(
953 'category_spacing',
954 [
955 'label' => esc_html__('Spacing', 'ultimate-post-kit'),
956 'type' => Controls_Manager::SLIDER,
957 'range' => [
958 'px' => [
959 'min' => 0,
960 'max' => 50,
961 'step' => 2,
962 ],
963 ],
964 'selectors' => [
965 '{{WRAPPER}} .upk-paradox-slider .upk-category a+a' => 'margin-left: {{SIZE}}{{UNIT}};',
966 ],
967 ]
968 );
969
970 $this->add_group_control(
971 Group_Control_Box_Shadow::get_type(),
972 [
973 'name' => 'category_shadow',
974 'selector' => '{{WRAPPER}} .upk-paradox-slider .upk-category a',
975 ]
976 );
977
978 $this->add_group_control(
979 Group_Control_Typography::get_type(),
980 [
981 'name' => 'category_typography',
982 'label' => esc_html__('Typography', 'ultimate-post-kit'),
983 'selector' => '{{WRAPPER}} .upk-paradox-slider .upk-category a',
984 ]
985 );
986
987 $this->end_controls_tab();
988
989 $this->start_controls_tab(
990 'tab_category_hover',
991 [
992 'label' => esc_html__('Hover', 'ultimate-post-kit'),
993 'condition' => [
994 'show_category' => 'yes'
995 ]
996 ]
997 );
998
999 $this->add_control(
1000 'category_hover_color',
1001 [
1002 'label' => esc_html__('Color', 'ultimate-post-kit'),
1003 'type' => Controls_Manager::COLOR,
1004 'selectors' => [
1005 '{{WRAPPER}} .upk-paradox-slider .upk-category a:hover' => 'color: {{VALUE}};',
1006 ],
1007 ]
1008 );
1009
1010 $this->add_group_control(
1011 Group_Control_Background::get_type(),
1012 [
1013 'name' => 'category_hover_background',
1014 'selector' => '{{WRAPPER}} .upk-paradox-slider .upk-category a:hover',
1015 ]
1016 );
1017
1018 $this->add_control(
1019 'category_hover_border_color',
1020 [
1021 'label' => esc_html__('Border Color', 'ultimate-post-kit'),
1022 'type' => Controls_Manager::COLOR,
1023 'condition' => [
1024 'category_border_border!' => '',
1025 ],
1026 'selectors' => [
1027 '{{WRAPPER}} .upk-paradox-slider .upk-category a:hover' => 'border-color: {{VALUE}};',
1028 ],
1029 ]
1030 );
1031
1032 $this->end_controls_tab();
1033
1034 $this->end_controls_tabs();
1035
1036 $this->end_controls_section();
1037
1038 //Navigation Css
1039 $this->start_controls_section(
1040 'section_style_navigation',
1041 [
1042 'label' => __( 'Navigation', 'ultimate-post-kit' ),
1043 'tab' => Controls_Manager::TAB_STYLE,
1044 'conditions' => [
1045 'relation' => 'or',
1046 'terms' => [
1047 [
1048 'name' => 'navigation',
1049 'operator' => '!=',
1050 'value' => 'none',
1051 ],
1052 [
1053 'name' => 'show_scrollbar',
1054 'value' => 'yes',
1055 ],
1056 ],
1057 ],
1058 ]
1059 );
1060
1061 $this->add_control(
1062 'arrows_heading',
1063 [
1064 'label' => __( 'Arrows', 'ultimate-post-kit' ),
1065 'type' => Controls_Manager::HEADING,
1066 'condition' => [
1067 'navigation!' => [ 'dots', 'progressbar', 'none' ],
1068 ],
1069 ]
1070 );
1071
1072 $this->start_controls_tabs( 'tabs_navigation_arrows_style' );
1073
1074 $this->start_controls_tab(
1075 'tabs_nav_arrows_normal',
1076 [
1077 'label' => __( 'Normal', 'ultimate-post-kit' ),
1078 'condition' => [
1079 'navigation!' => [ 'dots', 'progressbar', 'none' ],
1080 ],
1081 ]
1082 );
1083
1084 $this->add_control(
1085 'arrows_color',
1086 [
1087 'label' => __( 'Color', 'ultimate-post-kit' ),
1088 'type' => Controls_Manager::COLOR,
1089 'selectors' => [
1090 '{{WRAPPER}} .upk-paradox-slider .upk-navigation-prev i, {{WRAPPER}} .upk-paradox-slider .upk-navigation-next i' => 'color: {{VALUE}}',
1091 ],
1092 'condition' => [
1093 'navigation!' => [ 'dots', 'progressbar', 'none' ],
1094 ],
1095 ]
1096 );
1097
1098 $this->add_control(
1099 'arrows_background',
1100 [
1101 'label' => __( 'Background', 'ultimate-post-kit' ),
1102 'type' => Controls_Manager::COLOR,
1103 'selectors' => [
1104 '{{WRAPPER}} .upk-paradox-slider .upk-navigation-prev, {{WRAPPER}} .upk-paradox-slider .upk-navigation-next' => 'background-color: {{VALUE}}',
1105 ],
1106 'condition' => [
1107 'navigation!' => [ 'dots', 'progressbar', 'none' ],
1108 ],
1109 ]
1110 );
1111
1112 $this->add_group_control(
1113 Group_Control_Border::get_type(),
1114 [
1115 'name' => 'nav_arrows_border',
1116 'selector' => '{{WRAPPER}} .upk-paradox-slider .upk-navigation-prev, {{WRAPPER}} .upk-paradox-slider .upk-navigation-next',
1117 'condition' => [
1118 'navigation!' => [ 'dots', 'progressbar', 'none' ],
1119 ],
1120 ]
1121 );
1122
1123 $this->add_control(
1124 'border_radius',
1125 [
1126 'label' => __( 'Border Radius', 'ultimate-post-kit' ),
1127 'type' => Controls_Manager::DIMENSIONS,
1128 'size_units' => [ 'px', '%' ],
1129 'selectors' => [
1130 '{{WRAPPER}} .upk-paradox-slider .upk-navigation-prev, {{WRAPPER}} .upk-paradox-slider .upk-navigation-next' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1131 ],
1132 'condition' => [
1133 'navigation!' => [ 'dots', 'progressbar', 'none' ],
1134 ],
1135 ]
1136 );
1137
1138 $this->add_responsive_control(
1139 'arrows_padding',
1140 [
1141 'label' => esc_html__( 'Padding', 'ultimate-post-kit' ),
1142 'type' => Controls_Manager::DIMENSIONS,
1143 'size_units' => [ 'px', 'em', '%' ],
1144 'selectors' => [
1145 '{{WRAPPER}} .upk-paradox-slider .upk-navigation-prev, {{WRAPPER}} .upk-paradox-slider .upk-navigation-next' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1146 ],
1147 'condition' => [
1148 'navigation!' => [ 'dots', 'progressbar', 'none' ],
1149 ],
1150 ]
1151 );
1152
1153 $this->add_control(
1154 'arrows_size',
1155 [
1156 'label' => __( 'Size', 'ultimate-post-kit' ),
1157 'type' => Controls_Manager::SLIDER,
1158 'range' => [
1159 'px' => [
1160 'min' => 10,
1161 'max' => 100,
1162 ],
1163 ],
1164 'selectors' => [
1165 '{{WRAPPER}} .upk-paradox-slider .upk-navigation-prev i,
1166 {{WRAPPER}} .upk-paradox-slider .upk-navigation-next i' => 'font-size: {{SIZE || 18}}{{UNIT}};',
1167 ],
1168 'condition' => [
1169 'navigation!' => [ 'dots', 'progressbar', 'none' ],
1170 ],
1171 ]
1172 );
1173
1174 $this->add_control(
1175 'arrows_space',
1176 [
1177 'label' => __( 'Space Between Arrows', 'ultimate-post-kit' ),
1178 'type' => Controls_Manager::SLIDER,
1179 'range' => [
1180 'px' => [
1181 'min' => 0,
1182 'max' => 100,
1183 ],
1184 ],
1185 'selectors' => [
1186 '{{WRAPPER}} .upk-paradox-slider .upk-navigation-prev' => 'margin-right: {{SIZE}}px;',
1187 '{{WRAPPER}} .upk-paradox-slider .upk-navigation-next' => 'margin-left: {{SIZE}}px;',
1188 ],
1189 'condition' => [
1190 'navigation!' => [ 'dots', 'progressbar', 'none' ],
1191 ],
1192 ]
1193 );
1194
1195 $this->end_controls_tab();
1196
1197 $this->start_controls_tab(
1198 'tabs_nav_arrows_hover',
1199 [
1200 'label' => __( 'Hover', 'ultimate-post-kit' ),
1201 'condition' => [
1202 'navigation!' => [ 'dots', 'progressbar', 'none' ],
1203 ],
1204 ]
1205 );
1206
1207 $this->add_control(
1208 'arrows_hover_color',
1209 [
1210 'label' => __( 'Color', 'ultimate-post-kit' ),
1211 'type' => Controls_Manager::COLOR,
1212 'selectors' => [
1213 '{{WRAPPER}} .upk-paradox-slider .upk-navigation-prev:hover i, {{WRAPPER}} .upk-paradox-slider .upk-navigation-next:hover i' => 'color: {{VALUE}}',
1214 ],
1215 'condition' => [
1216 'navigation!' => [ 'dots', 'progressbar', 'none' ],
1217 ],
1218 ]
1219 );
1220
1221 $this->add_control(
1222 'arrows_hover_background',
1223 [
1224 'label' => __( 'Background', 'ultimate-post-kit' ),
1225 'type' => Controls_Manager::COLOR,
1226 'selectors' => [
1227 '{{WRAPPER}} .upk-paradox-slider .upk-navigation-prev:hover, {{WRAPPER}} .upk-paradox-slider .upk-navigation-next:hover' => 'background-color: {{VALUE}}',
1228 ],
1229 'condition' => [
1230 'navigation!' => [ 'dots', 'progressbar', 'none' ],
1231 ],
1232 ]
1233 );
1234
1235 $this->add_control(
1236 'nav_arrows_hover_border_color',
1237 [
1238 'label' => __( 'Border Color', 'ultimate-post-kit' ),
1239 'type' => Controls_Manager::COLOR,
1240 'selectors' => [
1241 '{{WRAPPER}} .upk-paradox-slider .upk-navigation-prev:hover, {{WRAPPER}} .upk-paradox-slider .upk-navigation-next:hover' => 'border-color: {{VALUE}};',
1242 ],
1243 'condition' => [
1244 'nav_arrows_border_border!' => '',
1245 'navigation!' => [ 'dots', 'progressbar', 'none' ],
1246 ],
1247 ]
1248 );
1249
1250 $this->end_controls_tab();
1251
1252 $this->end_controls_tabs();
1253
1254 $this->add_control(
1255 'hr_2',
1256 [
1257 'type' => Controls_Manager::DIVIDER,
1258 'condition' => [
1259 'navigation!' => [ 'arrows', 'arrows-fraction', 'progressbar', 'none' ],
1260 ],
1261 ]
1262 );
1263
1264 $this->add_control(
1265 'dots_heading',
1266 [
1267 'label' => __( 'Dots', 'ultimate-post-kit' ),
1268 'type' => Controls_Manager::HEADING,
1269 'condition' => [
1270 'navigation!' => [ 'arrows', 'arrows-fraction', 'progressbar', 'none' ],
1271 ],
1272 ]
1273 );
1274
1275 $this->add_control(
1276 'hr_11',
1277 [
1278 'type' => Controls_Manager::DIVIDER,
1279 'condition' => [
1280 'navigation!' => [ 'arrows', 'arrows-fraction', 'progressbar', 'none' ],
1281 ],
1282 ]
1283 );
1284
1285 $this->add_control(
1286 'dots_color',
1287 [
1288 'label' => __( 'Color', 'ultimate-post-kit' ),
1289 'type' => Controls_Manager::COLOR,
1290 'selectors' => [
1291 '{{WRAPPER}} .upk-paradox-slider .swiper-pagination-bullet' => 'background-color: {{VALUE}}',
1292 ],
1293 'condition' => [
1294 'navigation!' => [ 'arrows', 'arrows-fraction', 'progressbar', 'none' ],
1295 ],
1296 ]
1297 );
1298
1299 $this->add_control(
1300 'active_dot_color',
1301 [
1302 'label' => __( 'Active Color', 'ultimate-post-kit' ),
1303 'type' => Controls_Manager::COLOR,
1304 'selectors' => [
1305 '{{WRAPPER}} .upk-paradox-slider .swiper-pagination-bullet-active' => 'background-color: {{VALUE}}',
1306 ],
1307 'condition' => [
1308 'navigation!' => [ 'arrows', 'arrows-fraction', 'progressbar', 'none' ],
1309 ],
1310 ]
1311 );
1312
1313
1314 $this->add_responsive_control(
1315 'dots_border_radius',
1316 [
1317 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
1318 'type' => Controls_Manager::DIMENSIONS,
1319 'size_units' => ['px', '%'],
1320 'selectors' => [
1321 '{{WRAPPER}} .upk-paradox-slider .swiper-pagination-bullet' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1322 ],
1323 ]
1324 );
1325
1326 $this->add_responsive_control(
1327 'dots_height_size',
1328 [
1329 'label' => __( 'Height(px)', 'ultimate-post-kit' ),
1330 'type' => Controls_Manager::SLIDER,
1331 'range' => [
1332 'px' => [
1333 'min' => 5,
1334 'max' => 20,
1335 ],
1336 ],
1337 'selectors' => [
1338 '{{WRAPPER}} .upk-paradox-slider .swiper-pagination-bullet' => 'height: {{SIZE}}{{UNIT}};',
1339 ],
1340 'condition' => [
1341 'navigation!' => [ 'arrows', 'arrows-fraction', 'progressbar', 'none' ],
1342 ],
1343 ]
1344 );
1345
1346 $this->add_responsive_control(
1347 'dots_width_size',
1348 [
1349 'label' => __( 'Width(px)', 'ultimate-post-kit' ),
1350 'type' => Controls_Manager::SLIDER,
1351 'range' => [
1352 'px' => [
1353 'min' => 5,
1354 'max' => 20,
1355 ],
1356 ],
1357 'selectors' => [
1358 '{{WRAPPER}} .upk-paradox-slider .swiper-pagination-bullet' => 'width: {{SIZE}}{{UNIT}};',
1359 ],
1360 'condition' => [
1361 'navigation!' => [ 'arrows', 'arrows-fraction', 'progressbar', 'none' ],
1362 ],
1363 ]
1364 );
1365
1366 $this->add_control(
1367 'hr_22',
1368 [
1369 'type' => Controls_Manager::DIVIDER,
1370 'condition' => [
1371 'navigation' => 'arrows-fraction',
1372 ],
1373 ]
1374 );
1375
1376 $this->add_control(
1377 'fraction_heading',
1378 [
1379 'label' => __( 'Fraction', 'ultimate-post-kit' ),
1380 'type' => Controls_Manager::HEADING,
1381 'condition' => [
1382 'navigation' => 'arrows-fraction',
1383 ],
1384 ]
1385 );
1386
1387 $this->add_control(
1388 'hr_12',
1389 [
1390 'type' => Controls_Manager::DIVIDER,
1391 'condition' => [
1392 'navigation' => 'arrows-fraction',
1393 ],
1394 ]
1395 );
1396
1397 $this->add_control(
1398 'fraction_color',
1399 [
1400 'label' => __( 'Color', 'ultimate-post-kit' ),
1401 'type' => Controls_Manager::COLOR,
1402 'selectors' => [
1403 '{{WRAPPER}} .upk-paradox-slider .swiper-pagination-fraction' => 'color: {{VALUE}}',
1404 ],
1405 'condition' => [
1406 'navigation' => 'arrows-fraction',
1407 ],
1408 ]
1409 );
1410
1411 $this->add_control(
1412 'active_fraction_color',
1413 [
1414 'label' => __( 'Active Color', 'ultimate-post-kit' ),
1415 'type' => Controls_Manager::COLOR,
1416 'selectors' => [
1417 '{{WRAPPER}} .upk-paradox-slider .swiper-pagination-current' => 'color: {{VALUE}}',
1418 ],
1419 'condition' => [
1420 'navigation' => 'arrows-fraction',
1421 ],
1422 ]
1423 );
1424
1425 $this->add_group_control(
1426 Group_Control_Typography::get_type(),
1427 [
1428 'name' => 'fraction_typography',
1429 'label' => esc_html__( 'Typography', 'ultimate-post-kit' ),
1430 //'scheme' => Schemes\Typography::TYPOGRAPHY_4,
1431 'selector' => '{{WRAPPER}} .upk-paradox-slider .swiper-pagination-fraction',
1432 'condition' => [
1433 'navigation' => 'arrows-fraction',
1434 ],
1435 ]
1436 );
1437
1438 $this->add_control(
1439 'hr_3',
1440 [
1441 'type' => Controls_Manager::DIVIDER,
1442 'condition' => [
1443 'navigation' => 'progressbar',
1444 ],
1445 ]
1446 );
1447
1448 $this->add_control(
1449 'progresbar_heading',
1450 [
1451 'label' => __( 'Progresbar', 'ultimate-post-kit' ),
1452 'type' => Controls_Manager::HEADING,
1453 'condition' => [
1454 'navigation' => 'progressbar',
1455 ],
1456 ]
1457 );
1458
1459 $this->add_control(
1460 'hr_13',
1461 [
1462 'type' => Controls_Manager::DIVIDER,
1463 'condition' => [
1464 'navigation' => 'progressbar',
1465 ],
1466 ]
1467 );
1468
1469 $this->add_control(
1470 'progresbar_color',
1471 [
1472 'label' => __( 'Bar Color', 'ultimate-post-kit' ),
1473 'type' => Controls_Manager::COLOR,
1474 'selectors' => [
1475 '{{WRAPPER}} .upk-paradox-slider .swiper-pagination-progressbar' => 'background-color: {{VALUE}}',
1476 ],
1477 'condition' => [
1478 'navigation' => 'progressbar',
1479 ],
1480 ]
1481 );
1482
1483 $this->add_control(
1484 'progres_color',
1485 [
1486 'label' => __( 'Progress Color', 'ultimate-post-kit' ),
1487 'type' => Controls_Manager::COLOR,
1488 'separator' => 'after',
1489 'selectors' => [
1490 '{{WRAPPER}} .upk-paradox-slider .swiper-pagination-progressbar .swiper-pagination-progressbar-fill' => 'background: {{VALUE}}',
1491 ],
1492 'condition' => [
1493 'navigation' => 'progressbar',
1494 ],
1495 ]
1496 );
1497
1498 $this->add_control(
1499 'hr_4',
1500 [
1501 'type' => Controls_Manager::DIVIDER,
1502 'condition' => [
1503 'show_scrollbar' => 'yes'
1504 ],
1505 ]
1506 );
1507
1508 $this->add_control(
1509 'scrollbar_heading',
1510 [
1511 'label' => __( 'Scrollbar', 'ultimate-post-kit' ),
1512 'type' => Controls_Manager::HEADING,
1513 'condition' => [
1514 'show_scrollbar' => 'yes'
1515 ],
1516 ]
1517 );
1518
1519 $this->add_control(
1520 'hr_14',
1521 [
1522 'type' => Controls_Manager::DIVIDER,
1523 'condition' => [
1524 'show_scrollbar' => 'yes'
1525 ],
1526 ]
1527 );
1528
1529 $this->add_control(
1530 'scrollbar_color',
1531 [
1532 'label' => __( 'Bar Color', 'ultimate-post-kit' ),
1533 'type' => Controls_Manager::COLOR,
1534 'selectors' => [
1535 '{{WRAPPER}} .upk-paradox-slider .swiper-scrollbar' => 'background: {{VALUE}}',
1536 ],
1537 'condition' => [
1538 'show_scrollbar' => 'yes'
1539 ],
1540 ]
1541 );
1542
1543 $this->add_control(
1544 'scrollbar_drag_color',
1545 [
1546 'label' => __( 'Drag Color', 'ultimate-post-kit' ),
1547 'type' => Controls_Manager::COLOR,
1548 'selectors' => [
1549 '{{WRAPPER}} .upk-paradox-slider .swiper-scrollbar .swiper-scrollbar-drag' => 'background: {{VALUE}}',
1550 ],
1551 'condition' => [
1552 'show_scrollbar' => 'yes'
1553 ],
1554 ]
1555 );
1556
1557 $this->add_control(
1558 'scrollbar_height',
1559 [
1560 'label' => __( 'Height', 'ultimate-post-kit' ),
1561 'type' => Controls_Manager::SLIDER,
1562 'range' => [
1563 'px' => [
1564 'min' => 1,
1565 'max' => 10,
1566 ],
1567 ],
1568 'selectors' => [
1569 '{{WRAPPER}} .upk-paradox-slider .swiper-horizontal > .swiper-scrollbar' => 'height: {{SIZE}}px;',
1570 ],
1571 'condition' => [
1572 'show_scrollbar' => 'yes'
1573 ],
1574 ]
1575 );
1576
1577 $this->add_control(
1578 'hr_05',
1579 [
1580 'type' => Controls_Manager::DIVIDER,
1581 ]
1582 );
1583
1584 $this->add_control(
1585 'navi_offset_heading',
1586 [
1587 'label' => __( 'Offset', 'ultimate-post-kit' ),
1588 'type' => Controls_Manager::HEADING,
1589 ]
1590 );
1591
1592 $this->add_control(
1593 'hr_6',
1594 [
1595 'type' => Controls_Manager::DIVIDER,
1596 ]
1597 );
1598
1599 $this->add_responsive_control(
1600 'arrows_ncx_position',
1601 [
1602 'label' => __( 'Arrows Horizontal Offset', 'ultimate-post-kit' ),
1603 'type' => Controls_Manager::SLIDER,
1604 'default' => [
1605 'size' => 0,
1606 ],
1607 'tablet_default' => [
1608 'size' => 0,
1609 ],
1610 'mobile_default' => [
1611 'size' => 0,
1612 ],
1613 'range' => [
1614 'px' => [
1615 'min' => -200,
1616 'max' => 200,
1617 ],
1618 ],
1619 'conditions' => [
1620 'terms' => [
1621 [
1622 'name' => 'navigation',
1623 'value' => 'arrows',
1624 ],
1625 [
1626 'name' => 'arrows_position',
1627 'operator' => '!=',
1628 'value' => 'center',
1629 ],
1630 ],
1631 ],
1632 'selectors' => [
1633 '{{WRAPPER}}' => '--upk-swiper-carousel-arrows-ncx: {{SIZE}}px;'
1634 ],
1635 ]
1636 );
1637
1638 $this->add_responsive_control(
1639 'arrows_ncy_position',
1640 [
1641 'label' => __( 'Arrows Vertical Offset', 'ultimate-post-kit' ),
1642 'type' => Controls_Manager::SLIDER,
1643 'default' => [
1644 'size' => 40,
1645 ],
1646 'tablet_default' => [
1647 'size' => 40,
1648 ],
1649 'mobile_default' => [
1650 'size' => 40,
1651 ],
1652 'range' => [
1653 'px' => [
1654 'min' => -200,
1655 'max' => 200,
1656 ],
1657 ],
1658 'selectors' => [
1659 '{{WRAPPER}}' => '--upk-swiper-carousel-arrows-ncy: {{SIZE}}px;'
1660 ],
1661 'conditions' => [
1662 'terms' => [
1663 [
1664 'name' => 'navigation',
1665 'value' => 'arrows',
1666 ],
1667 [
1668 'name' => 'arrows_position',
1669 'operator' => '!=',
1670 'value' => 'center',
1671 ],
1672 ],
1673 ],
1674 ]
1675 );
1676
1677 $this->add_responsive_control(
1678 'arrows_acx_position',
1679 [
1680 'label' => __( 'Arrows Horizontal Offset', 'ultimate-post-kit' ),
1681 'type' => Controls_Manager::SLIDER,
1682 'default' => [
1683 'size' => 60,
1684 ],
1685 'range' => [
1686 'px' => [
1687 'min' => -200,
1688 'max' => 200,
1689 ],
1690 ],
1691 'selectors' => [
1692 '{{WRAPPER}} .upk-paradox-slider .upk-navigation-prev' => 'left: {{SIZE}}px;',
1693 '{{WRAPPER}} .upk-paradox-slider .upk-navigation-next' => 'right: {{SIZE}}px;',
1694 ],
1695 'conditions' => [
1696 'terms' => [
1697 [
1698 'name' => 'navigation',
1699 'value' => 'arrows',
1700 ],
1701 [
1702 'name' => 'arrows_position',
1703 'value' => 'center',
1704 ],
1705 ],
1706 ],
1707 ]
1708 );
1709
1710 $this->add_responsive_control(
1711 'dots_nnx_position',
1712 [
1713 'label' => __( 'Dots Horizontal Offset', 'ultimate-post-kit' ),
1714 'type' => Controls_Manager::SLIDER,
1715 'default' => [
1716 'size' => 0,
1717 ],
1718 'tablet_default' => [
1719 'size' => 0,
1720 ],
1721 'mobile_default' => [
1722 'size' => 0,
1723 ],
1724 'range' => [
1725 'px' => [
1726 'min' => -200,
1727 'max' => 200,
1728 ],
1729 ],
1730 'conditions' => [
1731 'terms' => [
1732 [
1733 'name' => 'navigation',
1734 'value' => 'dots',
1735 ],
1736 [
1737 'name' => 'dots_position',
1738 'operator' => '!=',
1739 'value' => '',
1740 ],
1741 ],
1742 ],
1743 'selectors' => [
1744 '{{WRAPPER}}' => '--upk-swiper-carousel-dots-nnx: {{SIZE}}px;'
1745 ],
1746 ]
1747 );
1748
1749 $this->add_responsive_control(
1750 'dots_nny_position',
1751 [
1752 'label' => __( 'Dots Vertical Offset', 'ultimate-post-kit' ),
1753 'type' => Controls_Manager::SLIDER,
1754 'default' => [
1755 'size' => -60,
1756 ],
1757 'tablet_default' => [
1758 'size' => -60,
1759 ],
1760 'mobile_default' => [
1761 'size' => -60,
1762 ],
1763 'range' => [
1764 'px' => [
1765 'min' => -200,
1766 'max' => 200,
1767 ],
1768 ],
1769 'conditions' => [
1770 'terms' => [
1771 [
1772 'name' => 'navigation',
1773 'value' => 'dots',
1774 ],
1775 [
1776 'name' => 'dots_position',
1777 'operator' => '!=',
1778 'value' => '',
1779 ],
1780 ],
1781 ],
1782 'selectors' => [
1783 '{{WRAPPER}}' => '--upk-swiper-carousel-dots-nny: {{SIZE}}px;'
1784 ],
1785 ]
1786 );
1787
1788 $this->add_responsive_control(
1789 'both_ncx_position',
1790 [
1791 'label' => __( 'Arrows & Dots Horizontal Offset', 'ultimate-post-kit' ),
1792 'type' => Controls_Manager::SLIDER,
1793 'default' => [
1794 'size' => 0,
1795 ],
1796 'tablet_default' => [
1797 'size' => 0,
1798 ],
1799 'mobile_default' => [
1800 'size' => 0,
1801 ],
1802 'range' => [
1803 'px' => [
1804 'min' => -200,
1805 'max' => 200,
1806 ],
1807 ],
1808 'conditions' => [
1809 'terms' => [
1810 [
1811 'name' => 'navigation',
1812 'value' => 'both',
1813 ],
1814 [
1815 'name' => 'both_position',
1816 'operator' => '!=',
1817 'value' => 'center',
1818 ],
1819 ],
1820 ],
1821 'selectors' => [
1822 '{{WRAPPER}}' => '--upk-swiper-carousel-both-ncx: {{SIZE}}px;'
1823 ],
1824 ]
1825 );
1826
1827 $this->add_responsive_control(
1828 'both_ncy_position',
1829 [
1830 'label' => __( 'Arrows & Dots Vertical Offset', 'ultimate-post-kit' ),
1831 'type' => Controls_Manager::SLIDER,
1832 'default' => [
1833 'size' => 40,
1834 ],
1835 'tablet_default' => [
1836 'size' => 40,
1837 ],
1838 'mobile_default' => [
1839 'size' => 40,
1840 ],
1841 'range' => [
1842 'px' => [
1843 'min' => -200,
1844 'max' => 200,
1845 ],
1846 ],
1847 'conditions' => [
1848 'terms' => [
1849 [
1850 'name' => 'navigation',
1851 'value' => 'both',
1852 ],
1853 [
1854 'name' => 'both_position',
1855 'operator' => '!=',
1856 'value' => 'center',
1857 ],
1858 ],
1859 ],
1860 'selectors' => [
1861 '{{WRAPPER}}' => '--upk-swiper-carousel-both-ncy: {{SIZE}}px;'
1862 ],
1863 ]
1864 );
1865
1866 $this->add_responsive_control(
1867 'both_cx_position',
1868 [
1869 'label' => __( 'Arrows Offset', 'ultimate-post-kit' ),
1870 'type' => Controls_Manager::SLIDER,
1871 'default' => [
1872 'size' => 60,
1873 ],
1874 'range' => [
1875 'px' => [
1876 'min' => -200,
1877 'max' => 200,
1878 ],
1879 ],
1880 'selectors' => [
1881 '{{WRAPPER}} .upk-paradox-slider .upk-navigation-prev' => 'left: {{SIZE}}px;',
1882 '{{WRAPPER}} .upk-paradox-slider .upk-navigation-next' => 'right: {{SIZE}}px;',
1883 ],
1884 'conditions' => [
1885 'terms' => [
1886 [
1887 'name' => 'navigation',
1888 'value' => 'both',
1889 ],
1890 [
1891 'name' => 'both_position',
1892 'value' => 'center',
1893 ],
1894 ],
1895 ],
1896 ]
1897 );
1898
1899 $this->add_responsive_control(
1900 'both_cy_position',
1901 [
1902 'label' => __( 'Dots Offset', 'ultimate-post-kit' ),
1903 'type' => Controls_Manager::SLIDER,
1904 'default' => [
1905 'size' => -60,
1906 ],
1907 'range' => [
1908 'px' => [
1909 'min' => -200,
1910 'max' => 200,
1911 ],
1912 ],
1913 'selectors' => [
1914 '{{WRAPPER}} .upk-paradox-slider .upk-dots-container' => 'transform: translateY({{SIZE}}px);',
1915 ],
1916 'conditions' => [
1917 'terms' => [
1918 [
1919 'name' => 'navigation',
1920 'value' => 'both',
1921 ],
1922 [
1923 'name' => 'both_position',
1924 'value' => 'center',
1925 ],
1926 ],
1927 ],
1928 ]
1929 );
1930
1931 $this->add_responsive_control(
1932 'arrows_fraction_ncx_position',
1933 [
1934 'label' => __( 'Arrows & Fraction Horizontal Offset', 'ultimate-post-kit' ),
1935 'type' => Controls_Manager::SLIDER,
1936 'default' => [
1937 'size' => 0,
1938 ],
1939 'tablet_default' => [
1940 'size' => 0,
1941 ],
1942 'mobile_default' => [
1943 'size' => 0,
1944 ],
1945 'range' => [
1946 'px' => [
1947 'min' => -200,
1948 'max' => 200,
1949 ],
1950 ],
1951 'conditions' => [
1952 'terms' => [
1953 [
1954 'name' => 'navigation',
1955 'value' => 'arrows-fraction',
1956 ],
1957 [
1958 'name' => 'arrows_fraction_position',
1959 'operator' => '!=',
1960 'value' => 'center',
1961 ],
1962 ],
1963 ],
1964 'selectors' => [
1965 '{{WRAPPER}}' => '--upk-swiper-carousel-arrows-fraction-ncx: {{SIZE}}px;'
1966 ],
1967 ]
1968 );
1969
1970 $this->add_responsive_control(
1971 'arrows_fraction_ncy_position',
1972 [
1973 'label' => __( 'Arrows & Fraction Vertical Offset', 'ultimate-post-kit' ),
1974 'type' => Controls_Manager::SLIDER,
1975 'default' => [
1976 'size' => 40,
1977 ],
1978 'tablet_default' => [
1979 'size' => 40,
1980 ],
1981 'mobile_default' => [
1982 'size' => 40,
1983 ],
1984 'range' => [
1985 'px' => [
1986 'min' => -200,
1987 'max' => 200,
1988 ],
1989 ],
1990 'conditions' => [
1991 'terms' => [
1992 [
1993 'name' => 'navigation',
1994 'value' => 'arrows-fraction',
1995 ],
1996 [
1997 'name' => 'arrows_fraction_position',
1998 'operator' => '!=',
1999 'value' => 'center',
2000 ],
2001 ],
2002 ],
2003 'selectors' => [
2004 '{{WRAPPER}}' => '--upk-swiper-carousel-arrows-fraction-ncy: {{SIZE}}px;'
2005 ],
2006 ]
2007 );
2008
2009 $this->add_responsive_control(
2010 'arrows_fraction_cx_position',
2011 [
2012 'label' => __( 'Arrows Offset', 'ultimate-post-kit' ),
2013 'type' => Controls_Manager::SLIDER,
2014 'default' => [
2015 'size' => 60,
2016 ],
2017 'range' => [
2018 'px' => [
2019 'min' => -200,
2020 'max' => 200,
2021 ],
2022 ],
2023 'selectors' => [
2024 '{{WRAPPER}} .upk-paradox-slider .upk-navigation-prev' => 'left: {{SIZE}}px;',
2025 '{{WRAPPER}} .upk-paradox-slider .upk-navigation-next' => 'right: {{SIZE}}px;',
2026 ],
2027 'conditions' => [
2028 'terms' => [
2029 [
2030 'name' => 'navigation',
2031 'value' => 'arrows-fraction',
2032 ],
2033 [
2034 'name' => 'arrows_fraction_position',
2035 'value' => 'center',
2036 ],
2037 ],
2038 ],
2039 ]
2040 );
2041
2042 $this->add_responsive_control(
2043 'arrows_fraction_cy_position',
2044 [
2045 'label' => __( 'Fraction Offset', 'ultimate-post-kit' ),
2046 'type' => Controls_Manager::SLIDER,
2047 'default' => [
2048 'size' => -60,
2049 ],
2050 'range' => [
2051 'px' => [
2052 'min' => -200,
2053 'max' => 200,
2054 ],
2055 ],
2056 'selectors' => [
2057 '{{WRAPPER}} .upk-paradox-slider .swiper-pagination-fraction' => 'transform: translateY({{SIZE}}px);',
2058 ],
2059 'conditions' => [
2060 'terms' => [
2061 [
2062 'name' => 'navigation',
2063 'value' => 'arrows-fraction',
2064 ],
2065 [
2066 'name' => 'arrows_fraction_position',
2067 'value' => 'center',
2068 ],
2069 ],
2070 ],
2071 ]
2072 );
2073
2074 $this->add_responsive_control(
2075 'progress_y_position',
2076 [
2077 'label' => __( 'Progress Offset', 'ultimate-post-kit' ),
2078 'type' => Controls_Manager::SLIDER,
2079 'default' => [
2080 'size' => 15,
2081 ],
2082 'range' => [
2083 'px' => [
2084 'min' => -200,
2085 'max' => 200,
2086 ],
2087 ],
2088 'selectors' => [
2089 '{{WRAPPER}} .upk-paradox-slider .swiper-pagination-progressbar' => 'transform: translateY({{SIZE}}px);',
2090 ],
2091 'condition' => [
2092 'navigation' => 'progressbar',
2093 ],
2094 ]
2095 );
2096
2097 $this->add_responsive_control(
2098 'scrollbar_vertical_offset',
2099 [
2100 'label' => __( 'Scrollbar Offset', 'ultimate-post-kit' ),
2101 'type' => Controls_Manager::SLIDER,
2102 'selectors' => [
2103 '{{WRAPPER}} .upk-paradox-slider .swiper-horizontal > .swiper-scrollbar' => 'bottom: {{SIZE}}px;',
2104 ],
2105 'condition' => [
2106 'show_scrollbar' => 'yes'
2107 ],
2108 ]
2109 );
2110
2111 $this->end_controls_section();
2112 }
2113
2114 /**
2115 * Main query render for this widget
2116 * @param $posts_per_page number item query limit
2117 */
2118 public function query_posts( $posts_per_page ) {
2119
2120 $default = $this->getGroupControlQueryArgs();
2121 $args = [];
2122 if ( $posts_per_page ) {
2123 $args['posts_per_page'] = $posts_per_page;
2124 }
2125 $args = array_merge( $default, $args );
2126 $this->_query = new WP_Query( $args );
2127 }
2128
2129 public function render_author() {
2130
2131 if (!$this->get_settings('show_author')) {
2132 return;
2133 }
2134
2135 ?>
2136
2137 <div class="upk-author-wrapper upk-flex upk-flex-middle">
2138
2139 <div class="upk-author-image">
2140 <?php echo get_avatar(get_the_author_meta('ID'), 48); ?>
2141 </div>
2142 <div class="upk-author-info">
2143 <div class="upk-author-name">
2144 <a href="<?php echo esc_url( get_author_posts_url(get_the_author_meta('ID')) ); ?>">
2145 <?php echo esc_html( get_the_author() ); ?>
2146 </a>
2147 </div>
2148
2149 <div class="upk-author-role">
2150 <?php
2151 $aid = get_the_author_meta('ID');
2152 echo esc_html( get_user_role( $aid ) );
2153 ?>
2154 </div>
2155 </div>
2156 </div>
2157
2158 <?php
2159 }
2160
2161 public function render_header() {
2162 $id = 'upk-' . $this->get_id();
2163 $settings = $this->get_settings_for_display();
2164
2165 $this->add_render_attribute( 'paradox-slider', 'id', $id );
2166 $this->add_render_attribute( 'paradox-slider', 'class', ['upk-paradox-slider'] );
2167
2168 if ('arrows' == $settings['navigation']) {
2169 $this->add_render_attribute( 'paradox-slider', 'class', 'upk-arrows-align-'. $settings['arrows_position'] );
2170 } elseif ('dots' == $settings['navigation']) {
2171 $this->add_render_attribute( 'paradox-slider', 'class', 'upk-dots-align-'. $settings['dots_position'] );
2172 } elseif ('both' == $settings['navigation']) {
2173 $this->add_render_attribute( 'paradox-slider', 'class', 'upk-arrows-dots-align-'. $settings['both_position'] );
2174 } elseif ('arrows-fraction' == $settings['navigation']) {
2175 $this->add_render_attribute( 'paradox-slider', 'class', 'upk-arrows-dots-align-'. $settings['arrows_fraction_position'] );
2176 }
2177
2178 if ('arrows-fraction' == $settings['navigation'] ) {
2179 $pagination_type = 'fraction';
2180 } elseif ('both' == $settings['navigation'] or 'dots' == $settings['navigation']) {
2181 $pagination_type = 'bullets';
2182 } elseif ('progressbar' == $settings['navigation'] ) {
2183 $pagination_type = 'progressbar';
2184 } else {
2185 $pagination_type = '';
2186 }
2187
2188 $this->add_render_attribute(
2189 [
2190 'paradox-slider' => [
2191 'data-settings' => [
2192 wp_json_encode(array_filter([
2193 "autoplay" => ( "yes" == $settings["autoplay"] ) ? [ "delay" => $settings["autoplay_speed"] ] : false,
2194 "loop" => ($settings["loop"] == "yes") ? true : false,
2195 "speed" => $settings["speed"]["size"],
2196 "effect" => 'fade',
2197 "lazy" => true,
2198 "parallax" => true,
2199 "grabCursor" => ($settings["grab_cursor"] === "yes") ? true : false,
2200 "pauseOnHover" => ("yes" == $settings["pauseonhover"]) ? true : false,
2201 "slidesPerView" => 1,
2202 "observer" => ($settings["observer"]) ? true : false,
2203 "observeParents" => ($settings["observer"]) ? true : false,
2204 "navigation" => [
2205 "nextEl" => "#" . $id . " .upk-navigation-next",
2206 "prevEl" => "#" . $id . " .upk-navigation-prev",
2207 ],
2208 "pagination" => [
2209 "el" => "#" . $id . " .swiper-pagination",
2210 "type" => $pagination_type,
2211 "clickable" => "true",
2212 'dynamicBullets' => ("yes" == $settings["dynamic_bullets"]) ? true : false,
2213 ],
2214 "scrollbar" => [
2215 "el" => "#" . $id . " .swiper-scrollbar",
2216 "hide" => "true",
2217 ],
2218 "lazy" => [
2219 "loadPrevNext" => "true",
2220 ],
2221 ]))
2222 ]
2223 ]
2224 ]
2225 );
2226
2227 $this->add_render_attribute('swiper', 'class', 'swiper-carousel swiper');
2228
2229 ?>
2230 <div <?php $this->print_render_attribute_string( 'paradox-slider' ); ?>>
2231 <div class="upk-wrapper">
2232 <div <?php $this->print_render_attribute_string('swiper'); ?>>
2233 <div class="swiper-wrapper">
2234 <?php
2235 }
2236
2237 public function render_navigation() {
2238 $settings = $this->get_settings_for_display();
2239 $hide_arrow_on_mobile = $settings['hide_arrow_on_mobile'] ? ' upk-visible@m' : '';
2240
2241 if ( 'arrows' == $settings['navigation'] ) : ?>
2242 <div class="upk-position-z-index upk-position-<?php echo esc_attr( $settings['arrows_position'] . $hide_arrow_on_mobile ); ?>">
2243 <div class="upk-arrows-container upk-slidenav-container">
2244 <a href="" class="upk-navigation-prev upk-slidenav-previous upk-icon upk-slidenav">
2245 <i class="upk-icon-arrow-left-<?php echo esc_attr($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i>
2246 </a>
2247 <a href="" class="upk-navigation-next upk-slidenav-next upk-icon upk-slidenav">
2248 <i class="upk-icon-arrow-right-<?php echo esc_attr($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i>
2249 </a>
2250 </div>
2251 </div>
2252 <?php endif;
2253 }
2254
2255 public function render_pagination() {
2256 $settings = $this->get_settings_for_display();
2257
2258 if ( 'dots' == $settings['navigation'] or 'arrows-fraction' == $settings['navigation'] ) : ?>
2259 <div class="upk-position-z-index upk-position-<?php echo esc_attr($settings['dots_position']); ?>">
2260 <div class="upk-dots-container">
2261 <div class="swiper-pagination"></div>
2262 </div>
2263 </div>
2264
2265 <?php elseif ( 'progressbar' == $settings['navigation'] ) : ?>
2266 <div class="swiper-pagination upk-position-z-index upk-position-<?php echo esc_attr($settings['progress_position']); ?>"></div>
2267 <?php endif;
2268 }
2269
2270 public function render_both_navigation() {
2271 $settings = $this->get_settings_for_display();
2272 $hide_arrow_on_mobile = $settings['hide_arrow_on_mobile'] ? 'upk-visible@m upk-flex' : 'upk-flex';
2273
2274 ?>
2275 <div class="upk-position-z-index upk-position-<?php echo esc_attr($settings['both_position']); ?>">
2276 <div class="upk-arrows-dots-container upk-slidenav-container ">
2277
2278 <div class="upk-flex upk-flex-middle">
2279 <div class="<?php echo esc_attr( $hide_arrow_on_mobile ); ?>">
2280 <a href="" class="upk-navigation-prev upk-slidenav-previous upk-icon upk-slidenav">
2281 <i class="upk-icon-arrow-left-<?php echo esc_attr($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i>
2282 </a>
2283 </div>
2284
2285 <?php if ('center' !== $settings['both_position']) : ?>
2286 <div class="swiper-pagination"></div>
2287 <?php endif; ?>
2288
2289 <div class="<?php echo esc_attr( $hide_arrow_on_mobile ); ?>">
2290 <a href="" class="upk-navigation-next upk-slidenav-next upk-icon upk-slidenav">
2291 <i class="upk-icon-arrow-right-<?php echo esc_attr($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i>
2292 </a>
2293 </div>
2294
2295 </div>
2296 </div>
2297 </div>
2298 <?php
2299 }
2300
2301 public function render_arrows_fraction() {
2302 $settings = $this->get_settings_for_display();
2303 $hide_arrow_on_mobile = $settings['hide_arrow_on_mobile'] ? 'upk-visible@m' : '';
2304
2305 ?>
2306 <div class="upk-position-z-index upk-position-<?php echo esc_attr($settings['arrows_fraction_position']); ?>">
2307 <div class="upk-arrows-fraction-container upk-slidenav-container ">
2308
2309 <div class="upk-flex upk-flex-middle">
2310 <div class="<?php echo esc_attr( $hide_arrow_on_mobile ); ?>">
2311 <a href="" class="upk-navigation-prev upk-slidenav-previous upk-icon upk-slidenav">
2312 <i class="upk-icon-arrow-left-<?php echo esc_attr($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i>
2313 </a>
2314 </div>
2315
2316 <?php if ('center' !== $settings['arrows_fraction_position']) : ?>
2317 <div class="swiper-pagination"></div>
2318 <?php endif; ?>
2319
2320 <div class="<?php echo esc_attr( $hide_arrow_on_mobile ); ?>">
2321 <a href="" class="upk-navigation-next upk-slidenav-next upk-icon upk-slidenav">
2322 <i class="upk-icon-arrow-right-<?php echo esc_attr($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i>
2323 </a>
2324 </div>
2325
2326 </div>
2327 </div>
2328 </div>
2329 <?php
2330 }
2331
2332 public function render_footer() {
2333 $settings = $this->get_settings_for_display();
2334
2335 ?>
2336 </div>
2337 <?php if ( 'yes' === $settings['show_scrollbar'] ) : ?>
2338 <div class="swiper-scrollbar"></div>
2339 <?php endif; ?>
2340 </div>
2341
2342 <?php if ('both' == $settings['navigation']) : ?>
2343 <?php $this->render_both_navigation(); ?>
2344 <?php if ( 'center' === $settings['both_position'] ) : ?>
2345 <div class="upk-position-z-index upk-position-bottom">
2346 <div class="upk-dots-container">
2347 <div class="swiper-pagination"></div>
2348 </div>
2349 </div>
2350 <?php endif; ?>
2351 <?php elseif ('arrows-fraction' == $settings['navigation']) : ?>
2352 <?php $this->render_arrows_fraction(); ?>
2353 <?php if ( 'center' === $settings['arrows_fraction_position'] ) : ?>
2354 <div class="upk-dots-container">
2355 <div class="swiper-pagination"></div>
2356 </div>
2357 <?php endif; ?>
2358 <?php else : ?>
2359 <?php $this->render_pagination(); ?>
2360 <?php $this->render_navigation(); ?>
2361 <?php endif; ?>
2362
2363 </div>
2364 </div>
2365
2366 <?php
2367 }
2368
2369 public function render_post_grid_item($post_id, $image_size, $excerpt_length) {
2370 $settings = $this->get_settings_for_display();
2371
2372 if ('yes' == $settings['global_link']) {
2373
2374 $this->add_render_attribute('carousel-item', 'onclick', "window.open('" . esc_url(get_permalink()) . "', '_self')", true);
2375 }
2376 $this->add_render_attribute('carousel-item', 'class', 'upk-item swiper-slide upk-transition-toggle', true);
2377
2378 ?>
2379 <div <?php $this->print_render_attribute_string('carousel-item'); ?>>
2380 <div class="upk-image-wrapper">
2381 <?php $this->render_image(get_post_thumbnail_id($post_id), $image_size); ?>
2382 </div>
2383
2384 <div class="upk-content-box upk-position-center">
2385 <div class="upk-content-inner">
2386 <div class="upk-category-date-wrap upk-flex upk-flex-middle" data-swiper-parallax="-100" data-swiper-parallax-opacity="0.5" data-swiper-parallax-duration="600">
2387 <?php $this->render_category(); ?>
2388
2389 <?php if ($settings['show_date'] or $settings['show_reading_time']) : ?>
2390 <div class="upk-meta upk-flex upk-flex-middle">
2391 <?php $this->render_date(); ?>
2392 <?php if (_is_upk_pro_activated()) :
2393 if ('yes' === $settings['show_reading_time']) : ?>
2394 <div class="upk-reading-time" data-separator="<?php echo esc_attr($settings['meta_separator']); ?>">
2395 <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'], $settings['hide_seconds'] ?? 'no', $settings['hide_minutes'] ?? 'no' ) ); ?>
2396 </div>
2397 <?php endif; ?>
2398 <?php endif; ?>
2399 </div>
2400 <?php endif; ?>
2401
2402 </div>
2403
2404 <div data-swiper-parallax="-200" data-swiper-parallax-opacity="0.5" data-swiper-parallax-duration="700">
2405 <?php $this->render_title(substr($this->get_name(), 4)); ?>
2406 </div>
2407
2408 <div data-swiper-parallax="-300" data-swiper-parallax-opacity="0.5" data-swiper-parallax-duration="800">
2409 <?php $this->render_excerpt( $excerpt_length ); ?>
2410 </div>
2411
2412 <div data-swiper-parallax="-400" data-swiper-parallax-opacity="0.5" data-swiper-parallax-duration="900">
2413 <?php $this->render_author(); ?>
2414 </div>
2415 </div>
2416 </div>
2417 </div>
2418 <?php
2419 }
2420
2421 public function render() {
2422 $settings = $this->get_settings_for_display();
2423
2424 $this->query_posts($settings['item_limit']['size']);
2425 $wp_query = $this->get_query();
2426
2427 if (!$wp_query->found_posts) {
2428 return;
2429 }
2430
2431 $this->render_header();
2432
2433 while ( $wp_query->have_posts() ) {
2434 $wp_query->the_post();
2435 $thumbnail_size = $settings['primary_thumbnail_size'];
2436
2437 $this->render_post_grid_item( get_the_ID(), $thumbnail_size, $settings['excerpt_length'] );
2438 }
2439
2440 $this->render_footer();
2441
2442 wp_reset_postdata();
2443 }
2444 }
2445