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

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