PluginProbe
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets / 4.5.3
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets v4.5.3
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 4.1.3 All 147 releases
ultimate-post-kit / modules / fanel-list / widgets / fanel-list.php

fanel-list.php in Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets 4.5.3, at modules/fanel-list/widgets/fanel-list.php

1,387 lines 38.8 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\FanelList\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 use UltimatePostKit\Utils;
13
14 use UltimatePostKit\Traits\Global_Widget_Controls;
15 use UltimatePostKit\Traits\Global_Widget_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 Fanel_List 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-fanel-list';
32 }
33
34 public function get_title() {
35 return BDTUPK . esc_html__('Fanel List', 'ultimate-post-kit');
36 }
37
38 public function get_icon() {
39 return 'upk-widget-icon upk-icon-fanel-list';
40 }
41
42 public function get_categories() {
43 return ['ultimate-post-kit'];
44 }
45
46 public function get_keywords() {
47 return ['post', 'grid', 'blog', 'recent', 'news', 'fanel', 'list'];
48 }
49
50 public function get_style_depends() {
51 if ($this->upk_is_edit_mode()) {
52 return ['upk-all-styles'];
53 } else {
54 return ['upk-font', 'upk-fanel-list'];
55 }
56 }
57
58 public function get_script_depends() {
59 if ($this->upk_is_edit_mode()) {
60 return ['upk-all-scripts'];
61 } else {
62 return ['upk-ajax-loadmore'];
63 }
64 }
65
66 public function get_custom_help_url() {
67 return 'https://youtu.be/nGAoLOoNYk4';
68 }
69
70 public function get_query() {
71 return $this->_query;
72 }
73
74 public function has_widget_inner_wrapper(): bool {
75 return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
76 }
77
78
79 protected function register_controls() {
80 $this->start_controls_section(
81 'section_content_layout',
82 [
83 'label' => esc_html__('Layout', 'ultimate-post-kit'),
84 ]
85 );
86
87 $this->add_responsive_control(
88 'columns',
89 [
90 'label' => __('Columns', 'ultimate-post-kit'),
91 'type' => Controls_Manager::SELECT,
92 'default' => '2',
93 'tablet_default' => '1',
94 'mobile_default' => '1',
95 'options' => [
96 '1' => '1',
97 '2' => '2',
98 ],
99 'selectors' => [
100 '{{WRAPPER}} .upk-fanel-list' => 'grid-template-columns: repeat({{SIZE}}, 1fr);',
101 ],
102 ]
103 );
104
105 $this->add_responsive_control(
106 'row_gap',
107 [
108 'label' => esc_html__('Row Gap', 'ultimate-post-kit'),
109 'type' => Controls_Manager::SLIDER,
110 'default' => [
111 'size' => 20,
112 ],
113 'selectors' => [
114 '{{WRAPPER}} .upk-fanel-list' => 'grid-row-gap: {{SIZE}}{{UNIT}};',
115 ],
116 ]
117 );
118
119 $this->add_responsive_control(
120 'column_gap',
121 [
122 'label' => esc_html__('Column Gap', 'ultimate-post-kit'),
123 'type' => Controls_Manager::SLIDER,
124 'default' => [
125 'size' => 20,
126 ],
127 'selectors' => [
128 '{{WRAPPER}} .upk-fanel-list' => 'grid-column-gap: {{SIZE}}{{UNIT}};',
129 ],
130 ]
131 );
132
133 $this->add_group_control(
134 Group_Control_Image_Size::get_type(),
135 [
136 'name' => 'primary_thumbnail',
137 // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Elementor widget query built from user-configured controls; expected behaviour.
138 'exclude' => ['custom'],
139 'default' => 'medium',
140 ]
141 );
142
143 $this->end_controls_section();
144
145 // Query Settings
146 $this->start_controls_section(
147 'section_post_query_builder',
148 [
149 'label' => __('Query', 'ultimate-post-kit'),
150 'tab' => Controls_Manager::TAB_CONTENT,
151 ]
152 );
153
154 $this->add_control(
155 'item_limit',
156 [
157 'label' => esc_html__('Item Limit', 'ultimate-post-kit'),
158 'type' => Controls_Manager::SLIDER,
159 'range' => [
160 'px' => [
161 'min' => 1,
162 'max' => 20,
163 ],
164 ],
165 'default' => [
166 'size' => 6,
167 ],
168 'condition' => [
169 'posts_source!' => 'current_query',
170 ]
171 ]
172 );
173
174 $this->register_query_builder_controls();
175
176 $this->end_controls_section();
177
178 $this->start_controls_section(
179 'section_content_additional',
180 [
181 'label' => esc_html__('Additional Options', 'ultimate-post-kit'),
182 ]
183 );
184
185 //Global Title Controls
186 $this->register_title_controls();
187
188 $this->add_control(
189 'show_category',
190 [
191 'label' => esc_html__('Show Category', 'ultimate-post-kit'),
192 'type' => Controls_Manager::SWITCHER,
193 'default' => 'yes',
194 ]
195 );
196
197 $this->add_control(
198 'show_date',
199 [
200 'label' => esc_html__('Show Date', 'ultimate-post-kit'),
201 'type' => Controls_Manager::SWITCHER,
202 'default' => 'yes',
203 ]
204 );
205
206 $this->add_control(
207 'show_readmore',
208 [
209 'label' => esc_html__('Show Readmore', 'ultimate-post-kit'),
210 'type' => Controls_Manager::SWITCHER,
211 ]
212 );
213
214 $this->register_text_controls();
215
216 $this->add_control(
217 'show_author',
218 [
219 'label' => esc_html__('Show Author', 'ultimate-post-kit'),
220 'type' => Controls_Manager::SWITCHER,
221 'separator' => 'before'
222 ]
223 );
224
225 $this->add_control(
226 'show_comments',
227 [
228 'label' => esc_html__('Show Comments', 'ultimate-post-kit'),
229 'type' => Controls_Manager::SWITCHER,
230 ]
231 );
232
233 $this->add_control(
234 'meta_separator',
235 [
236 'label' => __('Separator', 'ultimate-post-kit'),
237 'type' => Controls_Manager::TEXT,
238 'default' => '//',
239 'label_block' => false,
240 ]
241 );
242
243 //Global Reading Time Controls
244 $this->register_reading_time_controls();
245
246 $this->add_control(
247 'show_pagination',
248 [
249 'label' => esc_html__('Show Pagination', 'ultimate-post-kit'),
250 'type' => Controls_Manager::SWITCHER,
251 'separator' => 'before'
252 ]
253 );
254
255 //Global Ajax Controls
256 $this->register_ajax_loadmore_controls();
257
258 $this->add_control(
259 'global_link',
260 [
261 'label' => __('Item Wrapper Link', 'ultimate-post-kit'),
262 'type' => Controls_Manager::SWITCHER,
263 'prefix_class' => 'upk-global-link-',
264 'description' => __('Be aware! When Item Wrapper Link activated then title link and read more link will not work', 'ultimate-post-kit'),
265 ]
266 );
267
268 $this->end_controls_section();
269
270 $this->start_controls_section(
271 'upk_section_style',
272 [
273 'label' => esc_html__('Items', 'ultimate-post-kit'),
274 'tab' => Controls_Manager::TAB_STYLE,
275 ]
276 );
277
278 $this->add_responsive_control(
279 'content_padding',
280 [
281 'label' => __('Content Padding', 'ultimate-post-kit'),
282 'type' => Controls_Manager::DIMENSIONS,
283 'size_units' => ['px', 'em', '%'],
284 'selectors' => [
285 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
286 ],
287 ]
288 );
289
290 $this->start_controls_tabs('tabs_item_style');
291
292 $this->start_controls_tab(
293 'tab_item_normal',
294 [
295 'label' => esc_html__('Normal', 'ultimate-post-kit'),
296 ]
297 );
298
299 $this->add_group_control(
300 Group_Control_Background::get_type(),
301 [
302 'name' => 'item_background',
303 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item',
304 ]
305 );
306
307 $this->add_group_control(
308 Group_Control_Border::get_type(),
309 [
310 'name' => 'item_border',
311 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item',
312 ]
313 );
314
315 $this->add_responsive_control(
316 'item_border_radius',
317 [
318 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
319 'type' => Controls_Manager::DIMENSIONS,
320 'size_units' => ['px', '%'],
321 'selectors' => [
322 '{{WRAPPER}} .upk-fanel-list .upk-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
323 ],
324 ]
325 );
326
327 $this->add_responsive_control(
328 'item_padding',
329 [
330 'label' => __('Padding', 'ultimate-post-kit'),
331 'type' => Controls_Manager::DIMENSIONS,
332 'size_units' => ['px', 'em', '%'],
333 'selectors' => [
334 '{{WRAPPER}} .upk-fanel-list .upk-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
335 ],
336 ]
337 );
338
339 $this->add_group_control(
340 Group_Control_Box_Shadow::get_type(),
341 [
342 'name' => 'item_box_shadow',
343 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item',
344 ]
345 );
346
347 $this->end_controls_tab();
348
349 $this->start_controls_tab(
350 'tab_item_hover',
351 [
352 'label' => esc_html__('Hover', 'ultimate-post-kit'),
353 ]
354 );
355
356 $this->add_group_control(
357 Group_Control_Background::get_type(),
358 [
359 'name' => 'item_hover_background',
360 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item:hover',
361 ]
362 );
363
364 $this->add_control(
365 'item_hover_border_color',
366 [
367 'label' => esc_html__('Border Color', 'ultimate-post-kit'),
368 'type' => Controls_Manager::COLOR,
369 'condition' => [
370 'item_border_border!' => '',
371 ],
372 'selectors' => [
373 '{{WRAPPER}} .upk-fanel-list .upk-item:hover' => 'border-color: {{VALUE}};',
374 ],
375 ]
376 );
377
378 $this->add_group_control(
379 Group_Control_Box_Shadow::get_type(),
380 [
381 'name' => 'item_hover_box_shadow',
382 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item:hover',
383 ]
384 );
385
386 $this->end_controls_tab();
387
388 $this->end_controls_tabs();
389
390 $this->end_controls_section();
391
392 $this->start_controls_section(
393 'section_style_image',
394 [
395 'label' => esc_html__('Image', 'ultimate-post-kit'),
396 'tab' => Controls_Manager::TAB_STYLE,
397 ]
398 );
399
400 $this->add_group_control(
401 Group_Control_Border::get_type(),
402 [
403 'name' => 'item_image_border',
404 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item .upk-image-wrap',
405 ]
406 );
407
408 $this->add_responsive_control(
409 'item_image_border_radius',
410 [
411 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
412 'type' => Controls_Manager::DIMENSIONS,
413 'size_units' => ['px', '%'],
414 'selectors' => [
415 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-image-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
416 ],
417 ]
418 );
419
420 // $this->add_responsive_control(
421 // 'item_image_size',
422 // [
423 // 'label' => esc_html__( 'Size(px)', 'ultimate-post-kit' ),
424 // 'type' => Controls_Manager::SLIDER,
425 // 'range' => [
426 // 'px' => [
427 // 'min' => 100,
428 // 'max' => 500,
429 // ],
430 // ],
431 // 'selectors' => [
432 // '{{WRAPPER}} .upk-fanel-list .upk-item .upk-item-box .upk-fanel-list-image' => 'max-width: {{SIZE}}{{UNIT}}; min-width: {{SIZE}}{{UNIT}};',
433 // ],
434 // ]
435 // );
436
437 $this->end_controls_section();
438
439 $this->start_controls_section(
440 'section_style_title',
441 [
442 'label' => esc_html__('Title', 'ultimate-post-kit'),
443 'tab' => Controls_Manager::TAB_STYLE,
444 'condition' => [
445 'show_title' => 'yes',
446 ],
447 ]
448 );
449
450 $this->add_control(
451 'title_style',
452 [
453 'label' => esc_html__('Style', 'ultimate-post-kit'),
454 'type' => Controls_Manager::SELECT,
455 'default' => 'underline',
456 'options' => [
457 'underline' => esc_html__('Underline', 'ultimate-post-kit'),
458 'middle-underline' => esc_html__('Middle Underline', 'ultimate-post-kit'),
459 'overline' => esc_html__('Overline', 'ultimate-post-kit'),
460 'middle-overline' => esc_html__('Middle Overline', 'ultimate-post-kit'),
461 ],
462 ]
463 );
464
465 $this->add_control(
466 'title_color',
467 [
468 'label' => esc_html__('Color', 'ultimate-post-kit'),
469 'type' => Controls_Manager::COLOR,
470 'selectors' => [
471 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-title a' => 'color: {{VALUE}};',
472 ],
473 ]
474 );
475
476 $this->add_control(
477 'title_hover_color',
478 [
479 'label' => esc_html__('Hover Color', 'ultimate-post-kit'),
480 'type' => Controls_Manager::COLOR,
481 'selectors' => [
482 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-title a:hover' => 'color: {{VALUE}};',
483 ],
484 ]
485 );
486
487 $this->add_group_control(
488 Group_Control_Typography::get_type(),
489 [
490 'name' => 'title_typography',
491 'label' => esc_html__('Typography', 'ultimate-post-kit'),
492 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item .upk-title',
493 ]
494 );
495
496 $this->add_group_control(
497 Group_Control_Text_Shadow::get_type(),
498 [
499 'name' => 'title_text_shadow',
500 'label' => __('Text Shadow', 'ultimate-post-kit'),
501 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item .upk-title',
502 ]
503 );
504
505 $this->end_controls_section();
506
507 $this->start_controls_section(
508 'section_style_text',
509 [
510 'label' => esc_html__('Text', 'ultimate-post-kit'),
511 'tab' => Controls_Manager::TAB_STYLE,
512 'condition' => [
513 'show_excerpt' => 'yes',
514 ],
515 ]
516 );
517
518 $this->add_control(
519 'text_color',
520 [
521 'label' => esc_html__('Color', 'ultimate-post-kit'),
522 'type' => Controls_Manager::COLOR,
523 'selectors' => [
524 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-text' => 'color: {{VALUE}};',
525 ],
526 ]
527 );
528
529 $this->add_group_control(
530 Group_Control_Typography::get_type(),
531 [
532 'name' => 'text_typography',
533 'label' => esc_html__('Typography', 'ultimate-post-kit'),
534 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item .upk-text',
535 ]
536 );
537
538 $this->add_responsive_control(
539 'text_margin',
540 [
541 'label' => __('Margin', 'ultimate-post-kit'),
542 'type' => Controls_Manager::DIMENSIONS,
543 'size_units' => ['px', 'em', '%'],
544 'selectors' => [
545 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
546 ]
547 ]
548 );
549
550 $this->add_responsive_control(
551 'text_spacing',
552 [
553 'label' => esc_html__('Spacing', 'ultimate-post-kit'),
554 'type' => Controls_Manager::SLIDER,
555 'range' => [
556 'px' => [
557 'min' => 0,
558 'max' => 50,
559 ],
560 ],
561 'selectors' => [
562 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-text' => 'padding-top: {{SIZE}}{{UNIT}};',
563 ],
564 ]
565 );
566
567 $this->end_controls_section();
568
569 $this->start_controls_section(
570 'section_style_date',
571 [
572 'label' => esc_html__('Date', 'ultimate-post-kit'),
573 'tab' => Controls_Manager::TAB_STYLE,
574 'condition' => [
575 'show_date' => 'yes',
576 ],
577 ]
578 );
579 $this->add_responsive_control(
580 'date_position',
581 [
582 'label' => esc_html__('Position', 'ultimate-post-kit'),
583 'type' => Controls_Manager::SELECT,
584 'default' => 'bottom-right',
585 'options' => [
586 'top-left' => esc_html__('Top Left', 'ultimate-post-kit'),
587 'top-right' => esc_html__('Top Right', 'ultimate-post-kit'),
588 'bottom-left' => esc_html__('Bottom Left', 'ultimate-post-kit'),
589 'bottom-right' => esc_html__('Bottom Right', 'ultimate-post-kit'),
590 ],
591 'selectors_dictionary' => [
592 'top-left' => 'top: 0; left: 0; bottom: auto; right: auto;',
593 'top-right' => 'top: 0; left: auto; bottom: auto; right: 0;',
594 'bottom-left' => 'top: auto; left: 0; bottom: 0; right: auto;',
595 'bottom-right' => 'top: auto; left: auto; bottom: 0; right: 0;',
596 ],
597 'selectors' => [
598 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-date-wrap' => '{{VALUE}};',
599 ],
600 ]
601 );
602
603 $this->add_group_control(
604 Group_Control_Background::get_type(),
605 [
606 'name' => 'date_background',
607 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-date-wrap',
608 'separator' => 'before'
609 ]
610 );
611
612 $this->add_group_control(
613 Group_Control_Border::get_type(),
614 [
615 'name' => 'date_border',
616 'label' => esc_html__('Border', 'ultimate-post-kit'),
617 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-date-wrap',
618 ]
619 );
620
621 $this->add_responsive_control(
622 'date_border_radius',
623 [
624 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
625 'type' => Controls_Manager::DIMENSIONS,
626 'size_units' => ['px', '%'],
627 'selectors' => [
628 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-date-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
629 ],
630 ]
631 );
632
633 $this->add_responsive_control(
634 'date_padding',
635 [
636 'label' => esc_html__('Padding', 'ultimate-post-kit'),
637 'type' => Controls_Manager::DIMENSIONS,
638 'size_units' => ['px', '%'],
639 'selectors' => [
640 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-date-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
641 ]
642 ]
643 );
644
645 $this->add_responsive_control(
646 'date_margin',
647 [
648 'label' => __('Margin', 'ultimate-post-kit'),
649 'type' => Controls_Manager::DIMENSIONS,
650 'size_units' => ['px', 'em', '%'],
651 'selectors' => [
652 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-date-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
653 ]
654 ]
655 );
656
657 $this->add_control(
658 'date_day_heading',
659 [
660 'label' => esc_html__('Day', 'ultimate-post-kit'),
661 'type' => Controls_Manager::HEADING,
662 'separator' => 'before'
663 ]
664 );
665
666 $this->add_control(
667 'date_day_color',
668 [
669 'label' => esc_html__('Color', 'ultimate-post-kit'),
670 'type' => Controls_Manager::COLOR,
671 'selectors' => [
672 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-date-wrap .upk-fanel-date' => 'color: {{VALUE}};',
673 ],
674 ]
675 );
676
677 $this->add_group_control(
678 Group_Control_Typography::get_type(),
679 [
680 'name' => 'date_day_typography',
681 'label' => esc_html__('Typography', 'ultimate-post-kit'),
682 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-date-wrap .upk-fanel-date',
683 ]
684 );
685
686 $this->add_control(
687 'date_month_heading',
688 [
689 'label' => esc_html__('Month', 'ultimate-post-kit'),
690 'type' => Controls_Manager::HEADING,
691 'separator' => 'before'
692 ]
693 );
694
695 $this->add_control(
696 'date_month_color',
697 [
698 'label' => esc_html__('Color', 'ultimate-post-kit'),
699 'type' => Controls_Manager::COLOR,
700 'selectors' => [
701 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-date-wrap .upk-fanel-month' => 'color: {{VALUE}};',
702 ],
703 ]
704 );
705
706 $this->add_group_control(
707 Group_Control_Typography::get_type(),
708 [
709 'name' => 'date_month_typography',
710 'label' => esc_html__('Typography', 'ultimate-post-kit'),
711 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-date-wrap .upk-fanel-month',
712 ]
713 );
714
715 $this->end_controls_section();
716
717 $this->start_controls_section(
718 'section_style_readmore',
719 [
720 'label' => esc_html__('Read More', 'ultimate-post-kit'),
721 'tab' => Controls_Manager::TAB_STYLE,
722 'condition' => [
723 'show_readmore' => 'yes',
724 ],
725 ]
726 );
727
728 $this->start_controls_tabs('tabs_readmore_style');
729
730 $this->start_controls_tab(
731 'tab_readmore_normal',
732 [
733 'label' => esc_html__('Normal', 'ultimate-post-kit'),
734 ]
735 );
736
737 $this->add_control(
738 'readmore_color',
739 [
740 'label' => esc_html__('Color', 'ultimate-post-kit'),
741 'type' => Controls_Manager::COLOR,
742 'selectors' => [
743 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-read-more' => 'color: {{VALUE}};',
744 ],
745 ]
746 );
747
748 $this->add_group_control(
749 Group_Control_Background::get_type(),
750 [
751 'name' => 'readmore_background',
752 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-read-more',
753 ]
754 );
755
756 $this->add_group_control(
757 Group_Control_Border::get_type(),
758 [
759 'name' => 'readmore_border',
760 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-read-more',
761 ]
762 );
763
764 $this->add_responsive_control(
765 'readmore_border_radius',
766 [
767 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
768 'type' => Controls_Manager::DIMENSIONS,
769 'size_units' => ['px', '%'],
770 'selectors' => [
771 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-read-more' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
772 ],
773 ]
774 );
775 $this->add_responsive_control(
776 'readmore_margin',
777 [
778 'label' => __('Margin', 'ultimate-post-kit'),
779 'type' => Controls_Manager::DIMENSIONS,
780 'size_units' => ['px', 'em', '%'],
781 'selectors' => [
782 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-read-more' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
783 ]
784 ]
785 );
786
787 $this->add_responsive_control(
788 'readmore_size',
789 [
790 'label' => esc_html__('Icon Size', 'ultimate-post-kit'),
791 'type' => Controls_Manager::SLIDER,
792 'range' => [
793 'px' => [
794 'min' => 0,
795 'max' => 50,
796 ],
797 ],
798 'selectors' => [
799 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-read-more' => 'font-size: {{SIZE}}{{UNIT}};',
800 ],
801 ]
802 );
803
804 $this->add_responsive_control(
805 'readmore_button_height',
806 [
807 'label' => esc_html__('Button Height', 'ultimate-post-kit'),
808 'type' => Controls_Manager::SLIDER,
809 'selectors' => [
810 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-read-more' => 'height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}};',
811 ],
812 ]
813 );
814
815 $this->add_responsive_control(
816 'readmore_button_width',
817 [
818 'label' => esc_html__('Button Width', 'ultimate-post-kit'),
819 'type' => Controls_Manager::SLIDER,
820 'selectors' => [
821 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-read-more' => 'width: {{SIZE}}{{UNIT}};',
822 ],
823 ]
824 );
825
826 $this->end_controls_tab();
827
828 $this->start_controls_tab(
829 'tab_readmore_hover',
830 [
831 'label' => esc_html__('Hover', 'ultimate-post-kit'),
832 ]
833 );
834
835 $this->add_control(
836 'readmore_color_hover',
837 [
838 'label' => esc_html__('Color', 'ultimate-post-kit'),
839 'type' => Controls_Manager::COLOR,
840 'selectors' => [
841 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-read-more:hover' => 'color: {{VALUE}};',
842 ],
843 ]
844 );
845
846 $this->add_group_control(
847 Group_Control_Background::get_type(),
848 [
849 'name' => 'readmore_background_hover',
850 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-read-more:hover',
851 ]
852 );
853
854 $this->add_control(
855 'readmore_hover_border_color',
856 [
857 'label' => esc_html__('Border Color', 'ultimate-post-kit'),
858 'type' => Controls_Manager::COLOR,
859 'condition' => [
860 'readmore_border_border!' => '',
861 ],
862 'selectors' => [
863 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-read-more:hover' => 'border-color: {{VALUE}};',
864 ],
865 ]
866 );
867
868 $this->end_controls_tab();
869
870 $this->end_controls_tabs();
871
872 $this->end_controls_section();
873
874 $this->start_controls_section(
875 'section_style_category',
876 [
877 'label' => esc_html__('Category', 'ultimate-post-kit'),
878 'tab' => Controls_Manager::TAB_STYLE,
879 'condition' => [
880 'show_category' => 'yes',
881 ],
882 ]
883 );
884
885 $this->add_responsive_control(
886 'category_bottom_spacing',
887 [
888 'label' => esc_html__('Spacing', 'ultimate-post-kit'),
889 'type' => Controls_Manager::SLIDER,
890 'range' => [
891 'px' => [
892 'min' => 0,
893 'max' => 50,
894 ],
895 ],
896 'selectors' => [
897 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-category' => 'margin-bottom: {{SIZE}}{{UNIT}};',
898 ],
899 ]
900 );
901
902 $this->start_controls_tabs('tabs_category_style');
903
904 $this->start_controls_tab(
905 'tab_category_normal',
906 [
907 'label' => esc_html__('Normal', 'ultimate-post-kit'),
908 ]
909 );
910
911 $this->add_control(
912 'category_color',
913 [
914 'label' => esc_html__('Color', 'ultimate-post-kit'),
915 'type' => Controls_Manager::COLOR,
916 'selectors' => [
917 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-category a' => 'color: {{VALUE}};',
918 ],
919 ]
920 );
921
922 $this->add_group_control(
923 Group_Control_Background::get_type(),
924 [
925 'name' => 'category_background',
926 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item .upk-category a',
927 ]
928 );
929
930 $this->add_group_control(
931 Group_Control_Border::get_type(),
932 [
933 'name' => 'category_border',
934 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item .upk-category a',
935 ]
936 );
937
938 $this->add_responsive_control(
939 'category_border_radius',
940 [
941 'label' => esc_html__('Border Radius', 'ultimate-post-kit'),
942 'type' => Controls_Manager::DIMENSIONS,
943 'size_units' => ['px', '%'],
944 'selectors' => [
945 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-category a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
946 ],
947 ]
948 );
949
950 $this->add_responsive_control(
951 'category_padding',
952 [
953 'label' => esc_html__('Padding', 'ultimate-post-kit'),
954 'type' => Controls_Manager::DIMENSIONS,
955 'size_units' => ['px', 'em', '%'],
956 'selectors' => [
957 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-category a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
958 ],
959 ]
960 );
961
962 $this->add_responsive_control(
963 'category_spacing',
964 [
965 'label' => esc_html__('Space Between', 'ultimate-post-kit'),
966 'type' => Controls_Manager::SLIDER,
967 'range' => [
968 'px' => [
969 'min' => 0,
970 'max' => 50,
971 'step' => 2,
972 ],
973 ],
974 'selectors' => [
975 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-category a+a' => 'margin-left: {{SIZE}}{{UNIT}};',
976 ],
977 ]
978 );
979
980
981 $this->add_group_control(
982 Group_Control_Box_Shadow::get_type(),
983 [
984 'name' => 'category_shadow',
985 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item .upk-category a',
986 ]
987 );
988
989 $this->add_group_control(
990 Group_Control_Typography::get_type(),
991 [
992 'name' => 'category_typography',
993 'label' => esc_html__('Typography', 'ultimate-post-kit'),
994 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item .upk-category a',
995 ]
996 );
997
998 $this->end_controls_tab();
999
1000 $this->start_controls_tab(
1001 'tab_category_hover',
1002 [
1003 'label' => esc_html__('Hover', 'ultimate-post-kit'),
1004 ]
1005 );
1006
1007 $this->add_control(
1008 'category_hover_color',
1009 [
1010 'label' => esc_html__('Color', 'ultimate-post-kit'),
1011 'type' => Controls_Manager::COLOR,
1012 'selectors' => [
1013 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-category a:hover' => 'color: {{VALUE}};',
1014 ],
1015 ]
1016 );
1017
1018 $this->add_group_control(
1019 Group_Control_Background::get_type(),
1020 [
1021 'name' => 'category_hover_background',
1022 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item .upk-category a:hover',
1023 ]
1024 );
1025
1026 $this->add_control(
1027 'category_hover_border_color',
1028 [
1029 'label' => esc_html__('Border Color', 'ultimate-post-kit'),
1030 'type' => Controls_Manager::COLOR,
1031 'condition' => [
1032 'category_border_border!' => '',
1033 ],
1034 'selectors' => [
1035 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-category a:hover' => 'border-color: {{VALUE}};',
1036 ],
1037 ]
1038 );
1039
1040 $this->end_controls_tab();
1041
1042 $this->end_controls_tabs();
1043
1044 $this->end_controls_section();
1045
1046 $this->start_controls_section(
1047 'section_style_meta',
1048 [
1049 'label' => esc_html__('Meta', 'ultimate-post-kit'),
1050 'tab' => Controls_Manager::TAB_STYLE,
1051 'conditions' => [
1052 'relation' => 'or',
1053 'terms' => [
1054 [
1055 'name' => 'show_author',
1056 'value' => 'yes'
1057 ],
1058 [
1059 'name' => 'show_comments',
1060 'value' => 'yes'
1061 ]
1062 ]
1063 ],
1064 ]
1065 );
1066
1067 $this->add_control(
1068 'meta_color',
1069 [
1070 'label' => esc_html__('Color', 'ultimate-post-kit'),
1071 'type' => Controls_Manager::COLOR,
1072 'selectors' => [
1073 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-meta, {{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-meta .upk-author-name-wrap .upk-author-name' => 'color: {{VALUE}};',
1074 ],
1075 ]
1076 );
1077
1078 $this->add_control(
1079 'meta_hover_color',
1080 [
1081 'label' => esc_html__('Hover Color', 'ultimate-post-kit'),
1082 'type' => Controls_Manager::COLOR,
1083 'selectors' => [
1084 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-meta .upk-author-name-wrap .upk-author-name:hover' => 'color: {{VALUE}};',
1085 ],
1086 ]
1087 );
1088
1089 $this->add_responsive_control(
1090 'meta_spacing',
1091 [
1092 'label' => esc_html__('Spacing', 'ultimate-post-kit'),
1093 'type' => Controls_Manager::SLIDER,
1094 'range' => [
1095 'px' => [
1096 'min' => 0,
1097 'max' => 50,
1098 ],
1099 ],
1100 'selectors' => [
1101 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-meta' => 'padding-top: {{SIZE}}{{UNIT}};',
1102 ],
1103 ]
1104 );
1105
1106 $this->add_responsive_control(
1107 'meta_space_between',
1108 [
1109 'label' => esc_html__('Space Between', 'ultimate-post-kit'),
1110 'type' => Controls_Manager::SLIDER,
1111 'range' => [
1112 'px' => [
1113 'min' => 0,
1114 'max' => 50,
1115 ],
1116 ],
1117 'selectors' => [
1118 '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-meta > div:before' => 'margin: 0 {{SIZE}}{{UNIT}};',
1119 ],
1120 ]
1121 );
1122
1123 $this->add_group_control(
1124 Group_Control_Typography::get_type(),
1125 [
1126 'name' => 'meta_typography',
1127 'label' => esc_html__('Typography', 'ultimate-post-kit'),
1128 'selector' => '{{WRAPPER}} .upk-fanel-list .upk-item .upk-fanel-meta',
1129 ]
1130 );
1131
1132 $this->end_controls_section();
1133
1134 //Global Pagination Controls
1135 $this->register_pagination_controls();
1136
1137 //Global Ajax Loadmore Style Controls
1138 $this->register_ajax_loadmore_style_controls();
1139 }
1140
1141 /**
1142 * Get post query builder arguments
1143 */
1144 public function query_posts( $posts_per_page ) {
1145 $settings = $this->get_settings();
1146 $posts_per_page = isset( $posts_per_page ) ? (int) $posts_per_page : 0;
1147 $args = $this->getGroupControlQueryArgs();
1148 $is_current_query = ( ! empty( $settings['posts_source'] ) && $settings['posts_source'] === 'current_query' );
1149
1150 if ( $is_current_query ) {
1151 unset( $args['offset'] );
1152 unset( $args['no_found_rows'] );
1153 $posts_per_page = 0;
1154 }
1155
1156 if ( $posts_per_page > 0 ) {
1157 $args['posts_per_page'] = $posts_per_page;
1158 } else {
1159 $args['posts_per_page'] = (int) get_option( 'posts_per_page', 10 );
1160 }
1161
1162 if ( $settings['show_pagination'] ) {
1163 $args['paged'] = max( 1, (int) get_query_var( 'paged' ), (int) get_query_var( 'page' ) );
1164 }
1165
1166 $this->_query = new \WP_Query( $args );
1167 }
1168
1169 public function render_author() {
1170
1171 if (!$this->get_settings('show_author')) {
1172 return;
1173 }
1174 ?>
1175 <div class="upk-author-name-wrap">
1176 <span class="upk-by"><?php echo esc_html_x('by', 'Frontend', 'ultimate-post-kit') ?></span>
1177 <a class="upk-author-name" href="<?php echo esc_url( get_author_posts_url(get_the_author_meta('ID')) ); ?>">
1178 <?php echo esc_html( get_the_author() ); ?>
1179 </a>
1180 </div>
1181 <?php
1182 }
1183
1184 public function render_comments($id = 0) {
1185
1186 if (!$this->get_settings('show_comments')) {
1187 return;
1188 }
1189 ?>
1190
1191 <div class="upk-fanel-comments">
1192 <?php echo esc_html( $this->upk_get_formatted_comments_count( $id ) ); ?>
1193 </div>
1194
1195 <?php
1196 }
1197
1198 public function render_post_grid_item($post_id, $image_size, $excerpt_length) {
1199 $settings = $this->get_settings_for_display();
1200
1201 if ('yes' == $settings['global_link']) {
1202
1203 $this->add_render_attribute('list-item', 'onclick', "window.open('" . esc_url(get_permalink()) . "', '_self')", true);
1204 }
1205 $this->add_render_attribute('list-item', 'class', 'upk-item', true);
1206
1207 if ('yes' == $settings['show_readmore']) {
1208 $this->add_render_attribute('list-box', 'class', 'upk-content upk-readmore--yes', true);
1209 } else {
1210 $this->add_render_attribute('list-box', 'class', 'upk-content', true);
1211 }
1212
1213 ?>
1214 <div <?php $this->print_render_attribute_string('list-item'); ?>>
1215 <div class="upk-item-box">
1216 <div class="upk-image-wrap">
1217
1218 <?php $this->render_image(get_post_thumbnail_id($post_id), $image_size); ?>
1219
1220 <?php if ($settings['show_date'] == 'yes') : ?>
1221 <div class="upk-fanel-date-wrap">
1222 <span class="upk-fanel-date"><?php echo get_the_date('d'); ?></span>
1223 <span class="upk-fanel-month"><?php echo get_the_date('M'); ?></span>
1224 </div>
1225 <?php endif; ?>
1226
1227 </div>
1228
1229 <div <?php $this->print_render_attribute_string('list-box'); ?>>
1230 <?php $this->render_category(); ?>
1231
1232 <?php $this->render_title(substr($this->get_name(), 4)); ?>
1233
1234 <?php $this->render_excerpt($excerpt_length); ?>
1235
1236 <?php if ($settings['show_author'] or $settings['show_comments'] or $settings['show_reading_time']) : ?>
1237 <div class="upk-fanel-meta">
1238 <?php if ($settings['show_author']) : ?>
1239 <?php $this->render_author(); ?>
1240 <?php endif; ?>
1241 <?php if ($settings['show_comments']) : ?>
1242 <div data-separator="<?php echo esc_attr($settings['meta_separator']); ?>">
1243 <?php $this->render_comments($post_id); ?>
1244 </div>
1245 <?php endif; ?>
1246
1247 <?php if (_is_upk_pro_activated()) :
1248 if ('yes' === $settings['show_reading_time']) : ?>
1249 <div class="upk-reading-time" data-separator="<?php echo esc_attr($settings['meta_separator']); ?>">
1250 <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'], $settings['hide_seconds'] ?? 'no', $settings['hide_minutes'] ?? 'no' ) ); ?>
1251 </div>
1252 <?php endif; ?>
1253 <?php endif; ?>
1254 </div>
1255 <?php endif; ?>
1256
1257 </div>
1258 <?php if ($settings['show_readmore'] == 'yes') : ?>
1259 <a class="upk-fanel-read-more" href="<?php echo esc_url(get_permalink()) ?>">
1260 <i class="upk-icon-arrow-right-7" aria-hidden="true"></i>
1261 </a>
1262 <?php endif; ?>
1263 </div>
1264 </div>
1265
1266 <?php
1267 }
1268
1269 protected function render() {
1270 $settings = $this->get_settings_for_display();
1271
1272 $this->query_posts($settings['item_limit']['size']);
1273 $wp_query = $this->get_query();
1274
1275 if (!$wp_query->found_posts) {
1276 return;
1277 }
1278
1279 $this->add_render_attribute(
1280 [
1281 'upk-fanel-list' => [
1282 'class' => 'upk-fanel-list-container upk-ajax-grid',
1283 'data-loadmore' => [
1284 wp_json_encode(
1285 array_filter([
1286 'loadmore_enable' => $settings['ajax_loadmore_enable'],
1287 'loadmore_btn' => $settings['ajax_loadmore_btn'],
1288 'infinite_scroll' => $settings['ajax_loadmore_infinite_scroll'],
1289 ])
1290 ),
1291 ],
1292 ],
1293 ]
1294 );
1295
1296 if ($settings['ajax_loadmore_enable'] == 'yes') {
1297 $ajax_settings = [
1298 'posts_source' => isset($settings['posts_source']) ? $settings['posts_source'] : 'post',
1299 'posts_per_page' => isset($settings['item_limit']['size']) ? $settings['item_limit']['size'] : 6,
1300 'ajax_item_load' => isset($settings['ajax_loadmore_items']) ? $settings['ajax_loadmore_items'] : 3,
1301 'posts_selected_ids' => isset($settings['posts_selected_ids']) ? $settings['posts_selected_ids'] : '',
1302 'posts_include_by' => isset($settings['posts_include_by']) ? $settings['posts_include_by'] : [],
1303 'posts_include_author_ids' => isset($settings['posts_include_author_ids']) ? $settings['posts_include_author_ids'] : '',
1304 'posts_include_term_ids' => isset($settings['posts_include_term_ids']) ? $settings['posts_include_term_ids'] : '',
1305 'posts_exclude_by' => isset($settings['posts_exclude_by']) ? $settings['posts_exclude_by'] : [],
1306 'posts_exclude_ids' => isset($settings['posts_exclude_ids']) ? $settings['posts_exclude_ids'] : '',
1307 'posts_exclude_author_ids' => isset($settings['posts_exclude_author_ids']) ? $settings['posts_exclude_author_ids'] : '',
1308 'posts_exclude_term_ids' => isset($settings['posts_exclude_term_ids']) ? $settings['posts_exclude_term_ids'] : '',
1309 'posts_offset' => isset($settings['posts_offset']) ? $settings['posts_offset'] : 0,
1310 'posts_select_date' => isset($settings['posts_select_date']) ? $settings['posts_select_date'] : '',
1311 'posts_date_before' => isset($settings['posts_date_before']) ? $settings['posts_date_before'] : '',
1312 'posts_date_after' => isset($settings['posts_date_after']) ? $settings['posts_date_after'] : '',
1313 'posts_orderby' => isset($settings['posts_orderby']) ? $settings['posts_orderby'] : 'date',
1314 'posts_order' => isset($settings['posts_order']) ? $settings['posts_order'] : 'DESC',
1315 'posts_ignore_sticky_posts' => isset($settings['posts_ignore_sticky_posts']) ? $settings['posts_ignore_sticky_posts'] : 'no',
1316 'posts_only_with_featured_image'=> isset($settings['posts_only_with_featured_image']) ? $settings['posts_only_with_featured_image'] : 'no',
1317 // List Settings
1318 'show_title' => isset($settings['show_title']) ? $settings['show_title'] : 'yes',
1319 'title_tags' => isset( $settings['title_tags'] ) ? $settings['title_tags'] : 'h3',
1320 'title_style' => isset($settings['title_style']) ? $settings['title_style'] : '',
1321 'show_category' => isset($settings['show_category']) ? $settings['show_category'] : 'yes',
1322 'show_date' => isset($settings['show_date']) ? $settings['show_date'] : 'yes',
1323 'show_readmore' => isset($settings['show_readmore']) ? $settings['show_readmore'] : 'no',
1324 'show_excerpt' => isset($settings['show_excerpt']) ? $settings['show_excerpt'] : 'no',
1325 'excerpt_length' => isset($settings['excerpt_length']) ? $settings['excerpt_length'] : 15,
1326 'show_author' => isset($settings['show_author']) ? $settings['show_author'] : 'no',
1327 'show_comments' => isset($settings['show_comments']) ? $settings['show_comments'] : 'no',
1328 'meta_separator' => isset($settings['meta_separator']) ? $settings['meta_separator'] : '//',
1329 'show_reading_time' => isset($settings['show_reading_time']) ? $settings['show_reading_time'] : 'no',
1330 'avg_reading_speed' => isset($settings['avg_reading_speed']) ? $settings['avg_reading_speed'] : 200,
1331 'hide_seconds' => isset($settings['hide_seconds']) ? $settings['hide_seconds'] : 'no',
1332 'hide_minutes' => isset($settings['hide_minutes']) ? $settings['hide_minutes'] : 'no',
1333 'primary_thumbnail_size' => isset($settings['primary_thumbnail_size']) ? $settings['primary_thumbnail_size'] : 'medium',
1334 'upk_link_new_tab' => isset($settings['upk_link_new_tab']) ? $settings['upk_link_new_tab'] : 'no',
1335 'global_link' => isset($settings['global_link']) ? $settings['global_link'] : 'no',
1336 ];
1337
1338 $this->add_render_attribute(
1339 [
1340 'upk-fanel-list' => [
1341 'data-settings' => [
1342 wp_json_encode($ajax_settings)
1343 ],
1344 ],
1345 ]
1346 );
1347 }
1348
1349 $this->add_render_attribute('list-wrap', 'class', 'upk-fanel-list upk-ajax-grid-wrap');
1350
1351 if (isset($settings['upk_in_animation_show']) && ($settings['upk_in_animation_show'] == 'yes')) {
1352 $this->add_render_attribute('list-wrap', 'class', 'upk-in-animation');
1353 if (isset($settings['upk_in_animation_delay']['size'])) {
1354 $this->add_render_attribute('list-wrap', 'data-in-animation-delay', $settings['upk_in_animation_delay']['size']);
1355 }
1356 }
1357
1358 ?>
1359 <div <?php $this->print_render_attribute_string('upk-fanel-list'); ?>>
1360 <div <?php $this->print_render_attribute_string('list-wrap'); ?>>
1361 <?php while ($wp_query->have_posts()) :
1362 $wp_query->the_post();
1363
1364 $thumbnail_size = $settings['primary_thumbnail_size'];
1365
1366 ?>
1367
1368 <?php $this->render_post_grid_item(get_the_ID(), $thumbnail_size, $settings['excerpt_length']); ?>
1369
1370 <?php endwhile; ?>
1371 </div>
1372 </div>
1373
1374 <?php $this->render_ajax_loadmore(); ?>
1375
1376 <?php
1377
1378 if ($settings['show_pagination']) { ?>
1379 <div class="ep-pagination">
1380 <?php ultimate_post_kit_post_pagination($wp_query, $this->get_id()); ?>
1381 </div>
1382 <?php
1383 }
1384 wp_reset_postdata();
1385 }
1386 }
1387