PluginProbe
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets / 4.5.6
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets v4.5.6
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 / alex-carousel / widgets / alex-carousel.php

alex-carousel.php in Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets 4.5.6, at modules/alex-carousel/widgets/alex-carousel.php

1,515 lines 38.2 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\AlexCarousel\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_Background;
12
13 use UltimatePostKit\Traits\Global_Widget_Controls;
14 use UltimatePostKit\Traits\Global_Widget_Functions;
15 use UltimatePostKit\Traits\Global_Swiper_Functions;
16 use UltimatePostKit\Includes\Controls\GroupQuery\Group_Control_Query;
17 use WP_Query;
18
19 if (!defined('ABSPATH')) {
20 exit;
21 } // Exit if accessed directly
22
23 class Alex_Carousel extends Group_Control_Query {
24
25 use Global_Widget_Controls;
26 use Global_Widget_Functions;
27 use Global_Swiper_Functions;
28
29 private $_query = null;
30
31 public function get_name() {
32 return 'upk-alex-carousel';
33 }
34
35 public function get_title() {
36 return BDTUPK . esc_html__('Alex Carousel', 'ultimate-post-kit');
37 }
38
39 public function get_icon() {
40 return 'upk-widget-icon upk-icon-alex-carousel';
41 }
42
43 public function get_categories() {
44 return ['ultimate-post-kit'];
45 }
46
47 public function get_keywords() {
48 return ['post', 'carousel', 'blog', 'recent', 'news', 'alex'];
49 }
50
51 public function get_style_depends() {
52 if ($this->upk_is_edit_mode()) {
53 return ['swiper', 'upk-all-styles'];
54 } else {
55 return ['swiper', 'upk-font', 'upk-alex-carousel'];
56 }
57 }
58
59 public function get_script_depends() {
60 if ($this->upk_is_edit_mode()) {
61 return ['swiper', 'upk-all-scripts'];
62 } else {
63 return ['swiper', 'upk-alex-carousel'];
64 }
65 }
66
67 public function get_custom_help_url() {
68 return 'https://youtu.be/nmMajegrTiM';
69 }
70
71
72 public function get_query() {
73 return $this->_query;
74 }
75
76 public function has_widget_inner_wrapper(): bool {
77 return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
78 }
79
80
81 protected function register_controls() {
82 $this->start_controls_section(
83 'section_content_layout',
84 [
85 'label' => esc_html__('Layout', 'ultimate-post-kit'),
86 ]
87 );
88
89 $this->add_responsive_control(
90 'columns',
91 [
92 'label' => esc_html__('Columns', 'ultimate-post-kit'),
93 'type' => Controls_Manager::SELECT,
94 'default' => 3,
95 'tablet_default' => 2,
96 'mobile_default' => 1,
97 'options' => [
98 1 => esc_html__('1', 'ultimate-post-kit'),
99 2 => esc_html__('2', 'ultimate-post-kit'),
100 3 => esc_html__('3', 'ultimate-post-kit'),
101 4 => esc_html__('4', 'ultimate-post-kit'),
102 5 => esc_html__('5', 'ultimate-post-kit'),
103 6 => esc_html__('6', 'ultimate-post-kit'),
104 ],
105 ]
106 );
107
108 $this->add_responsive_control(
109 'item_gap',
110 [
111 'label' => esc_html__('Item Gap', 'ultimate-post-kit'),
112 'type' => Controls_Manager::SLIDER,
113 'default' => [
114 'size' => 20,
115 ],
116 'tablet_default' => [
117 'size' => 20,
118 ],
119 'mobile_default' => [
120 'size' => 20,
121 ],
122 'range' => [
123 'px' => [
124 'min' => 0,
125 'max' => 100,
126 ],
127 ],
128 ]
129 );
130
131 $this->add_responsive_control(
132 'item_height',
133 [
134 'label' => esc_html__('Item Height(px)', 'ultimate-post-kit'),
135 'type' => Controls_Manager::SLIDER,
136 'range' => [
137 'px' => [
138 'min' => 200,
139 'max' => 600,
140 ],
141 ],
142 'selectors' => [
143 '{{WRAPPER}} .upk-alex-carousel .upk-item' => 'height: {{SIZE}}{{UNIT}};',
144 ],
145 ]
146 );
147
148 $this->add_group_control(
149 Group_Control_Image_Size::get_type(),
150 [
151 'name' => 'primary_thumbnail',
152 // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Elementor widget query built from user-configured controls; expected behaviour.
153 'exclude' => ['custom'],
154 'default' => 'medium',
155 ]
156 );
157
158 $this->add_control(
159 'content_position',
160 [
161 'label' => esc_html__('Content Position', 'ultimate-post-kit'),
162 'type' => Controls_Manager::CHOOSE,
163 'toggle' => false,
164 'default' => 'right',
165 'options' => [
166 'left' => [
167 'title' => esc_html__('Left', 'ultimate-post-kit'),
168 'icon' => 'eicon-h-align-left',
169 ],
170 'right' => [
171 'title' => esc_html__('Right', 'ultimate-post-kit'),
172 'icon' => 'eicon-h-align-right',
173 ],
174 ],
175 ]
176 );
177
178 $this->end_controls_section();
179
180 // Query Settings
181 $this->start_controls_section(
182 'section_post_query_builder',
183 [
184 'label' => esc_html__('Query', 'ultimate-post-kit'),
185 'tab' => Controls_Manager::TAB_CONTENT,
186 ]
187 );
188
189 $this->add_control(
190 'item_limit',
191 [
192 'label' => esc_html__('Item Limit', 'ultimate-post-kit'),
193 'type' => Controls_Manager::SLIDER,
194 'range' => [
195 'px' => [
196 'min' => 1,
197 'max' => 20,
198 ],
199 ],
200 'default' => [
201 'size' => 6,
202 ],
203 'condition' => [
204 'posts_source!' => 'current_query',
205 ]
206 ]
207 );
208
209 $this->register_query_builder_controls();
210
211 $this->end_controls_section();
212
213 $this->start_controls_section(
214 'section_content_additional',
215 [
216 'label' => esc_html__('Additional Options', 'ultimate-post-kit'),
217 ]
218 );
219
220 //Global Title Controls
221 $this->register_title_controls();
222
223 $this->add_control(
224 'show_category',
225 [
226 'label' => esc_html__('Category', 'ultimate-post-kit'),
227 'type' => Controls_Manager::SWITCHER,
228 'default' => 'yes',
229 ]
230 );
231
232 $this->add_control(
233 'show_readmore',
234 [
235 'label' => esc_html__('Read More', 'ultimate-post-kit'),
236 'type' => Controls_Manager::SWITCHER,
237 'default' => 'yes',
238 ]
239 );
240
241 $this->add_control(
242 'show_author',
243 [
244 'label' => esc_html__('Author', 'ultimate-post-kit'),
245 'type' => Controls_Manager::SWITCHER,
246 'default' => 'yes',
247 ]
248 );
249
250 //Global Date Controls
251 $this->register_date_controls();
252 //Global Reading Time Controls
253 $this->register_reading_time_controls();
254
255 $this->add_control(
256 'meta_separator',
257 [
258 'label' => esc_html__('Separator', 'ultimate-post-kit'),
259 'type' => Controls_Manager::TEXT,
260 'default' => '|',
261 'label_block' => false,
262 ]
263 );
264
265 $this->add_control(
266 'show_post_format',
267 [
268 'label' => esc_html__('Post Format', 'ultimate-post-kit'),
269 'type' => Controls_Manager::SWITCHER,
270 'separator' => 'before'
271 ]
272 );
273
274 $this->add_control(
275 'global_link',
276 [
277 'label' => esc_html__('Item Wrapper Link', 'ultimate-post-kit'),
278 'type' => Controls_Manager::SWITCHER,
279 'prefix_class' => 'upk-global-link-',
280 'description' => esc_html__('Be aware! When Item Wrapper Link activated then title link and read more link will not work', 'ultimate-post-kit'),
281 'separator' => 'before'
282 ]
283 );
284
285 $this->end_controls_section();
286
287 //Navigaiton Global Controls
288 $this->register_navigation_controls('alex');
289
290 //Style
291 $this->start_controls_section(
292 'upk_section_style',
293 [
294 'label' => esc_html__('Items', 'ultimate-post-kit'),
295 'tab' => Controls_Manager::TAB_STYLE,
296 ]
297 );
298
299 $this->start_controls_tabs('tabs_item_style');
300
301 $this->start_controls_tab(
302 'tab_item_normal',
303 [
304 'label' => esc_html__('Normal', 'ultimate-post-kit'),
305 ]
306 );
307
308 $this->add_responsive_control(
309 'item_border_radius',
310 [
311 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
312 'type' => Controls_Manager::DIMENSIONS,
313 'size_units' => ['px', '%'],
314 'selectors' => [
315 '{{WRAPPER}} .upk-alex-carousel .upk-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
316 ],
317 ]
318 );
319
320 $this->add_group_control(
321 Group_Control_Box_Shadow::get_type(),
322 [
323 'name' => 'item_box_shadow',
324 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-item',
325 ]
326 );
327
328 $this->end_controls_tab();
329
330 $this->start_controls_tab(
331 'tab_item_hover',
332 [
333 'label' => esc_html__('Hover', 'ultimate-post-kit'),
334 ]
335 );
336
337 $this->add_group_control(
338 Group_Control_Box_Shadow::get_type(),
339 [
340 'name' => 'item_box_shadow_hover',
341 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-item:hover',
342 ]
343 );
344
345 $this->add_responsive_control(
346 'item_shadow_padding',
347 [
348 'label' => esc_html__('Match Padding', 'ultimate-post-kit'),
349 'description' => esc_html__('You have to add padding for matching overlaping normal/hover box shadow when you used Box Shadow option.', 'ultimate-post-kit'),
350 'type' => Controls_Manager::SLIDER,
351 'range' => [
352 'px' => [
353 'min' => 0,
354 'step' => 1,
355 'max' => 50,
356 ]
357 ],
358 'selectors' => [
359 '{{WRAPPER}} .swiper-carousel' => 'padding: {{SIZE}}{{UNIT}}; margin: 0 -{{SIZE}}{{UNIT}};'
360 ],
361 ]
362 );
363
364 $this->end_controls_tab();
365
366 $this->end_controls_tabs();
367
368 $this->end_controls_section();
369
370 $this->start_controls_section(
371 'section_style_content',
372 [
373 'label' => esc_html__('Content', 'ultimate-post-kit'),
374 'tab' => Controls_Manager::TAB_STYLE,
375 ]
376 );
377
378 $this->add_control(
379 'overlay_blur_effect',
380 [
381 'label' => esc_html__('Glass Morphism', 'ultimate-post-kit'),
382 'type' => Controls_Manager::SWITCHER,
383 // translators: %1s: Opening anchor tag with link to MDN backdrop-filter documentation, %2s: Closing anchor tag
384 'description' => sprintf(__('This feature will not work in the Firefox browser untill you enable browser compatibility so please %1$s look here %2$s', 'ultimate-post-kit'), '<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility" target="_blank">', '</a>'),
385 'default' => 'yes',
386 ]
387 );
388
389 $this->add_control(
390 'overlay_blur_level',
391 [
392 'label' => esc_html__('Blur Level', 'ultimate-post-kit'),
393 'type' => Controls_Manager::SLIDER,
394 'range' => [
395 'px' => [
396 'min' => 0,
397 'step' => 1,
398 'max' => 50,
399 ]
400 ],
401 'default' => [
402 'size' => 10
403 ],
404 'selectors' => [
405 '{{WRAPPER}} .upk-alex-carousel .upk-content-wrap' => 'backdrop-filter: blur({{SIZE}}px); -webkit-backdrop-filter: blur({{SIZE}}px);'
406 ],
407 'condition' => [
408 'overlay_blur_effect' => 'yes'
409 ]
410 ]
411 );
412
413 $this->add_group_control(
414 Group_Control_Background::get_type(),
415 [
416 'name' => 'content_background',
417 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-content-wrap',
418 ]
419 );
420
421 $this->add_control(
422 'hr_15',
423 [
424 'type' => Controls_Manager::DIVIDER,
425 ]
426 );
427
428 $this->add_responsive_control(
429 'content_width',
430 [
431 'label' => esc_html__('Width(%)', 'ultimate-post-kit'),
432 'type' => Controls_Manager::SLIDER,
433 'selectors' => [
434 '{{WRAPPER}} .upk-alex-carousel .upk-content-wrap' => 'width: {{SIZE}}%;'
435 ],
436 ]
437 );
438
439 $this->add_responsive_control(
440 'content_height',
441 [
442 'label' => esc_html__('Height(px)', 'ultimate-post-kit'),
443 'type' => Controls_Manager::SLIDER,
444 'range' => [
445 'px' => [
446 'min' => 50,
447 'max' => 500,
448 ],
449 ],
450 'selectors' => [
451 '{{WRAPPER}} .upk-alex-carousel .upk-content' => 'height: {{SIZE}}px;'
452 ],
453 ]
454 );
455
456 $this->add_control(
457 'hr_2',
458 [
459 'type' => Controls_Manager::DIVIDER,
460 ]
461 );
462
463 $this->add_responsive_control(
464 'content_inner_padding',
465 [
466 'label' => esc_html__('Inner Padding', 'ultimate-post-kit'),
467 'type' => Controls_Manager::DIMENSIONS,
468 'size_units' => ['px', 'em', '%'],
469 'selectors' => [
470 '{{WRAPPER}} .upk-alex-carousel .upk-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
471 ],
472 ]
473 );
474
475 $this->end_controls_section();
476
477 $this->start_controls_section(
478 'section_style_title',
479 [
480 'label' => esc_html__('Title', 'ultimate-post-kit'),
481 'tab' => Controls_Manager::TAB_STYLE,
482 'condition' => [
483 'show_title' => 'yes',
484 ],
485 ]
486 );
487
488 $this->add_control(
489 'title_style',
490 [
491 'label' => esc_html__('Style', 'ultimate-post-kit'),
492 'type' => Controls_Manager::SELECT,
493 'default' => '',
494 'options' => [
495 '' => esc_html__('Default', 'ultimate-post-kit'),
496 'underline' => esc_html__('Underline', 'ultimate-post-kit'),
497 'middle-underline' => esc_html__('Middle Underline', 'ultimate-post-kit'),
498 'overline' => esc_html__('Overline', 'ultimate-post-kit'),
499 'middle-overline' => esc_html__('Middle Overline', 'ultimate-post-kit'),
500 ],
501 ]
502 );
503
504 $this->start_controls_tabs('tabs_title_style');
505
506 $this->start_controls_tab(
507 'tab_title_normal',
508 [
509 'label' => esc_html__('Normal', 'ultimate-post-kit'),
510 ]
511 );
512
513 $this->add_control(
514 'title_color',
515 [
516 'label' => esc_html__('Color', 'ultimate-post-kit'),
517 'type' => Controls_Manager::COLOR,
518 'selectors' => [
519 '{{WRAPPER}} .upk-alex-carousel .upk-title a' => 'color: {{VALUE}};',
520 ],
521 ]
522 );
523
524 $this->add_group_control(
525 Group_Control_Typography::get_type(),
526 [
527 'name' => 'title_typography',
528 'label' => esc_html__('Typography', 'ultimate-post-kit'),
529 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-title',
530 ]
531 );
532
533 $this->add_control(
534 'title_advanced_style',
535 [
536 'label' => esc_html__('Advanced Style', 'ultimate-post-kit'),
537 'type' => Controls_Manager::SWITCHER,
538 ]
539 );
540
541 $this->add_group_control(
542 Group_Control_Background::get_type(),
543 [
544 'name' => 'title_background',
545 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-title',
546 'condition' => [
547 'title_advanced_style' => 'yes'
548 ]
549 ]
550 );
551
552 $this->add_group_control(
553 Group_Control_Text_Shadow::get_type(),
554 [
555 'name' => 'title_text_shadow',
556 'label' => esc_html__('Text Shadow', 'ultimate-post-kit'),
557 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-title',
558 'condition' => [
559 'title_advanced_style' => 'yes'
560 ]
561 ]
562 );
563
564 $this->add_group_control(
565 Group_Control_Border::get_type(),
566 [
567 'name' => 'title_border',
568 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-title',
569 'condition' => [
570 'title_advanced_style' => 'yes'
571 ]
572 ]
573 );
574
575 $this->add_responsive_control(
576 'title_border_radius',
577 [
578 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
579 'type' => Controls_Manager::DIMENSIONS,
580 'size_units' => ['px', '%'],
581 'selectors' => [
582 '{{WRAPPER}} .upk-alex-carousel .upk-title' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
583 ],
584 'condition' => [
585 'title_advanced_style' => 'yes'
586 ]
587 ]
588 );
589
590 $this->add_group_control(
591 Group_Control_Box_Shadow::get_type(),
592 [
593 'name' => 'title_box_shadow',
594 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-title',
595 'condition' => [
596 'title_advanced_style' => 'yes'
597 ]
598 ]
599 );
600
601 $this->add_responsive_control(
602 'title_text_padding',
603 [
604 'label' => esc_html__('Padding', 'ultimate-post-kit'),
605 'type' => Controls_Manager::DIMENSIONS,
606 'size_units' => ['px', 'em', '%'],
607 'selectors' => [
608 '{{WRAPPER}} .upk-alex-carousel .upk-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
609 ],
610 'condition' => [
611 'title_advanced_style' => 'yes'
612 ]
613 ]
614 );
615
616 $this->end_controls_tab();
617
618 $this->start_controls_tab(
619 'tab_title_hover',
620 [
621 'label' => esc_html__('Hover', 'ultimate-post-kit'),
622 ]
623 );
624
625 $this->add_control(
626 'title_hover_color',
627 [
628 'label' => esc_html__('Color', 'ultimate-post-kit'),
629 'type' => Controls_Manager::COLOR,
630 'selectors' => [
631 '{{WRAPPER}} .upk-alex-carousel .upk-item:hover .upk-title a' => 'color: {{VALUE}};',
632 ],
633 ]
634 );
635
636 $this->add_control(
637 'title_border_hover_color',
638 [
639 'label' => esc_html__('Border Color', 'ultimate-post-kit'),
640 'type' => Controls_Manager::COLOR,
641 'selectors' => [
642 '{{WRAPPER}} .upk-alex-carousel .upk-item:hover .upk-title' => 'color: {{VALUE}};',
643 ],
644 'condition' => [
645 'title_advanced_style' => 'yes',
646 'title_border_border!' => '',
647 ]
648 ]
649 );
650
651 $this->add_group_control(
652 Group_Control_Background::get_type(),
653 [
654 'name' => 'title_hover_background',
655 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-item:hover .upk-title',
656 'condition' => [
657 'title_advanced_style' => 'yes'
658 ]
659 ]
660 );
661
662 $this->end_controls_tab();
663
664 $this->end_controls_tabs();
665
666 $this->end_controls_section();
667
668 $this->start_controls_section(
669 'section_style_category',
670 [
671 'label' => esc_html__('Category', 'ultimate-post-kit'),
672 'tab' => Controls_Manager::TAB_STYLE,
673 'condition' => [
674 'show_category' => 'yes'
675 ],
676 ]
677 );
678
679 $this->add_responsive_control(
680 'category_bottom_spacing',
681 [
682 'label' => esc_html__('Spacing', 'ultimate-post-kit'),
683 'type' => Controls_Manager::SLIDER,
684 'range' => [
685 'px' => [
686 'min' => 0,
687 'max' => 50,
688 'step' => 2,
689 ],
690 ],
691 'selectors' => [
692 '{{WRAPPER}} .upk-alex-carousel .upk-category' => 'margin-bottom: {{SIZE}}{{UNIT}};',
693 ],
694 ]
695 );
696
697 $this->start_controls_tabs('tabs_category_style');
698
699 $this->start_controls_tab(
700 'tab_category_normal',
701 [
702 'label' => esc_html__('Normal', 'ultimate-post-kit'),
703 ]
704 );
705
706 $this->add_control(
707 'category_color',
708 [
709 'label' => esc_html__('Color', 'ultimate-post-kit'),
710 'type' => Controls_Manager::COLOR,
711 'selectors' => [
712 '{{WRAPPER}} .upk-alex-carousel .upk-category a' => 'color: {{VALUE}};',
713 ],
714 ]
715 );
716
717 $this->add_group_control(
718 Group_Control_Background::get_type(),
719 [
720 'name' => 'category_background',
721 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-category a',
722 ]
723 );
724
725 $this->add_group_control(
726 Group_Control_Border::get_type(),
727 [
728 'name' => 'category_border',
729 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-category a',
730 ]
731 );
732
733 $this->add_responsive_control(
734 'category_border_radius',
735 [
736 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
737 'type' => Controls_Manager::DIMENSIONS,
738 'size_units' => ['px', '%'],
739 'selectors' => [
740 '{{WRAPPER}} .upk-alex-carousel .upk-category a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
741 ],
742 ]
743 );
744
745 $this->add_responsive_control(
746 'category_padding',
747 [
748 'label' => esc_html__('Padding', 'ultimate-post-kit'),
749 'type' => Controls_Manager::DIMENSIONS,
750 'size_units' => ['px', 'em', '%'],
751 'selectors' => [
752 '{{WRAPPER}} .upk-alex-carousel .upk-category a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
753 ],
754 ]
755 );
756
757 $this->add_responsive_control(
758 'category_spacing',
759 [
760 'label' => esc_html__('Spacing Between', 'ultimate-post-kit'),
761 'type' => Controls_Manager::SLIDER,
762 'range' => [
763 'px' => [
764 'min' => 0,
765 'max' => 50,
766 'step' => 2,
767 ],
768 ],
769 'selectors' => [
770 '{{WRAPPER}} .upk-alex-carousel .upk-category a+a' => 'margin-left: {{SIZE}}{{UNIT}};',
771 ],
772 ]
773 );
774
775 $this->add_group_control(
776 Group_Control_Box_Shadow::get_type(),
777 [
778 'name' => 'category_shadow',
779 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-category a',
780 ]
781 );
782
783 $this->add_group_control(
784 Group_Control_Typography::get_type(),
785 [
786 'name' => 'category_typography',
787 'label' => esc_html__('Typography', 'ultimate-post-kit'),
788 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-category a',
789 ]
790 );
791
792 $this->end_controls_tab();
793
794 $this->start_controls_tab(
795 'tab_category_hover',
796 [
797 'label' => esc_html__('Hover', 'ultimate-post-kit'),
798 'condition' => [
799 'show_category' => 'yes'
800 ]
801 ]
802 );
803
804 $this->add_control(
805 'category_hover_color',
806 [
807 'label' => esc_html__('Color', 'ultimate-post-kit'),
808 'type' => Controls_Manager::COLOR,
809 'selectors' => [
810 '{{WRAPPER}} .upk-alex-carousel .upk-category a:hover' => 'color: {{VALUE}};',
811 ],
812 ]
813 );
814
815 $this->add_group_control(
816 Group_Control_Background::get_type(),
817 [
818 'name' => 'category_hover_background',
819 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-category a:hover',
820 ]
821 );
822
823 $this->add_control(
824 'category_hover_border_color',
825 [
826 'label' => esc_html__('Border Color', 'ultimate-post-kit'),
827 'type' => Controls_Manager::COLOR,
828 'condition' => [
829 'category_border_border!' => '',
830 ],
831 'selectors' => [
832 '{{WRAPPER}} .upk-alex-carousel .upk-category a:hover' => 'border-color: {{VALUE}};',
833 ],
834 ]
835 );
836
837 $this->end_controls_tab();
838
839 $this->end_controls_tabs();
840
841 $this->end_controls_section();
842
843 $this->start_controls_section(
844 'section_style_readmore',
845 [
846 'label' => esc_html__('Read More', 'ultimate-post-kit'),
847 'tab' => Controls_Manager::TAB_STYLE,
848 'condition' => [
849 'show_readmore' => 'yes',
850 ],
851 ]
852 );
853
854 $this->start_controls_tabs('tabs_readmore_style');
855
856 $this->start_controls_tab(
857 'tab_readmore_normal',
858 [
859 'label' => esc_html__('Normal', 'ultimate-post-kit'),
860 ]
861 );
862
863 $this->add_control(
864 'readmore_text_color',
865 [
866 'label' => esc_html__('Color', 'ultimate-post-kit'),
867 'type' => Controls_Manager::COLOR,
868 'selectors' => [
869 '{{WRAPPER}} .upk-alex-carousel .upk-readmore .upk-readmore-icon:before, {{WRAPPER}} .upk-alex-carousel .upk-readmore .upk-readmore-icon span:before, {{WRAPPER}} .upk-alex-carousel .upk-readmore .upk-readmore-icon span:after' => 'background: {{VALUE}};',
870 ],
871 ]
872 );
873
874 $this->add_group_control(
875 Group_Control_Background::get_type(),
876 [
877 'name' => 'readmore_background',
878 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-readmore',
879 ]
880 );
881
882 $this->add_group_control(
883 Group_Control_Border::get_type(),
884 [
885 'name' => 'readmore_border',
886 'placeholder' => '1px',
887 'default' => '1px',
888 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-readmore'
889 ]
890 );
891
892 $this->add_responsive_control(
893 'readmore_radius',
894 [
895 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
896 'type' => Controls_Manager::DIMENSIONS,
897 'size_units' => ['px', '%'],
898 'selectors' => [
899 '{{WRAPPER}} .upk-alex-carousel .upk-readmore' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
900 ],
901 ]
902 );
903
904 $this->add_responsive_control(
905 'readmore_primary_padding',
906 [
907 'label' => esc_html__('Padding', 'ultimate-post-kit'),
908 'type' => Controls_Manager::DIMENSIONS,
909 'size_units' => ['px', 'em', '%'],
910 'selectors' => [
911 '{{WRAPPER}} .upk-alex-carousel .upk-readmore' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
912 '{{WRAPPER}} .upk-alex-carousel .upk-button-wrap' => 'margin-bottom: calc(-{{TOP}}px * 2);',
913 ],
914 ]
915 );
916
917 $this->add_group_control(
918 Group_Control_Box_Shadow::get_type(),
919 [
920 'name' => 'readmore_shadow',
921 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-readmore',
922 ]
923 );
924
925 $this->end_controls_tab();
926
927 $this->start_controls_tab(
928 'tab_readmore_hover',
929 [
930 'label' => esc_html__('Hover', 'ultimate-post-kit'),
931 ]
932 );
933
934 $this->add_control(
935 'readmore_hover_text_color',
936 [
937 'label' => esc_html__('Color', 'ultimate-post-kit'),
938 'type' => Controls_Manager::COLOR,
939 'selectors' => [
940 '{{WRAPPER}} .upk-alex-carousel .upk-readmore:hover .upk-readmore-icon:before, {{WRAPPER}} .upk-alex-carousel .upk-readmore:hover .upk-readmore-icon span:before, {{WRAPPER}} .upk-alex-carousel .upk-readmore:hover .upk-readmore-icon span:after' => 'background: {{VALUE}};',
941 ],
942 ]
943 );
944
945 $this->add_group_control(
946 Group_Control_Background::get_type(),
947 [
948 'name' => 'readmore_hover_background',
949 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-readmore:hover',
950 ]
951 );
952
953 $this->add_control(
954 'readmore_hover_border_color',
955 [
956 'label' => esc_html__('Border Color', 'ultimate-post-kit'),
957 'type' => Controls_Manager::COLOR,
958 'selectors' => [
959 '{{WRAPPER}} .upk-alex-carousel .upk-readmore:hover' => 'border-color: {{VALUE}};',
960 ],
961 'condition' => [
962 'readmore_border_border!' => ''
963 ]
964 ]
965 );
966
967 $this->add_group_control(
968 Group_Control_Box_Shadow::get_type(),
969 [
970 'name' => 'readmore_hover_shadow',
971 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-readmore:hover',
972 ]
973 );
974
975 $this->end_controls_tab();
976
977 $this->end_controls_tabs();
978
979 $this->end_controls_section();
980
981 $this->start_controls_section(
982 'section_style_author',
983 [
984 'label' => esc_html__('Meta', 'ultimate-post-kit') . BDTUPK_UC,
985 'tab' => Controls_Manager::TAB_STYLE,
986 'conditions' => [
987 'relation' => 'or',
988 'terms' => [
989 [
990 'name' => 'show_author',
991 'value' => 'yes'
992 ],
993 [
994 'name' => 'show_date',
995 'value' => 'yes'
996 ],
997 [
998 'name' => 'show_reading_time',
999 'value' => 'yes'
1000 ]
1001 ]
1002 ],
1003 ]
1004 );
1005
1006 $this->start_controls_tabs('tabs_author_date_style');
1007
1008 $this->start_controls_tab(
1009 'tab_avatar_normal',
1010 [
1011 'label' => esc_html__('Avatar', 'ultimate-post-kit'),
1012 'condition' => [
1013 'show_author' => 'yes',
1014 ],
1015 ]
1016 );
1017
1018 $this->add_responsive_control(
1019 'author_image_size',
1020 [
1021 'label' => esc_html__('Size', 'ultimate-post-kit'),
1022 'type' => Controls_Manager::SLIDER,
1023 'range' => [
1024 'px' => [
1025 'min' => 20,
1026 'max' => 100,
1027 ],
1028 ],
1029 'selectors' => [
1030 '{{WRAPPER}} .upk-alex-carousel .upk-meta .upk-author-img img' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
1031 ],
1032 'condition' => [
1033 'show_author' => 'yes',
1034 ],
1035 ]
1036 );
1037
1038 $this->add_responsive_control(
1039 'author_image_spacing',
1040 [
1041 'label' => esc_html__('Spacing', 'ultimate-post-kit'),
1042 'type' => Controls_Manager::SLIDER,
1043 'range' => [
1044 'px' => [
1045 'min' => 0,
1046 'max' => 50,
1047 ],
1048 ],
1049 'selectors' => [
1050 '{{WRAPPER}} .upk-alex-carousel .upk-meta .upk-author-img img' => 'margin-right: {{SIZE}}{{UNIT}};',
1051 ],
1052 'condition' => [
1053 'show_author' => 'yes',
1054 ],
1055 ]
1056 );
1057
1058 $this->add_responsive_control(
1059 'author_image_radius',
1060 [
1061 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
1062 'type' => Controls_Manager::DIMENSIONS,
1063 'size_units' => ['px', '%'],
1064 'selectors' => [
1065 '{{WRAPPER}} .upk-alex-carousel .upk-meta .upk-author-img img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1066 ],
1067 'condition' => [
1068 'show_author' => 'yes',
1069 ],
1070 ]
1071 );
1072
1073 $this->end_controls_tab();
1074
1075 $this->start_controls_tab(
1076 'tab_author_name_normal',
1077 [
1078 'label' => esc_html__('Author Name', 'ultimate-post-kit'),
1079 'condition' => [
1080 'show_author' => 'yes',
1081 ],
1082 ]
1083 );
1084
1085 $this->add_control(
1086 'author_name_color',
1087 [
1088 'label' => esc_html__('Color', 'ultimate-post-kit'),
1089 'type' => Controls_Manager::COLOR,
1090 'selectors' => [
1091 '{{WRAPPER}} .upk-alex-carousel .upk-meta .upk-author-name a' => 'color: {{VALUE}};',
1092 ],
1093 'condition' => [
1094 'show_author' => 'yes',
1095 ],
1096 ]
1097 );
1098
1099 $this->add_control(
1100 'author_name_hover_color',
1101 [
1102 'label' => esc_html__('Hover Color', 'ultimate-post-kit'),
1103 'type' => Controls_Manager::COLOR,
1104 'selectors' => [
1105 '{{WRAPPER}} .upk-alex-carousel .upk-meta .upk-author-name a:hover' => 'color: {{VALUE}};',
1106 ],
1107 'condition' => [
1108 'show_author' => 'yes',
1109 ],
1110 ]
1111 );
1112
1113 $this->add_group_control(
1114 Group_Control_Typography::get_type(),
1115 [
1116 'name' => 'author_name_typography',
1117 'label' => esc_html__('Typography', 'ultimate-post-kit'),
1118 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-meta .upk-author-name a',
1119 'condition' => [
1120 'show_author' => 'yes',
1121 ],
1122 ]
1123 );
1124
1125 $this->end_controls_tab();
1126 $this->start_controls_tab(
1127 'tab_date_normal',
1128 [
1129 'label' => esc_html__('Date', 'ultimate-post-kit'),
1130 'conditions' => [
1131 'relation' => 'or',
1132 'terms' => [
1133 [
1134 'name' => 'show_date',
1135 'value' => 'yes'
1136 ],
1137 [
1138 'name' => 'show_reading_time',
1139 'value' => 'yes'
1140 ]
1141 ]
1142 ],
1143 ]
1144 );
1145
1146 $this->add_control(
1147 'date_color',
1148 [
1149 'label' => esc_html__('Color', 'ultimate-post-kit'),
1150 'type' => Controls_Manager::COLOR,
1151 'selectors' => [
1152 '{{WRAPPER}} .upk-alex-carousel .upk-meta .upk-date, {{WRAPPER}} .upk-alex-carousel .upk-meta .upk-post-time, {{WRAPPER}} .upk-alex-carousel .upk-meta .upk-reading-time' => 'color: {{VALUE}};',
1153 ],
1154 'conditions' => [
1155 'relation' => 'or',
1156 'terms' => [
1157 [
1158 'name' => 'show_date',
1159 'value' => 'yes'
1160 ],
1161 [
1162 'name' => 'show_reading_time',
1163 'value' => 'yes'
1164 ]
1165 ]
1166 ],
1167 ]
1168 );
1169
1170 $this->add_responsive_control(
1171 'meta_spacing',
1172 [
1173 'label' => esc_html__('Space Between', 'ultimate-post-kit'),
1174 'type' => Controls_Manager::SLIDER,
1175 'range' => [
1176 'px' => [
1177 'min' => 0,
1178 'max' => 50,
1179 ],
1180 ],
1181 'selectors' => [
1182 '{{WRAPPER}} .upk-alex-carousel .upk-meta .upk-date-reading-wrap > div:before' => 'margin: 0 {{SIZE}}{{UNIT}};',
1183 ],
1184 'condition' => [
1185 'show_reading_time' => 'yes',
1186 ],
1187 ]
1188 );
1189
1190 $this->add_group_control(
1191 Group_Control_Typography::get_type(),
1192 [
1193 'name' => 'date_typography',
1194 'label' => esc_html__('Typography', 'ultimate-post-kit'),
1195 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-meta .upk-date, {{WRAPPER}} .upk-alex-carousel .upk-meta .upk-post-time, {{WRAPPER}} .upk-alex-carousel .upk-meta .upk-reading-time',
1196 'conditions' => [
1197 'relation' => 'or',
1198 'terms' => [
1199 [
1200 'name' => 'show_date',
1201 'value' => 'yes'
1202 ],
1203 [
1204 'name' => 'show_reading_time',
1205 'value' => 'yes'
1206 ]
1207 ]
1208 ],
1209 ]
1210 );
1211
1212 $this->end_controls_tab();
1213 $this->end_controls_tabs();
1214
1215 $this->end_controls_section();
1216
1217 $this->start_controls_section(
1218 'section_style_post_format',
1219 [
1220 'label' => esc_html__('Post Format', 'ultimate-post-kit'),
1221 'tab' => Controls_Manager::TAB_STYLE,
1222 'condition' => [
1223 'show_post_format' => 'yes'
1224 ]
1225 ]
1226 );
1227
1228 $this->add_control(
1229 'post_format_color',
1230 [
1231 'label' => esc_html__('Color', 'ultimate-post-kit'),
1232 'type' => Controls_Manager::COLOR,
1233 'selectors' => [
1234 '{{WRAPPER}} .upk-alex-carousel .upk-post-format a' => 'color: {{VALUE}};',
1235 ],
1236 ]
1237 );
1238
1239 $this->add_control(
1240 'overlay_blur_effect_post_format',
1241 [
1242 'label' => esc_html__('Glassmorphism', 'ultimate-post-kit'),
1243 'type' => Controls_Manager::SWITCHER,
1244 // translators: %1s: Opening anchor tag with link to MDN backdrop-filter documentation, %2s: Closing anchor tag
1245 'description' => sprintf(__('This feature will not work in the Firefox browser untill you enable browser compatibility so please %1$s look here %2$s', 'ultimate-post-kit'), '<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility" target="_blank">', '</a>'),
1246 'default' => 'yes',
1247 'separator' => 'before'
1248 ]
1249 );
1250
1251 $this->add_control(
1252 'overlay_blur_level_post_format',
1253 [
1254 'label' => esc_html__('Blur Level', 'ultimate-post-kit'),
1255 'type' => Controls_Manager::SLIDER,
1256 'range' => [
1257 'px' => [
1258 'min' => 0,
1259 'step' => 1,
1260 'max' => 50,
1261 ]
1262 ],
1263 'default' => [
1264 'size' => 10
1265 ],
1266 'selectors' => [
1267 '{{WRAPPER}} .upk-alex-carousel .upk-post-format a' => 'backdrop-filter: blur({{SIZE}}px); -webkit-backdrop-filter: blur({{SIZE}}px);'
1268 ],
1269 'condition' => [
1270 'overlay_blur_effect_post_format' => 'yes'
1271 ]
1272 ]
1273 );
1274
1275 $this->add_group_control(
1276 Group_Control_Background::get_type(),
1277 [
1278 'name' => 'post_format_background',
1279 'label' => esc_html__('Background', 'ultimate-post-kit'),
1280 'types' => ['classic', 'gradient'],
1281 // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Elementor widget query built from user-configured controls; expected behaviour.
1282 'exclude' => ['image'],
1283 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-post-format a',
1284 'fields_options' => [
1285 'background' => [
1286 'default' => 'classic',
1287 ],
1288 'color' => [
1289 'default' => 'rgba(43, 45, 66, 0.3)',
1290 ],
1291 ]
1292 ]
1293 );
1294
1295 $this->add_group_control(
1296 Group_Control_Border::get_type(),
1297 [
1298 'name' => 'post_format_border',
1299 'selector' => '{{WRAPPER}} .upk-alex-carousel .upk-post-format a',
1300 'separator' => 'before'
1301 ]
1302 );
1303
1304 $this->add_responsive_control(
1305 'post_format_border_radius',
1306 [
1307 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
1308 'type' => Controls_Manager::DIMENSIONS,
1309 'size_units' => ['px', '%'],
1310 'selectors' => [
1311 '{{WRAPPER}} .upk-alex-carousel .upk-post-format a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1312 ],
1313 ]
1314 );
1315
1316 $this->add_responsive_control(
1317 'post_format_padding',
1318 [
1319 'label' => esc_html__('Padding', 'ultimate-post-kit'),
1320 'type' => Controls_Manager::DIMENSIONS,
1321 'size_units' => ['px', 'em', '%'],
1322 'selectors' => [
1323 '{{WRAPPER}} .upk-alex-carousel .upk-post-format a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1324 ],
1325 ]
1326 );
1327
1328 $this->add_responsive_control(
1329 'post_format_margin',
1330 [
1331 'label' => esc_html__('Margin', 'ultimate-post-kit'),
1332 'type' => Controls_Manager::DIMENSIONS,
1333 'size_units' => ['px', 'em', '%'],
1334 'selectors' => [
1335 '{{WRAPPER}} .upk-alex-carousel .upk-post-format' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1336 ],
1337 ]
1338 );
1339
1340 $this->add_responsive_control(
1341 'post_format_size',
1342 [
1343 'label' => esc_html__('Size', 'ultimate-post-kit'),
1344 'type' => Controls_Manager::SLIDER,
1345 'range' => [
1346 'px' => [
1347 'min' => 0,
1348 'max' => 50,
1349 ],
1350 ],
1351 'selectors' => [
1352 '{{WRAPPER}} .upk-alex-carousel .upk-post-format a' => 'font-size: {{SIZE}}{{UNIT}};',
1353 ],
1354 ]
1355 );
1356
1357 $this->end_controls_section();
1358
1359 //Navigation Global Controls
1360 $this->register_navigation_style('swiper');
1361 }
1362
1363 /**
1364 * Main query render for this widget
1365 * @param $posts_per_page number item query limit
1366 */
1367 public function query_posts($posts_per_page) {
1368
1369 $default = $this->getGroupControlQueryArgs();
1370 $args = [];
1371 if ($posts_per_page) {
1372 $args['posts_per_page'] = $posts_per_page;
1373 }
1374 $args = array_merge($default, $args);
1375 $this->_query = new WP_Query($args);
1376 }
1377
1378 public function render_readmore() {
1379
1380 if (!$this->get_settings('show_readmore')) {
1381 return;
1382 }
1383
1384 ?>
1385 <div class="upk-button-wrap">
1386 <a
1387 href="<?php echo esc_url(get_permalink()); ?>"
1388 class="upk-readmore"
1389 aria-label="<?php echo esc_attr__( 'Read More Button', 'ultimate-post-kit' ); ?>"
1390 >
1391 <span class="upk-readmore-icon"><span></span></span>
1392 </a>
1393 </div>
1394 <?php
1395 }
1396
1397 public function render_author_date() {
1398 $settings = $this->get_settings_for_display();
1399
1400 if ($settings['show_author'] or $settings['show_date'] or $settings['show_reading_time']) : ?>
1401 <div class="upk-meta">
1402 <?php if ($settings['show_author']) : ?>
1403 <div class="upk-author-img">
1404 <?php echo get_avatar(get_the_author_meta('ID'), 48); ?>
1405 </div>
1406 <?php endif; ?>
1407 <div>
1408 <?php if ($settings['show_author']) : ?>
1409 <div class="upk-author-name">
1410 <a
1411 href="<?php echo esc_url( get_author_posts_url(get_the_author_meta('ID')) ); ?>"
1412 aria-label="<?php echo esc_attr( 'View all posts by ' . get_the_author() ); ?>"
1413 >
1414 <?php echo esc_html( get_the_author() ) ?>
1415 </a>
1416 </div>
1417 <?php endif; ?>
1418
1419 <div class="upk-flex upk-flex-middle upk-date-reading-wrap">
1420 <?php if ('yes' === $settings['show_date']) : ?>
1421 <div data-separator="<?php echo esc_attr($settings['meta_separator']); ?>">
1422 <?php $this->render_date(); ?>
1423 </div>
1424 <?php endif; ?>
1425
1426 <?php if (_is_upk_pro_activated()) :
1427 if ('yes' === $settings['show_reading_time']) : ?>
1428 <div class="upk-reading-time" data-separator="<?php echo esc_attr($settings['meta_separator']); ?>">
1429 <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'], $settings['hide_seconds'] ?? 'no', $settings['hide_minutes'] ?? 'no' ) ); ?>
1430 </div>
1431 <?php endif; ?>
1432 <?php endif; ?>
1433 </div>
1434 </div>
1435 </div>
1436 <?php endif;
1437 }
1438
1439 public function render_header() {
1440
1441 $settings = $this->get_settings_for_display();
1442
1443 //Global Function
1444 $this->render_header_attribute('alex');
1445
1446 ?>
1447 <div <?php $this->print_render_attribute_string('carousel'); ?>>
1448 <div class="upk-alex-wrap upk-content-<?php echo esc_attr($settings['content_position']) ?>">
1449 <div <?php $this->print_render_attribute_string('swiper'); ?>>
1450 <div class="swiper-wrapper">
1451 <?php
1452 }
1453
1454 public function render_post_grid_item($post_id, $image_size) {
1455 $settings = $this->get_settings_for_display();
1456
1457 if ('yes' == $settings['global_link']) {
1458 $this->add_render_attribute(
1459 'grid-item',
1460 'onclick',
1461 sprintf( "window.open('%s', '_self')", esc_js( esc_url( get_permalink() ) ) ),
1462 true
1463 );
1464 }
1465
1466 $this->add_render_attribute('grid-item', 'class', 'upk-item swiper-slide', true);
1467
1468 ?>
1469 <div <?php $this->print_render_attribute_string('grid-item'); ?>>
1470 <div class="upk-image-wrap">
1471 <?php $this->render_image(get_post_thumbnail_id($post_id), $image_size); ?>
1472
1473 <?php $this->render_author_date(); ?>
1474
1475 <?php $this->render_post_format(); ?>
1476
1477 <div class="upk-content-wrap">
1478
1479 <div class="upk-content">
1480 <?php $this->render_category(); ?>
1481 <?php $this->render_title(substr($this->get_name(), 4)); ?>
1482 </div>
1483 <?php $this->render_readmore(); ?>
1484
1485
1486 </div>
1487 </div>
1488 </div>
1489 <?php
1490 }
1491
1492 public function render() {
1493 $settings = $this->get_settings_for_display();
1494
1495 $this->query_posts($settings['item_limit']['size']);
1496 $wp_query = $this->get_query();
1497
1498 if (!$wp_query->found_posts) {
1499 return;
1500 }
1501
1502 $this->render_header();
1503
1504 while ($wp_query->have_posts()) {
1505 $wp_query->the_post();
1506 $thumbnail_size = $settings['primary_thumbnail_size'];
1507 $this->render_post_grid_item(get_the_ID(), $thumbnail_size);
1508 }
1509
1510 wp_reset_postdata();
1511
1512 $this->render_footer();
1513 }
1514 }
1515