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

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