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

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