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

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

1,603 lines 40.0 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\CamuxSlider\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_Image_Size;
11 use Elementor\Group_Control_Text_Stroke;
12 use Elementor\Group_Control_Background;
13 use Elementor\Plugin;
14
15 use UltimatePostKit\Utils;
16 use UltimatePostKit\Traits\Global_Widget_Controls;
17 use UltimatePostKit\Traits\Global_Widget_Functions;
18 use UltimatePostKit\Includes\Controls\GroupQuery\Group_Control_Query;
19 use WP_Query;
20
21 if (!defined('ABSPATH')) exit; // Exit if accessed directly
22
23 class Camux_Slider extends Group_Control_Query {
24
25 use Global_Widget_Controls;
26 use Global_Widget_Functions;
27
28 private $_query = null;
29
30 public function get_name() {
31 return 'upk-camux-slider';
32 }
33
34 public function get_title() {
35 return BDTUPK . esc_html__('Camux Slider', 'ultimate-post-kit');
36 }
37
38 public function get_icon() {
39 return 'upk-widget-icon upk-icon-camux-slider';
40 }
41
42 public function get_categories() {
43 return ['ultimate-post-kit'];
44 }
45
46 public function get_keywords() {
47 return ['post', 'carousel', 'blog', 'recent', 'news', 'slider', 'camux'];
48 }
49
50 public function get_style_depends() {
51 if ($this->upk_is_edit_mode()) {
52 return ['swiper', 'upk-all-styles'];
53 } else {
54 return ['swiper', 'upk-font', 'upk-camux-slider'];
55 }
56 }
57
58 public function get_script_depends() {
59 if ($this->upk_is_edit_mode()) {
60 return ['swiper', 'upk-all-scripts'];
61 } else {
62 return ['swiper', 'upk-camux-slider'];
63 }
64 }
65
66 public function get_custom_help_url() {
67 return 'https://youtu.be/3IFFXN69IgQ';
68 }
69
70
71 public function get_query() {
72 return $this->_query;
73 }
74
75 public function has_widget_inner_wrapper(): bool {
76 return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
77 }
78
79
80 protected function register_controls() {
81 $this->start_controls_section(
82 'section_content_layout',
83 [
84 'label' => esc_html__('Layout', 'ultimate-post-kit'),
85 ]
86 );
87
88 $this->add_responsive_control(
89 'item_height',
90 [
91 'label' => esc_html__('Height', 'ultimate-post-kit'),
92 'type' => Controls_Manager::SLIDER,
93 'size_units' => ['px', '%', 'vh'],
94 'range' => [
95 'px' => [
96 'min' => 200,
97 'max' => 1080,
98 ],
99 '%' => [
100 'min' => 10,
101 'max' => 100,
102 ],
103 'vh' => [
104 'min' => 10,
105 'max' => 100,
106 ],
107 ],
108 'selectors' => [
109 '{{WRAPPER}} .upk-camux-slider .upk-item' => 'height: {{SIZE}}{{UNIT}};',
110 ],
111 ]
112 );
113
114 $this->add_responsive_control(
115 'content_width',
116 [
117 'label' => esc_html__('Content Max Width', 'ultimate-post-kit'),
118 'type' => Controls_Manager::SLIDER,
119 'size_units' => ['px', '%', 'vw'],
120 'range' => [
121 'px' => [
122 'min' => 200,
123 'max' => 1200,
124 ],
125 '%' => [
126 'min' => 10,
127 'max' => 100,
128 ],
129 'vw' => [
130 'min' => 10,
131 'max' => 100,
132 ],
133 ],
134 'selectors' => [
135 '{{WRAPPER}} .upk-camux-slider .upk-content' => 'max-width: {{SIZE}}{{UNIT}};',
136 ],
137 ]
138 );
139
140 $this->add_responsive_control(
141 'content_alignment',
142 [
143 'label' => __('Alignment', 'ultimate-post-kit'),
144 'type' => Controls_Manager::CHOOSE,
145 'options' => [
146 'left' => [
147 'title' => __('Left', 'ultimate-post-kit'),
148 'icon' => 'eicon-h-align-left',
149 ],
150 'center' => [
151 'title' => __('Center', 'ultimate-post-kit'),
152 'icon' => 'eicon-h-align-center',
153 ],
154 'right' => [
155 'title' => __('Right', 'ultimate-post-kit'),
156 'icon' => 'eicon-h-align-right',
157 ],
158 ],
159 'selectors' => [
160 '{{WRAPPER}} .upk-camux-slider .upk-content' => 'text-align: {{VALUE}};',
161 ],
162 ]
163 );
164
165 $this->add_group_control(
166 Group_Control_Image_Size::get_type(),
167 [
168 'name' => 'primary_thumbnail',
169 'exclude' => ['custom'],
170 'default' => 'full',
171 ]
172 );
173
174 $this->add_control(
175 'hr_1',
176 [
177 'type' => Controls_Manager::DIVIDER,
178 ]
179 );
180
181 //Global Title Controls
182 $this->register_title_controls();
183 $this->register_text_controls();
184
185 $this->add_control(
186 'show_category',
187 [
188 'label' => esc_html__('Show Category', 'ultimate-post-kit'),
189 'type' => Controls_Manager::SWITCHER,
190 'default' => 'yes',
191 'separator' => 'before'
192 ]
193 );
194
195 $this->add_control(
196 'show_author',
197 [
198 'label' => esc_html__('Show Author', 'ultimate-post-kit'),
199 'type' => Controls_Manager::SWITCHER,
200 'default' => 'yes',
201 'separator' => 'before'
202 ]
203 );
204
205 $this->add_control(
206 'meta_separator',
207 [
208 'label' => __('Separator', 'ultimate-post-kit'),
209 'type' => Controls_Manager::TEXT,
210 'default' => '//',
211 'label_block' => false,
212 ]
213 );
214
215 //Global Date Controls
216 $this->register_date_controls();
217
218 //Global Reading Time Controls
219 $this->register_reading_time_controls();
220
221 $this->add_control(
222 'show_comments',
223 [
224 'label' => esc_html__('Show Comments', 'ultimate-post-kit'),
225 'type' => Controls_Manager::SWITCHER,
226 'default' => 'yes',
227 'separator' => 'before'
228 ]
229 );
230
231 $this->add_control(
232 'show_navigation',
233 [
234 'label' => esc_html__('Show Navigation', 'ultimate-post-kit') . BDTUPK_NC,
235 'type' => Controls_Manager::SWITCHER,
236 'separator' => 'before'
237 ]
238 );
239
240 $this->end_controls_section();
241
242 // Query Settings
243 $this->start_controls_section(
244 'section_post_query_builder',
245 [
246 'label' => __('Query', 'ultimate-post-kit'),
247 'tab' => Controls_Manager::TAB_CONTENT,
248 ]
249 );
250
251 $this->add_control(
252 'item_limit',
253 [
254 'label' => esc_html__('Item Limit', 'ultimate-post-kit'),
255 'type' => Controls_Manager::SLIDER,
256 'range' => [
257 'px' => [
258 'min' => 1,
259 'max' => 20,
260 ],
261 ],
262 'default' => [
263 'size' => 12,
264 ],
265 ]
266 );
267
268 $this->register_query_builder_controls();
269
270 $this->end_controls_section();
271
272 $this->start_controls_section(
273 'section_carousel_settings',
274 [
275 'label' => __('Slider Settings', 'ultimate-post-kit'),
276 ]
277 );
278
279 $this->add_control(
280 'autoplay',
281 [
282 'label' => __('Autoplay', 'ultimate-post-kit'),
283 'type' => Controls_Manager::SWITCHER,
284 'default' => 'yes',
285
286 ]
287 );
288
289 $this->add_control(
290 'autoplay_speed',
291 [
292 'label' => esc_html__('Autoplay Speed', 'ultimate-post-kit'),
293 'type' => Controls_Manager::NUMBER,
294 'default' => 5000,
295 'condition' => [
296 'autoplay' => 'yes',
297 ],
298 ]
299 );
300
301 $this->add_control(
302 'pauseonhover',
303 [
304 'label' => esc_html__('Pause on Hover', 'ultimate-post-kit'),
305 'type' => Controls_Manager::SWITCHER,
306 ]
307 );
308
309 $this->add_control(
310 'grab_cursor',
311 [
312 'label' => __('Grab Cursor', 'ultimate-post-kit'),
313 'type' => Controls_Manager::SWITCHER,
314 ]
315 );
316
317 $this->add_control(
318 'loop',
319 [
320 'label' => __('Loop', 'ultimate-post-kit'),
321 'type' => Controls_Manager::SWITCHER,
322 'default' => 'yes',
323
324 ]
325 );
326
327
328 $this->add_control(
329 'speed',
330 [
331 'label' => __('Animation Speed (ms)', 'ultimate-post-kit'),
332 'type' => Controls_Manager::SLIDER,
333 'default' => [
334 'size' => 500,
335 ],
336 'range' => [
337 'px' => [
338 'min' => 100,
339 'max' => 5000,
340 'step' => 50,
341 ],
342 ],
343 ]
344 );
345
346 $this->add_control(
347 'observer',
348 [
349 'label' => __('Observer', 'ultimate-post-kit'),
350 'description' => __('When you use carousel in any hidden place (in tabs, accordion etc) keep it yes.', 'ultimate-post-kit'),
351 'type' => Controls_Manager::SWITCHER,
352 ]
353 );
354
355 $this->end_controls_section();
356
357 //Style
358 $this->start_controls_section(
359 'section_style_items',
360 [
361 'label' => esc_html__('Item', 'ultimate-post-kit'),
362 'tab' => Controls_Manager::TAB_STYLE,
363 ]
364 );
365
366 $this->add_control(
367 'overlay_type',
368 [
369 'label' => esc_html__('Overlay', 'ultimate-post-kit'),
370 'type' => Controls_Manager::SELECT,
371 'default' => 'background',
372 'options' => [
373 'none' => esc_html__('None', 'ultimate-post-kit'),
374 'background' => esc_html__('Background', 'ultimate-post-kit'),
375 'blend' => esc_html__('Blend', 'ultimate-post-kit'),
376 ],
377 ]
378 );
379
380 $this->add_group_control(
381 Group_Control_Background::get_type(),
382 [
383 'name' => 'overlay_color',
384 'label' => esc_html__('Background', 'ultimate-post-kit'),
385 'types' => ['classic', 'gradient'],
386 'exclude' => ['image'],
387 'selector' => '{{WRAPPER}} .upk-camux-slider .upk-img-wrap::before',
388 'fields_options' => [
389 'background' => [
390 'default' => 'classic',
391 ],
392 'color' => [
393 'default' => 'rgba(3, 4, 16, 0.4)',
394 ],
395 ],
396 'condition' => [
397 'overlay_type' => ['background', 'blend'],
398 ],
399 ]
400 );
401
402 $this->add_control(
403 'blend_type',
404 [
405 'label' => esc_html__('Blend Type', 'ultimate-post-kit'),
406 'type' => Controls_Manager::SELECT,
407 'default' => 'multiply',
408 'options' => ultimate_post_kit_blend_options(),
409 'condition' => [
410 'overlay_type' => 'blend',
411 ],
412 'selectors' => [
413 '{{WRAPPER}} .upk-camux-slider .upk-img-wrap::before' => 'mix-blend-mode: {{VALUE}};'
414 ],
415 ]
416 );
417
418 $this->add_responsive_control(
419 'content_padding',
420 [
421 'label' => __('Content Padding', 'ultimate-post-kit'),
422 'type' => Controls_Manager::DIMENSIONS,
423 'size_units' => ['px', 'em', '%'],
424 'selectors' => [
425 '{{WRAPPER}} .upk-camux-slider .upk-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
426 ],
427 'separator' => 'before'
428 ]
429 );
430
431 $this->end_controls_section();
432
433 $this->start_controls_section(
434 'section_style_title',
435 [
436 'label' => esc_html__('Title', 'ultimate-post-kit'),
437 'tab' => Controls_Manager::TAB_STYLE,
438 'condition' => [
439 'show_title' => 'yes',
440 ],
441 ]
442 );
443
444 $this->add_control(
445 'title_style',
446 [
447 'type' => Controls_Manager::HIDDEN,
448 ]
449 );
450
451 $this->add_control(
452 'title_color',
453 [
454 'label' => esc_html__('Color', 'ultimate-post-kit'),
455 'type' => Controls_Manager::COLOR,
456 'selectors' => [
457 '{{WRAPPER}} .upk-camux-slider .upk-title a' => 'color: {{VALUE}};',
458 ],
459 ]
460 );
461
462 $this->add_control(
463 'title_hover_color',
464 [
465 'label' => esc_html__('Hover Color', 'ultimate-post-kit'),
466 'type' => Controls_Manager::COLOR,
467 'selectors' => [
468 '{{WRAPPER}} .upk-camux-slider .upk-title a:hover' => 'color: {{VALUE}};',
469 ],
470 ]
471 );
472
473 $this->add_group_control(
474 Group_Control_Background::get_type(),
475 [
476 'name' => 'title_background',
477 'selector' => '{{WRAPPER}} .upk-camux-slider .upk-title a',
478 ]
479 );
480
481 $this->add_responsive_control(
482 'title_border_radius',
483 [
484 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
485 'type' => Controls_Manager::DIMENSIONS,
486 'size_units' => ['px', '%'],
487 'selectors' => [
488 '{{WRAPPER}} .upk-camux-slider .upk-title a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
489 ],
490 ]
491 );
492
493 $this->add_responsive_control(
494 'title_padding',
495 [
496 'label' => __('Padding', 'ultimate-post-kit'),
497 'type' => Controls_Manager::DIMENSIONS,
498 'size_units' => ['px', 'em', '%'],
499 'selectors' => [
500 '{{WRAPPER}} .upk-camux-slider .upk-title a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
501 ],
502 ]
503 );
504
505 $this->add_responsive_control(
506 'title_spacing',
507 [
508 'label' => esc_html__('Spacing', 'ultimate-post-kit'),
509 'type' => Controls_Manager::SLIDER,
510 'range' => [
511 'px' => [
512 'min' => 0,
513 'max' => 100,
514 ],
515 ],
516 'selectors' => [
517 '{{WRAPPER}} .upk-camux-slider .upk-title' => 'padding-bottom: {{SIZE}}{{UNIT}};',
518 ],
519 ]
520 );
521
522 $this->add_group_control(
523 Group_Control_Typography::get_type(),
524 [
525 'name' => 'title_typography',
526 'label' => esc_html__('Typography', 'ultimate-post-kit'),
527 'selector' => '{{WRAPPER}} .upk-camux-slider .upk-title',
528 ]
529 );
530
531 $this->add_group_control(
532 Group_Control_Text_Shadow::get_type(),
533 [
534 'name' => 'title_text_shadow',
535 'label' => __('Text Shadow', 'ultimate-post-kit'),
536 'selector' => '{{WRAPPER}} .upk-camux-slider .upk-title a',
537 ]
538 );
539
540 $this->add_group_control(
541 Group_Control_Text_Stroke::get_type(),
542 [
543 'name' => 'title_text_stroke',
544 'label' => __('Text Stroke', 'ultimate-post-kit') . BDTUPK_NC,
545 'selector' => '{{WRAPPER}} .upk-camux-slider .upk-title a',
546 ]
547 );
548
549 $this->end_controls_section();
550
551 $this->start_controls_section(
552 'section_style_text',
553 [
554 'label' => esc_html__('Text', 'ultimate-post-kit'),
555 'tab' => Controls_Manager::TAB_STYLE,
556 'condition' => [
557 'show_excerpt' => 'yes',
558 ],
559 ]
560 );
561
562 $this->add_control(
563 'text_color',
564 [
565 'label' => esc_html__('Color', 'ultimate-post-kit'),
566 'type' => Controls_Manager::COLOR,
567 'selectors' => [
568 '{{WRAPPER}} .upk-camux-slider .upk-text' => 'color: {{VALUE}};',
569 ],
570 ]
571 );
572
573
574 $this->add_responsive_control(
575 'text_margin',
576 [
577 'label' => __('Margin', 'ultimate-post-kit'),
578 'type' => Controls_Manager::DIMENSIONS,
579 'size_units' => ['px', 'em', '%'],
580 'selectors' => [
581 '{{WRAPPER}} .upk-camux-slider .upk-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
582 ],
583 ]
584 );
585
586 $this->add_responsive_control(
587 'text_width',
588 [
589 'label' => esc_html__('Max Width', 'ultimate-post-kit'),
590 'type' => Controls_Manager::SLIDER,
591 'size_units' => ['px', '%'],
592 'range' => [
593 'px' => [
594 'min' => 100,
595 'max' => 800,
596 ],
597 '%' => [
598 'min' => 10,
599 'max' => 100,
600 ],
601 ],
602 'selectors' => [
603 '{{WRAPPER}} .upk-camux-slider .upk-text' => 'max-width: {{SIZE}}{{UNIT}};',
604 ],
605 ]
606 );
607
608 $this->add_group_control(
609 Group_Control_Typography::get_type(),
610 [
611 'name' => 'text_typography',
612 'label' => esc_html__('Typography', 'ultimate-post-kit'),
613 'selector' => '{{WRAPPER}} .upk-camux-slider .upk-text',
614 ]
615 );
616
617 $this->end_controls_section();
618
619 $this->start_controls_section(
620 'section_style_meta',
621 [
622 'label' => esc_html__('Meta', 'ultimate-post-kit'),
623 'tab' => Controls_Manager::TAB_STYLE,
624 'conditions' => [
625 'relation' => 'or',
626 'terms' => [
627 [
628 'name' => 'show_author',
629 'value' => 'yes'
630 ],
631 [
632 'name' => 'show_date',
633 'value' => 'yes'
634 ],
635 ]
636 ],
637 ]
638 );
639
640 $this->add_control(
641 'meta_color',
642 [
643 'label' => esc_html__('Color', 'ultimate-post-kit'),
644 'type' => Controls_Manager::COLOR,
645 'selectors' => [
646 '{{WRAPPER}} .upk-camux-slider .upk-meta, {{WRAPPER}} .upk-camux-slider .upk-meta .upk-author-wrap .upk-name' => 'color: {{VALUE}};',
647 ],
648 ]
649 );
650
651 $this->add_control(
652 'meta_hover_color',
653 [
654 'label' => esc_html__('Hover Color', 'ultimate-post-kit'),
655 'type' => Controls_Manager::COLOR,
656 'selectors' => [
657 '{{WRAPPER}} .upk-camux-slider .upk-meta .upk-author-wrap .upk-name:hover' => 'color: {{VALUE}};',
658 ],
659 ]
660 );
661
662 $this->add_responsive_control(
663 'meta_space_between',
664 [
665 'label' => esc_html__('Space Between', 'ultimate-post-kit'),
666 'type' => Controls_Manager::SLIDER,
667 'range' => [
668 'px' => [
669 'min' => 0,
670 'max' => 50,
671 ],
672 ],
673 'selectors' => [
674 '{{WRAPPER}} .upk-camux-slider .upk-meta > div:before' => 'margin: 0 {{SIZE}}{{UNIT}};',
675 ],
676 ]
677 );
678
679 $this->add_group_control(
680 Group_Control_Typography::get_type(),
681 [
682 'name' => 'meta_typography',
683 'label' => esc_html__('Typography', 'ultimate-post-kit'),
684 'selector' => '{{WRAPPER}} .upk-camux-slider .upk-meta',
685 ]
686 );
687
688 $this->end_controls_section();
689
690 $this->start_controls_section(
691 'section_style_category',
692 [
693 'label' => esc_html__('Category', 'ultimate-post-kit'),
694 'tab' => Controls_Manager::TAB_STYLE,
695 'condition' => [
696 'show_category' => 'yes'
697 ],
698 ]
699 );
700
701 $this->add_responsive_control(
702 'category_bottom_spacing',
703 [
704 'label' => esc_html__('Spacing', 'ultimate-post-kit'),
705 'type' => Controls_Manager::SLIDER,
706 'range' => [
707 'px' => [
708 'min' => 0,
709 'max' => 50,
710 ],
711 ],
712 'selectors' => [
713 '{{WRAPPER}} .upk-camux-slider .upk-category' => 'margin-bottom: {{SIZE}}{{UNIT}};',
714 ],
715 ]
716 );
717
718 $this->start_controls_tabs('tabs_category_style');
719
720 $this->start_controls_tab(
721 'tab_category_normal',
722 [
723 'label' => esc_html__('Normal', 'ultimate-post-kit'),
724 ]
725 );
726
727 $this->add_control(
728 'category_color',
729 [
730 'label' => esc_html__('Color', 'ultimate-post-kit'),
731 'type' => Controls_Manager::COLOR,
732 'selectors' => [
733 '{{WRAPPER}} .upk-camux-slider .upk-category a' => 'color: {{VALUE}};',
734 ],
735 ]
736 );
737
738 $this->add_group_control(
739 Group_Control_Background::get_type(),
740 [
741 'name' => 'category_background',
742 'selector' => '{{WRAPPER}} .upk-camux-slider .upk-category a',
743 ]
744 );
745
746 $this->add_group_control(
747 Group_Control_Border::get_type(),
748 [
749 'name' => 'category_border',
750 'selector' => '{{WRAPPER}} .upk-camux-slider .upk-category a',
751 ]
752 );
753
754 $this->add_responsive_control(
755 'category_border_radius',
756 [
757 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
758 'type' => Controls_Manager::DIMENSIONS,
759 'size_units' => ['px', '%'],
760 'selectors' => [
761 '{{WRAPPER}} .upk-camux-slider .upk-category a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
762 ],
763 ]
764 );
765
766 $this->add_responsive_control(
767 'category_padding',
768 [
769 'label' => esc_html__('Padding', 'ultimate-post-kit'),
770 'type' => Controls_Manager::DIMENSIONS,
771 'size_units' => ['px', 'em', '%'],
772 'selectors' => [
773 '{{WRAPPER}} .upk-camux-slider .upk-category a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
774 ],
775 ]
776 );
777
778 $this->add_responsive_control(
779 'category_spacing',
780 [
781 'label' => esc_html__('Space Between', 'ultimate-post-kit'),
782 'type' => Controls_Manager::SLIDER,
783 'range' => [
784 'px' => [
785 'min' => 0,
786 'max' => 50,
787 ],
788 ],
789 'selectors' => [
790 '{{WRAPPER}} .upk-camux-slider .upk-category a+a' => 'margin-left: {{SIZE}}{{UNIT}};',
791 ],
792 ]
793 );
794
795 $this->add_group_control(
796 Group_Control_Box_Shadow::get_type(),
797 [
798 'name' => 'category_shadow',
799 'selector' => '{{WRAPPER}} .upk-camux-slider .upk-category a',
800 ]
801 );
802
803 $this->add_group_control(
804 Group_Control_Typography::get_type(),
805 [
806 'name' => 'category_typography',
807 'label' => esc_html__('Typography', 'ultimate-post-kit'),
808 'selector' => '{{WRAPPER}} .upk-camux-slider .upk-category a',
809 ]
810 );
811
812 $this->end_controls_tab();
813
814 $this->start_controls_tab(
815 'tab_category_hover',
816 [
817 'label' => esc_html__('Hover', 'ultimate-post-kit'),
818 'condition' => [
819 'show_category' => 'yes'
820 ]
821 ]
822 );
823
824 $this->add_control(
825 'category_hover_color',
826 [
827 'label' => esc_html__('Color', 'ultimate-post-kit'),
828 'type' => Controls_Manager::COLOR,
829 'selectors' => [
830 '{{WRAPPER}} .upk-camux-slider .upk-category a:hover' => 'color: {{VALUE}};',
831 ],
832 ]
833 );
834
835 $this->add_group_control(
836 Group_Control_Background::get_type(),
837 [
838 'name' => 'category_hover_background',
839 'selector' => '{{WRAPPER}} .upk-camux-slider .upk-category a:hover',
840 ]
841 );
842
843 $this->add_control(
844 'category_hover_border_color',
845 [
846 'label' => esc_html__('Border Color', 'ultimate-post-kit'),
847 'type' => Controls_Manager::COLOR,
848 'condition' => [
849 'category_border_border!' => '',
850 ],
851 'selectors' => [
852 '{{WRAPPER}} .upk-camux-slider .upk-category a:hover' => 'border-color: {{VALUE}};',
853 ],
854 ]
855 );
856
857 $this->end_controls_tab();
858
859 $this->end_controls_tabs();
860
861 $this->end_controls_section();
862
863 $this->start_controls_section(
864 'section_style_thumbs',
865 [
866 'label' => esc_html__('Thumbs', 'ultimate-post-kit'),
867 'tab' => Controls_Manager::TAB_STYLE,
868 ]
869 );
870
871 //thumbs width
872 $this->add_responsive_control(
873 'thumbs_width',
874 [
875 'label' => esc_html__('Width', 'ultimate-post-kit') . BDTUPK_NC,
876 'type' => Controls_Manager::SLIDER,
877 'range' => [
878 'px' => [
879 'min' => 200,
880 'max' => 1200,
881 ],
882 ],
883 'selectors' => [
884 '{{WRAPPER}} .upk-camux-thumbs' => 'width: {{SIZE}}{{UNIT}};',
885 ],
886 ]
887 );
888 //thumbs vertical spacing
889 $this->add_responsive_control(
890 'thumbs_vertical_spacing',
891 [
892 'label' => esc_html__('Vertical Spacing', 'ultimate-post-kit') . BDTUPK_NC,
893 'type' => Controls_Manager::SLIDER,
894 'size_units' => ['px'],
895 'range' => [
896 'px' => [
897 'min' => -200,
898 'max' => 200,
899 ],
900 ],
901 'selectors' => [
902 '{{WRAPPER}} .upk-camux-slider' => 'margin-bottom: {{SIZE}}{{UNIT}};',
903 ],
904 ]
905 );
906
907 $this->start_controls_tabs('tabs_thumbs_style');
908
909 $this->start_controls_tab(
910 'tab_thumbs_comments',
911 [
912 'label' => esc_html__('Comments', 'ultimate-post-kit'),
913 'condition' => [
914 'show_comments' => 'yes',
915 ],
916 ]
917 );
918
919 $this->add_control(
920 'comments_color',
921 [
922 'label' => esc_html__('Color', 'ultimate-post-kit'),
923 'type' => Controls_Manager::COLOR,
924 'selectors' => [
925 '{{WRAPPER}} .upk-camux-thumbs .upk-comments' => 'color: {{VALUE}};',
926 ],
927 'condition' => [
928 'show_comments' => 'yes',
929 ],
930 ]
931 );
932
933 $this->add_group_control(
934 Group_Control_Background::get_type(),
935 [
936 'name' => 'comments_background',
937 'selector' => '{{WRAPPER}} .upk-camux-thumbs .upk-comments',
938 'condition' => [
939 'show_comments' => 'yes',
940 ],
941 ]
942 );
943
944 $this->add_group_control(
945 Group_Control_Border::get_type(),
946 [
947 'name' => 'thumbs_comments_border',
948 'selector' => '{{WRAPPER}} .upk-camux-thumbs .upk-comments',
949 'condition' => [
950 'show_comments' => 'yes',
951 ],
952 ]
953 );
954
955 $this->add_responsive_control(
956 'thumbs_comments_border_radius',
957 [
958 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
959 'type' => Controls_Manager::DIMENSIONS,
960 'size_units' => ['px', '%'],
961 'selectors' => [
962 '{{WRAPPER}} .upk-camux-thumbs .upk-comments' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
963 ],
964 'condition' => [
965 'show_comments' => 'yes',
966 ],
967 ]
968 );
969
970 $this->add_responsive_control(
971 'comments_padding',
972 [
973 'label' => __('Padding', 'ultimate-post-kit'),
974 'type' => Controls_Manager::DIMENSIONS,
975 'size_units' => ['px', 'em', '%'],
976 'selectors' => [
977 '{{WRAPPER}} .upk-camux-thumbs .upk-comments' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
978 ],
979 'condition' => [
980 'show_comments' => 'yes',
981 ],
982 ]
983 );
984
985 $this->add_responsive_control(
986 'comments_margin',
987 [
988 'label' => __('Margin', 'ultimate-post-kit'),
989 'type' => Controls_Manager::DIMENSIONS,
990 'size_units' => ['px', 'em', '%'],
991 'selectors' => [
992 '{{WRAPPER}} .upk-camux-thumbs .upk-comments' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
993 ],
994 'condition' => [
995 'show_comments' => 'yes',
996 ],
997 ]
998 );
999
1000 $this->add_group_control(
1001 Group_Control_Typography::get_type(),
1002 [
1003 'name' => 'comments_typography',
1004 'label' => esc_html__('Typography', 'ultimate-post-kit'),
1005 'selector' => '{{WRAPPER}} .upk-camux-thumbs .upk-comments',
1006 'condition' => [
1007 'show_comments' => 'yes',
1008 ],
1009 ]
1010 );
1011
1012 $this->end_controls_tab();
1013
1014 $this->start_controls_tab(
1015 'tab_thumbs_normal',
1016 [
1017 'label' => esc_html__('Normal', 'ultimate-post-kit'),
1018 ]
1019 );
1020
1021 $this->add_responsive_control(
1022 'thumbs_opacity',
1023 [
1024 'label' => esc_html__('Opacity', 'ultimate-post-kit'),
1025 'type' => Controls_Manager::SLIDER,
1026 'range' => [
1027 'px' => [
1028 'min' => 0,
1029 'max' => 1,
1030 'step' => 0.1,
1031 ],
1032 ],
1033 'selectors' => [
1034 '{{WRAPPER}} .upk-camux-thumbs .upk-item' => 'opacity: {{SIZE}};',
1035 ],
1036 ]
1037 );
1038
1039 $this->add_group_control(
1040 Group_Control_Border::get_type(),
1041 [
1042 'name' => 'thumbs_image_border',
1043 'selector' => '{{WRAPPER}} .upk-camux-thumbs .upk-item',
1044 ]
1045 );
1046
1047 $this->add_responsive_control(
1048 'thumbs_image_border_radius',
1049 [
1050 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
1051 'type' => Controls_Manager::DIMENSIONS,
1052 'size_units' => ['px', '%'],
1053 'selectors' => [
1054 '{{WRAPPER}} .upk-camux-thumbs .upk-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1055 ],
1056 ]
1057 );
1058
1059 $this->end_controls_tab();
1060
1061 $this->start_controls_tab(
1062 'tab_thumbs_active_item',
1063 [
1064 'label' => esc_html__('Active', 'ultimate-post-kit'),
1065 ]
1066 );
1067
1068 $this->add_responsive_control(
1069 'thumbs_active_opacity',
1070 [
1071 'label' => esc_html__('Opacity', 'ultimate-post-kit'),
1072 'type' => Controls_Manager::SLIDER,
1073 'range' => [
1074 'px' => [
1075 'min' => 0,
1076 'max' => 1,
1077 'step' => 0.1,
1078 ],
1079 ],
1080 'selectors' => [
1081 '{{WRAPPER}} .upk-camux-thumbs .upk-item.swiper-slide-active' => 'opacity: {{SIZE}};',
1082 ],
1083 ]
1084 );
1085
1086 $this->add_control(
1087 'item_active_border_color',
1088 [
1089 'label' => esc_html__('Border Color', 'ultimate-post-kit'),
1090 'type' => Controls_Manager::COLOR,
1091 'condition' => [
1092 'thumbs_image_border_border!' => '',
1093 ],
1094 'selectors' => [
1095 '{{WRAPPER}} .upk-camux-thumbs .upk-item.swiper-slide-active' => 'border-color: {{VALUE}};',
1096 ],
1097 ]
1098 );
1099
1100 $this->add_control(
1101 'comments_heading',
1102 [
1103 'label' => esc_html__('Comments', 'ultimate-post-kit'),
1104 'type' => Controls_Manager::HEADING,
1105 'condition' => [
1106 'show_comments' => 'yes',
1107 ],
1108 'separator' => 'before'
1109 ]
1110 );
1111
1112 $this->add_control(
1113 'comments_active_color',
1114 [
1115 'label' => esc_html__('Color', 'ultimate-post-kit'),
1116 'type' => Controls_Manager::COLOR,
1117 'selectors' => [
1118 '{{WRAPPER}} .upk-camux-thumbs .swiper-slide-active .upk-comments' => 'color: {{VALUE}};',
1119 ],
1120 'condition' => [
1121 'show_comments' => 'yes',
1122 ],
1123 ]
1124 );
1125
1126 $this->add_group_control(
1127 Group_Control_Background::get_type(),
1128 [
1129 'name' => 'comments_active_background',
1130 'selector' => '{{WRAPPER}} .upk-camux-thumbs .swiper-slide-active .upk-comments',
1131 'condition' => [
1132 'show_comments' => 'yes',
1133 ],
1134 ]
1135 );
1136
1137 $this->add_control(
1138 'comments_active_border_color',
1139 [
1140 'label' => esc_html__('Border Color', 'ultimate-post-kit'),
1141 'type' => Controls_Manager::COLOR,
1142 'condition' => [
1143 'thumbs_comments_border_border!' => '',
1144 'show_comments' => 'yes',
1145 ],
1146 'selectors' => [
1147 '{{WRAPPER}} .upk-camux-thumbs .swiper-slide-active .upk-comments' => 'border-color: {{VALUE}};',
1148 ],
1149 ]
1150 );
1151
1152 $this->end_controls_tab();
1153
1154 $this->end_controls_tabs();
1155
1156 $this->end_controls_section();
1157
1158 $this->start_controls_section(
1159 'section_style_navigation',
1160 [
1161 'label' => __('Navigation', 'ultimate-post-kit') . BDTUPK_NC,
1162 'tab' => Controls_Manager::TAB_STYLE,
1163 'condition' => [
1164 'show_navigation' => 'yes',
1165 ],
1166 ]
1167 );
1168
1169 $this->add_control(
1170 'nav_arrows_icon',
1171 [
1172 'label' => esc_html__('Arrows Icon', 'ultimate-post-kit'),
1173 'type' => Controls_Manager::SELECT,
1174 'default' => '0',
1175 'options' => [
1176 '0' => esc_html__('Default', 'ultimate-post-kit'),
1177 '1' => esc_html__('Style 1', 'ultimate-post-kit'),
1178 '2' => esc_html__('Style 2', 'ultimate-post-kit'),
1179 '3' => esc_html__('Style 3', 'ultimate-post-kit'),
1180 '4' => esc_html__('Style 4', 'ultimate-post-kit'),
1181 '5' => esc_html__('Style 5', 'ultimate-post-kit'),
1182 '6' => esc_html__('Style 6', 'ultimate-post-kit'),
1183 '7' => esc_html__('Style 7', 'ultimate-post-kit'),
1184 '8' => esc_html__('Style 8', 'ultimate-post-kit'),
1185 '9' => esc_html__('Style 9', 'ultimate-post-kit'),
1186 '10' => esc_html__('Style 10', 'ultimate-post-kit'),
1187 '11' => esc_html__('Style 11', 'ultimate-post-kit'),
1188 '12' => esc_html__('Style 12', 'ultimate-post-kit'),
1189 '13' => esc_html__('Style 13', 'ultimate-post-kit'),
1190 '14' => esc_html__('Style 14', 'ultimate-post-kit'),
1191 '15' => esc_html__('Style 15', 'ultimate-post-kit'),
1192 '16' => esc_html__('Style 16', 'ultimate-post-kit'),
1193 '17' => esc_html__('Style 17', 'ultimate-post-kit'),
1194 '18' => esc_html__('Style 18', 'ultimate-post-kit'),
1195 'circle-1' => esc_html__('Style 19', 'ultimate-post-kit'),
1196 'circle-2' => esc_html__('Style 20', 'ultimate-post-kit'),
1197 'circle-3' => esc_html__('Style 21', 'ultimate-post-kit'),
1198 'circle-4' => esc_html__('Style 22', 'ultimate-post-kit'),
1199 'square-1' => esc_html__('Style 23', 'ultimate-post-kit'),
1200 ],
1201 ]
1202 );
1203
1204 $this->start_controls_tabs('tabs_navigation_arrows_style');
1205
1206 $this->start_controls_tab(
1207 'tabs_nav_arrows_normal',
1208 [
1209 'label' => __('Normal', 'ultimate-post-kit'),
1210 ]
1211 );
1212
1213 $this->add_control(
1214 'arrows_color',
1215 [
1216 'label' => __('Color', 'ultimate-post-kit'),
1217 'type' => Controls_Manager::COLOR,
1218 'selectors' => [
1219 '{{WRAPPER}} .upk-navigation-prev i, {{WRAPPER}} .upk-navigation-next i' => 'color: {{VALUE}}',
1220 ],
1221 ]
1222 );
1223
1224 $this->add_group_control(
1225 Group_Control_Background::get_type(),
1226 [
1227 'name' => 'arrows_background',
1228 'selector' => '{{WRAPPER}} .upk-navigation-prev, {{WRAPPER}} .upk-navigation-next',
1229 ]
1230 );
1231
1232 $this->add_group_control(
1233 Group_Control_Border::get_type(),
1234 [
1235 'name' => 'nav_arrows_border',
1236 'selector' => '{{WRAPPER}} .upk-navigation-prev, {{WRAPPER}} .upk-navigation-next',
1237 'separator' => 'before',
1238 ]
1239 );
1240
1241 $this->add_responsive_control(
1242 'border_radius',
1243 [
1244 'label' => __('Border Radius', 'ultimate-post-kit'),
1245 'type' => Controls_Manager::DIMENSIONS,
1246 'size_units' => ['px', '%'],
1247 'selectors' => [
1248 '{{WRAPPER}} .upk-navigation-prev, {{WRAPPER}} .upk-navigation-next' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1249 ],
1250 ]
1251 );
1252
1253 $this->add_responsive_control(
1254 'arrows_padding',
1255 [
1256 'label' => esc_html__('Padding', 'ultimate-post-kit'),
1257 'type' => Controls_Manager::DIMENSIONS,
1258 'size_units' => ['px', 'em', '%'],
1259 'selectors' => [
1260 '{{WRAPPER}} .upk-navigation-prev, {{WRAPPER}} .upk-navigation-next' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1261 ],
1262 ]
1263 );
1264
1265 $this->add_responsive_control(
1266 'arrows_spacing',
1267 [
1268 'label' => __('Spacing', 'ultimate-post-kit'),
1269 'type' => Controls_Manager::SLIDER,
1270 'range' => [
1271 'px' => [
1272 'min' => 0,
1273 'max' => 100,
1274 ],
1275 ],
1276 'default' => [
1277 'size' => 30,
1278 ],
1279 'selectors' => [
1280 '{{WRAPPER}} .upk-navigation-prev' => 'margin-left: {{SIZE}}px;',
1281 '{{WRAPPER}} .upk-navigation-next' => 'margin-right: {{SIZE}}px;',
1282 ],
1283 ]
1284 );
1285
1286 $this->add_responsive_control(
1287 'arrows_size',
1288 [
1289 'label' => __('Size', 'ultimate-post-kit'),
1290 'type' => Controls_Manager::SLIDER,
1291 'range' => [
1292 'px' => [
1293 'min' => 10,
1294 'max' => 100,
1295 ],
1296 ],
1297 'selectors' => [
1298 '{{WRAPPER}} .upk-navigation-prev i, {{WRAPPER}} .upk-navigation-next i' => 'font-size: {{SIZE || 24}}{{UNIT}};',
1299 ],
1300 ]
1301 );
1302 // box shadow
1303 $this->add_group_control(
1304 Group_Control_Box_Shadow::get_type(),
1305 [
1306 'name' => 'arrows_box_shadow',
1307 'selector' => '{{WRAPPER}} .upk-navigation-prev, {{WRAPPER}} .upk-navigation-next',
1308 ]
1309 );
1310
1311 $this->end_controls_tab();
1312
1313 $this->start_controls_tab(
1314 'tabs_nav_arrows_hover',
1315 [
1316 'label' => __('Hover', 'ultimate-post-kit'),
1317 ]
1318 );
1319
1320 $this->add_control(
1321 'arrows_hover_color',
1322 [
1323 'label' => __('Color', 'ultimate-post-kit'),
1324 'type' => Controls_Manager::COLOR,
1325 'selectors' => [
1326 '{{WRAPPER}} .upk-navigation-prev:hover i, {{WRAPPER}} .upk-navigation-next:hover i' => 'color: {{VALUE}}',
1327 ],
1328 ]
1329 );
1330
1331 $this->add_group_control(
1332 Group_Control_Background::get_type(),
1333 [
1334 'name' => 'arrows_hover_background',
1335 'selector' => '{{WRAPPER}} .upk-navigation-prev:hover, {{WRAPPER}} .upk-navigation-next:hover',
1336 ]
1337 );
1338
1339 $this->add_control(
1340 'nav_arrows_hover_border_color',
1341 [
1342 'label' => __('Border Color', 'ultimate-post-kit'),
1343 'type' => Controls_Manager::COLOR,
1344 'selectors' => [
1345 '{{WRAPPER}} .upk-navigation-prev:hover, {{WRAPPER}} .upk-navigation-next:hover' => 'border-color: {{VALUE}};',
1346 ],
1347 'condition' => [
1348 'nav_arrows_border_border!' => '',
1349 ],
1350 ]
1351 );
1352 // box shadow
1353 $this->add_group_control(
1354 Group_Control_Box_Shadow::get_type(),
1355 [
1356 'name' => 'arrows_hover_box_shadow',
1357 'selector' => '{{WRAPPER}} .upk-navigation-prev:hover, {{WRAPPER}} .upk-navigation-next:hover',
1358 ]
1359 );
1360
1361 $this->end_controls_tab();
1362
1363 $this->end_controls_tabs();
1364
1365 $this->end_controls_section();
1366 }
1367
1368 /**
1369 * Main query render for this widget
1370 * @param $posts_per_page number item query limit
1371 */
1372 public function query_posts($posts_per_page) {
1373
1374 $default = $this->getGroupControlQueryArgs();
1375 $args = [];
1376 if ($posts_per_page) {
1377 $args['posts_per_page'] = $posts_per_page;
1378 // $args['paged'] = max(1, get_query_var('paged'), get_query_var('page'));
1379 }
1380 $args = array_merge($default, $args);
1381 $this->_query = new WP_Query($args);
1382 }
1383
1384 public function render_author() {
1385
1386 if (!$this->get_settings('show_author')) {
1387 return;
1388 }
1389 ?>
1390 <div class="upk-author-wrap">
1391 <span class="upk-by"><?php echo esc_html_x('by', 'Frontend', 'ultimate-post-kit') ?></span>
1392 <a class="upk-name" href="<?php echo esc_url( get_author_posts_url(get_the_author_meta('ID')) ); ?>">
1393 <?php echo esc_html( get_the_author() ); ?>
1394 </a>
1395 </div>
1396 <?php
1397 }
1398
1399 public function render_comments($id = 0) {
1400
1401 if (!$this->get_settings('show_comments')) {
1402 return;
1403 }
1404 ?>
1405
1406 <div class="upk-comments">
1407 <?php echo get_comments_number($id) ?>
1408 <i class="upk-icon-bubble"></i>
1409 </div>
1410
1411 <?php
1412 }
1413
1414 public function render_header() {
1415 $id = 'upk-camux-slider-' . $this->get_id();
1416 $settings = $this->get_settings_for_display();
1417
1418 $this->add_render_attribute('camux-slider', 'id', $id);
1419 $this->add_render_attribute('camux-slider', 'class', ['upk-camux-slider']);
1420
1421 $this->add_render_attribute(
1422 [
1423 'camux-slider' => [
1424 'data-settings' => [
1425 wp_json_encode(array_filter([
1426 "autoplay" => ("yes" == $settings["autoplay"]) ? ["delay" => $settings["autoplay_speed"]] : false,
1427 "loop" => ($settings["loop"] == "yes") ? true : false,
1428 "speed" => $settings["speed"]["size"],
1429 "effect" => 'fade',
1430 "fadeEffect" => ['crossFade' => true],
1431 "lazy" => true,
1432 "parallax" => true,
1433 "grabCursor" => ($settings["grab_cursor"] === "yes") ? true : false,
1434 "pauseOnHover" => ("yes" == $settings["pauseonhover"]) ? true : false,
1435 "slidesPerView" => 1,
1436 "observer" => ($settings["observer"]) ? true : false,
1437 "observeParents" => ($settings["observer"]) ? true : false,
1438 "loopedSlides" => 4,
1439 "lazy" => [
1440 "loadPrevNext" => "true",
1441 ],
1442 "navigation" => [
1443 "nextEl" => "#$id .upk-navigation-next",
1444 "prevEl" => "#$id .upk-navigation-prev",
1445 ],
1446 ]))
1447 ]
1448 ]
1449 ]
1450 );
1451
1452 $this->add_render_attribute('swiper', 'class', 'swiper-carousel swiper');
1453
1454 ?>
1455 <div <?php $this->print_render_attribute_string('camux-slider'); ?>>
1456 <div <?php $this->print_render_attribute_string('swiper'); ?>>
1457 <div class="swiper-wrapper">
1458 <?php
1459 }
1460
1461 public function render_footer() {
1462 $settings = $this->get_settings_for_display();
1463
1464 ?>
1465
1466 </div>
1467 <?php if ($settings['show_navigation']) : ?>
1468 <div class="upk-navigation-wrap">
1469 <div class="upk-navigation-prev">
1470 <i class="upk-icon-arrow-left-<?php echo esc_html($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i>
1471 </div>
1472 <div class="upk-navigation-next">
1473 <i class="upk-icon-arrow-right-<?php echo esc_html($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i>
1474 </div>
1475 </div>
1476 <?php endif; ?>
1477 </div>
1478 </div>
1479
1480 <?php
1481 }
1482
1483 public function render_post_grid_item($post_id, $image_size, $excerpt_length) {
1484 $settings = $this->get_settings_for_display();
1485
1486 $this->add_render_attribute('slider-item', 'class', 'upk-item swiper-slide', true);
1487
1488 ?>
1489 <div <?php $this->print_render_attribute_string('slider-item'); ?>>
1490 <div class="upk-img-wrap">
1491 <?php $this->render_image(get_post_thumbnail_id($post_id), $image_size); ?>
1492 </div>
1493
1494 <div class="upk-content">
1495
1496 <?php if ($settings['show_category']) : ?>
1497 <div data-swiper-parallax-y="-150" data-swiper-parallax-duration="700">
1498 <?php $this->render_category(); ?>
1499 </div>
1500 <?php endif; ?>
1501
1502 <?php if ($settings['show_title']) : ?>
1503 <div data-swiper-parallax-y="-100" data-swiper-parallax-duration="800">
1504 <?php $this->render_title(substr($this->get_name(), 4)); ?>
1505 </div>
1506 <?php endif; ?>
1507
1508 <?php if ($settings['show_excerpt']) : ?>
1509 <div class="upk-inline-block" data-swiper-parallax-y="-80" data-swiper-parallax-duration="900">
1510 <?php $this->render_excerpt($excerpt_length); ?>
1511 </div>
1512 <?php endif; ?>
1513
1514 <?php if ($settings['show_author'] or $settings['show_date'] or $settings['show_reading_time']) : ?>
1515 <div class="upk-meta" data-swiper-parallax-y="-50" data-swiper-parallax-duration="1000">
1516 <?php if ($settings['show_author']) : ?>
1517 <?php $this->render_author(); ?>
1518 <?php endif; ?>
1519 <?php if ($settings['show_date']) : ?>
1520 <div data-separator="<?php echo esc_html($settings['meta_separator']); ?>">
1521 <?php $this->render_date(); ?>
1522 </div>
1523 <?php endif; ?>
1524 <?php if (_is_upk_pro_activated()) :
1525 if ('yes' === $settings['show_reading_time']) : ?>
1526 <div class="upk-reading-time" data-separator="<?php echo esc_html($settings['meta_separator']); ?>">
1527 <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'], $settings['hide_seconds'] ?? 'no', $settings['hide_minutes'] ?? 'no' ) ); ?>
1528 </div>
1529 <?php endif; ?>
1530 <?php endif; ?>
1531 </div>
1532 <?php endif; ?>
1533
1534 </div>
1535 </div>
1536 <?php
1537 }
1538
1539 public function render_thumbnav($post_id, $image_size) {
1540 $settings = $this->get_settings_for_display();
1541
1542 $this->add_render_attribute('thumb-item', 'class', 'upk-item swiper-slide', true);
1543
1544 ?>
1545 <div <?php $this->print_render_attribute_string('thumb-item'); ?>>
1546 <div class="upk-img-wrap">
1547 <?php $this->render_image(get_post_thumbnail_id($post_id), $image_size); ?>
1548 </div>
1549 <?php $this->render_comments($post_id); ?>
1550 </div>
1551 <?php
1552
1553 }
1554
1555 public function render() {
1556 $settings = $this->get_settings_for_display();
1557
1558 $this->query_posts($settings['item_limit']['size']);
1559 $wp_query = $this->get_query();
1560
1561 if (!$wp_query->found_posts) {
1562 return;
1563 }
1564
1565 $this->add_render_attribute('swiper-thumbs', 'class', 'upk-camux-thumbs swiper');
1566
1567 ?>
1568 <div class="upk-camux-slider-wrap">
1569 <?php
1570
1571 $this->render_header();
1572
1573 while ($wp_query->have_posts()) {
1574 $wp_query->the_post();
1575 $thumbnail_size = $settings['primary_thumbnail_size'];
1576
1577 $this->render_post_grid_item(get_the_ID(), $thumbnail_size, $settings['excerpt_length']);
1578 }
1579
1580 $this->render_footer();
1581
1582 ?>
1583 <div thumbsSlider="" <?php $this->print_render_attribute_string('swiper-thumbs'); ?>>
1584 <div class="swiper-wrapper">
1585 <?php
1586
1587 while ($wp_query->have_posts()) {
1588 $wp_query->the_post();
1589 $thumbnail_size = $settings['primary_thumbnail_size'];
1590
1591 $this->render_thumbnav(get_the_ID(), $thumbnail_size);
1592 }
1593
1594 ?>
1595 </div>
1596 </div>
1597 </div>
1598
1599 <?php
1600 wp_reset_postdata();
1601 }
1602 }
1603