PluginProbe
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets / 4.0.9
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets v4.0.9
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 / ramble-grid / widgets / ramble-grid.php

ramble-grid.php in Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets 4.0.9, at modules/ramble-grid/widgets/ramble-grid.php

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