PluginProbe
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets / 4.0.9
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets v4.0.9
4.5.6 4.5.5 4.5.4 4.2.1 4.2.2 4.2.3 4.5.0 4.5.2 4.5.3 4.2.0 4.1.18 4.1.17 4.1.16 4.1.15 4.1.14 4.1.13 4.1.12 4.1.11 4.1.10 4.1.9 4.1.8 4.0.9 4.1.0 4.1.1 4.1.2 All 148 releases
ultimate-post-kit / modules / paradox-slider / widgets / paradox-slider.php

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

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