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

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