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

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