PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.4.6
Easy Elements for Elementor – Addons & Website Templates v1.4.6
1.5.3 1.5.2 1.5.1 1.5.0 1.4.9 1.4.6 1.4.7 1.4.8 1.4.5 1.4.4 1.4.3 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 All 47 releases
easy-elements / widgets / blog-grid / blog-grid.php

blog-grid.php in Easy Elements for Elementor – Addons & Website Templates 1.4.6, at widgets/blog-grid/blog-grid.php

2,707 lines 104.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Easyel\EasyElements\Widgets;
3 use Elementor\Utils;
4 use Elementor\Icons_Manager;
5 use Elementor\Controls_Manager;
6 use Elementor\Group_Control_Image_Size;
7
8 defined( 'ABSPATH' ) || die();
9
10 class Easyel_Blog_Grid__Widget extends \Elementor\Widget_Base {
11 protected function get_all_posts() {
12 $posts = get_posts( [ 'numberposts' => -1 ] );
13 $options = [];
14 foreach ( $posts as $post ) {
15 $options[ $post->ID ] = $post->post_title;
16 }
17 return $options;
18 }
19
20 protected function get_post_type_options() {
21 $exclude_post_types = ['attachment', 'revision', 'nav_menu_item', 'custom_post_type_slug'];
22
23 $post_types = get_post_types(['public' => true], 'objects');
24 $options = [];
25
26 foreach ($post_types as $post_type => $post_type_obj) {
27 if (!in_array($post_type, $exclude_post_types)) {
28 $taxonomies = get_object_taxonomies($post_type, 'names');
29 if (!empty($taxonomies)) {
30 $options[$post_type] = $post_type_obj->label;
31 }
32 }
33 }
34 return $options;
35 }
36
37 protected function get_all_categories() {
38 $cats = get_categories( [ 'hide_empty' => false ] );
39 $options = [];
40 foreach ( $cats as $cat ) {
41 $options[ $cat->term_id ] = $cat->name;
42 }
43 return $options;
44 }
45
46
47 public function get_name() {
48 return 'eel-blog-grid';
49 }
50
51 public function get_title() {
52 return esc_html__( 'Post Grid', 'easy-elements' );
53 }
54
55 public function get_icon() {
56 return 'easyicon easyelIcon-post-grid';
57 }
58
59 public function get_categories() {
60 return [ 'easyicon easyelIcon-post-grid' ];
61 }
62
63 public function get_keywords() {
64 return [ 'blog', 'grid', 'post', 'news' ];
65 }
66
67 public function get_style_depends() {
68 return [
69 'eel-blog-grid',
70 ];
71 }
72
73 protected function register_controls() {
74
75 $this->start_controls_section(
76 '_section_grid_query',
77 [
78 'label' => esc_html__( 'Query Settings', 'easy-elements' ),
79 'tab' => Controls_Manager::TAB_CONTENT,
80 ]
81 );
82
83 $this->add_control(
84 'post_type',
85 [
86 'label' => esc_html__( 'Post Type', 'easy-elements' ),
87 'type' => Controls_Manager::SELECT,
88 'options' => $this->get_post_type_options(),
89 'default' => 'post',
90 'description' => '',
91 ]
92 );
93
94 $options = [
95 'category' => esc_html__( 'Category', 'easy-elements' ),
96 'post' => esc_html__( 'Specific Posts', 'easy-elements' ),
97 ];
98
99 if ( apply_filters( 'easyel/pro_enabled', false ) ) {
100 $options['user'] = esc_html__( 'User', 'easy-elements' );
101 $options['userrole'] = esc_html__( 'UserRole', 'easy-elements' );
102 }
103
104 $this->add_control(
105 'source_type',
106 [
107 'label' => esc_html__( 'Source Type', 'easy-elements' ),
108 'type' => Controls_Manager::SELECT,
109 'options' => $options,
110 'default' => 'category',
111 ]
112 );
113
114 $this->add_control(
115 'categories',
116 [
117 'label' => esc_html__( 'Select Categories', 'easy-elements' ),
118 'type' => Controls_Manager::SELECT2,
119 'multiple' => true,
120 'options' => $this->get_all_categories(),
121 'label_block' => true,
122 'condition' => [
123 'source_type' => 'category',
124 ],
125 ]
126 );
127
128 $this->add_control(
129 'exclude_categories',
130 [
131 'label' => esc_html__( 'Exclude Categories', 'easy-elements' ),
132 'type' => Controls_Manager::SELECT2,
133 'multiple' => true,
134 'options' => $this->get_all_categories(),
135 'label_block' => true,
136 'condition' => [
137 'source_type' => 'category',
138 ],
139 ]
140 );
141
142 $this->add_control(
143 'post__in',
144 [
145 'label' => esc_html__( 'Select Specific Posts', 'easy-elements' ),
146 'type' => Controls_Manager::SELECT2,
147 'options' => $this->get_all_posts(),
148 'multiple' => true,
149 'label_block' => true,
150 'description' => '',
151 'condition' => [
152 'source_type' => 'post',
153 ],
154 ]
155 );
156
157 $this->add_control(
158 'exclude_posts',
159 [
160 'label' => esc_html__( 'Exclude Posts', 'easy-elements' ),
161 'type' => \Elementor\Controls_Manager::SELECT2,
162 'multiple' => true,
163 'options' => $this->get_all_posts(),
164 'label_block' => true,
165 'description' => '',
166 'condition' => [
167 'source_type' => 'post',
168 ],
169 ]
170 );
171
172 if ( apply_filters( 'easyel/pro_enabled', false ) ) {
173
174 do_action( 'easyel/userdata/source/control', $this );
175 }
176
177 $this->add_control(
178 'posts_per_page',
179 [
180 'label' => esc_html__( 'Posts Per Page', 'easy-elements' ),
181 'type' => Controls_Manager::NUMBER,
182 'default' => 6,
183 ]
184 );
185
186 $this->add_control(
187 'offset',
188 [
189 'label' => esc_html__( 'Offset', 'easy-elements' ),
190 'type' => Controls_Manager::NUMBER,
191 'description' => esc_html__( 'Skip posts from the top of the query.', 'easy-elements' ),
192 'separator' => 'before',
193 ]
194 );
195
196 $this->add_control(
197 'orderby',
198 [
199 'label' => esc_html__( 'Order By', 'easy-elements' ),
200 'type' => Controls_Manager::SELECT,
201 'options' => [
202 'date' => esc_html__( 'Date', 'easy-elements' ),
203 'title' => esc_html__( 'Title', 'easy-elements' ),
204 'rand' => esc_html__( 'Random', 'easy-elements' ),
205 'menu_order' => esc_html__( 'Menu Order', 'easy-elements' ),
206 ],
207 'default' => 'date',
208 'description' => '',
209 'separator' => 'before',
210 ]
211 );
212
213 $this->add_control(
214 'order',
215 [
216 'label' => esc_html__( 'Order', 'easy-elements' ),
217 'type' => Controls_Manager::SELECT,
218 'options' => [
219 'DESC' => esc_html__( 'Descending', 'easy-elements' ),
220 'ASC' => esc_html__( 'Ascending', 'easy-elements' ),
221 ],
222 'default' => 'DESC',
223 'description' => '',
224 ]
225 );
226
227
228 $this->end_controls_section();
229
230 $this->start_controls_section(
231 '_section_grid',
232 [
233 'label' => esc_html__( 'Posts Settings', 'easy-elements' ),
234 'tab' => Controls_Manager::TAB_CONTENT,
235 ]
236 );
237
238 $this->add_control(
239 'title_tag',
240 [
241 'label' => esc_html__( 'Title HTML Tag', 'easy-elements' ),
242 'type' => Controls_Manager::SELECT,
243 'options' => [
244 'h1' => 'H1',
245 'h2' => 'H2',
246 'h3' => 'H3',
247 'h4' => 'H4',
248 'h5' => 'H5',
249 'h6' => 'H6',
250 ],
251 'default' => 'h3',
252 ]
253 );
254
255 $this->add_control(
256 'title_trim',
257 [
258 'label' => esc_html__( 'Title Trim Words', 'easy-elements' ),
259 'type' => Controls_Manager::NUMBER,
260 'description' => esc_html__('Limit number of words in the post title', 'easy-elements'),
261 'separator' => 'before',
262 ]
263 );
264
265 $this->add_control(
266 'show_excerpt',
267 [
268 'label' => esc_html__( 'Show Excerpt', 'easy-elements' ),
269 'type' => Controls_Manager::SWITCHER,
270 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
271 'label_off' => esc_html__( 'No', 'easy-elements' ),
272 'default' => 'yes',
273 'separator' => 'before',
274 ]
275 );
276
277 $this->add_control(
278 'excerpt_trim',
279 [
280 'label' => esc_html__( 'Excerpt Trim Words', 'easy-elements' ),
281 'type' => Controls_Manager::NUMBER,
282 'description' => esc_html__('Limit number of words in the excerpt', 'easy-elements'),
283 'separator' => 'before',
284 'condition' => [
285 'show_excerpt' => 'yes',
286 ]
287 ]
288 );
289
290 $this->add_control(
291 'item_alignment',
292 [
293 'label' => __( 'Alignment', 'easy-elements' ),
294 'type' => \Elementor\Controls_Manager::CHOOSE,
295 'options' => [
296 'left' => [
297 'title' => __( 'Left', 'easy-elements' ),
298 'icon' => 'eicon-text-align-left',
299 ],
300 'center' => [
301 'title' => __( 'Center', 'easy-elements' ),
302 'icon' => 'eicon-text-align-center',
303 ],
304 'right' => [
305 'title' => __( 'Right', 'easy-elements' ),
306 'icon' => 'eicon-text-align-right',
307 ],
308 ],
309 'default' => 'left',
310 'separator' => 'before',
311 'toggle' => true,
312 'selectors' => [
313 '{{WRAPPER}} .eel-post-grid-wrap .grid-item' => 'text-align: {{VALUE}};',
314 ],
315 ]
316 );
317
318 $this->add_responsive_control(
319 'columns',
320 [
321 'label' => esc_html__( 'Select Columns', 'easy-elements' ),
322 'type' => Controls_Manager::SELECT,
323 'default' => '4',
324 'tablet_default' => '3',
325 'mobile_default' => '2',
326 'options' => [
327 '1' => '1 Column',
328 '2' => '2 Columns',
329 '3' => '3 Columns',
330 '4' => '4 Columns',
331 '5' => '5 Columns',
332 '6' => '6 Columns',
333 ],
334 'selectors' => [
335 '{{WRAPPER}} .eel-post-grid-wrap' =>
336 'grid-template-columns: repeat({{VALUE}}, 1fr);',
337 ],
338 'separator' => 'before',
339 ]
340 );
341
342
343 $this->add_responsive_control(
344 'flex_gap',
345 [
346 'label' => esc_html__( 'Column Spacing', 'easy-elements' ),
347 'type' => \Elementor\Controls_Manager::SLIDER,
348 'size_units' => [ 'px', 'em', 'rem' ],
349 'range' => [
350 'px' => [
351 'min' => 0,
352 'max' => 100,
353 ],
354 'em' => [
355 'min' => 0,
356 'max' => 10,
357 ],
358 'rem' => [
359 'min' => 0,
360 'max' => 10,
361 ],
362 ],
363 'default' => [
364 'unit' => 'px',
365 'size' => 30,
366 ],
367 'selectors' => [
368 '{{WRAPPER}} .eel-post-grid-wrap' => 'gap: {{SIZE}}{{UNIT}};',
369 ],
370 'separator' => 'before',
371 ]
372 );
373
374 $this->end_controls_section();
375
376
377 $this->start_controls_section(
378 '_section_meta',
379 [
380 'label' => esc_html__( 'Meta Settings', 'easy-elements' ),
381 'tab' => Controls_Manager::TAB_CONTENT,
382 ]
383 );
384
385 $this->add_control(
386 'show_meta',
387 [
388 'label' => esc_html__('Show Meta', 'easy-elements'),
389 'type' => \Elementor\Controls_Manager::SELECT2,
390 'multiple' => true,
391 'options' => [
392 'date' => esc_html__('Date', 'easy-elements'),
393 'author' => esc_html__('Author', 'easy-elements'),
394 'category' => esc_html__('Category', 'easy-elements'),
395 'comments' => esc_html__('Comments', 'easy-elements'),
396 'read_time' => esc_html__('Reading Time', 'easy-elements'),
397 ],
398 'default' => ['date', 'author'],
399 'label_block' => true,
400 ]
401 );
402
403 $this->add_control(
404 'meta_order_heading',
405 [
406 'label' => esc_html__('Meta Order (1 = First)', 'easy-elements'),
407 'type' => \Elementor\Controls_Manager::HEADING,
408 'separator' => 'before',
409 ]
410 );
411
412 $this->add_control(
413 'meta_order_date',
414 [
415 'label' => esc_html__('Date', 'easy-elements'),
416 'type' => \Elementor\Controls_Manager::NUMBER,
417 'default' => 1,
418 'min' => 1,
419 'max' => 5,
420 'condition' => [ 'show_meta' => 'date' ],
421 ]
422 );
423
424 $this->add_control(
425 'meta_order_author',
426 [
427 'label' => esc_html__('Author', 'easy-elements'),
428 'type' => \Elementor\Controls_Manager::NUMBER,
429 'default' => 2,
430 'min' => 1,
431 'max' => 5,
432 'condition' => [ 'show_meta' => 'author' ],
433 ]
434 );
435
436 $this->add_control(
437 'meta_order_category',
438 [
439 'label' => esc_html__('Category', 'easy-elements'),
440 'type' => \Elementor\Controls_Manager::NUMBER,
441 'default' => 3,
442 'min' => 1,
443 'max' => 5,
444 'condition' => [ 'show_meta' => 'category' ],
445 ]
446 );
447
448 $this->add_control(
449 'meta_order_comments',
450 [
451 'label' => esc_html__('Comments', 'easy-elements'),
452 'type' => \Elementor\Controls_Manager::NUMBER,
453 'default' => 4,
454 'min' => 1,
455 'max' => 5,
456 'condition' => [ 'show_meta' => 'comments' ],
457 ]
458 );
459
460 $this->add_control(
461 'meta_order_read_time',
462 [
463 'label' => esc_html__('Reading Time', 'easy-elements'),
464 'type' => \Elementor\Controls_Manager::NUMBER,
465 'default' => 5,
466 'min' => 1,
467 'max' => 5,
468 'condition' => [ 'show_meta' => 'read_time' ],
469 ]
470 );
471
472 $this->add_control(
473 'show_date_icon',
474 [
475 'label' => esc_html__( 'Show Date Icon', 'easy-elements' ),
476 'type' => Controls_Manager::SWITCHER,
477 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
478 'label_off' => esc_html__( 'No', 'easy-elements' ),
479 'default' => 'yes',
480 'condition' => [
481 'show_meta' => 'date',
482 ]
483 ]
484 );
485
486 $this->add_control(
487 'date_icon',
488 [
489 'label' => esc_html__( 'Date Icon', 'easy-elements' ),
490 'type' => \Elementor\Controls_Manager::ICONS,
491 'default' => [
492 'value' => '',
493 'library' => 'fa-solid',
494 ],
495 'condition' => [
496 'show_date_icon' => 'yes',
497 'show_meta' => 'date',
498 ],
499 ]
500 );
501
502 $this->add_control(
503 'show_by_label',
504 [
505 'label' => __( 'Show "By" Label', 'easy-elements' ),
506 'type' => \Elementor\Controls_Manager::SWITCHER,
507 'label_on' => __( 'Yes', 'easy-elements' ),
508 'label_off' => __( 'No', 'easy-elements' ),
509 'return_value' => 'yes',
510 'default' => 'yes',
511 ]
512 );
513
514 $this->add_control(
515 'author_link_enable',
516 [
517 'label' => __( 'Author Link', 'easy-elements' ),
518 'type' => \Elementor\Controls_Manager::SWITCHER,
519 'label_on' => __( 'Yes', 'easy-elements' ),
520 'label_off' => __( 'No', 'easy-elements' ),
521 'return_value' => 'yes',
522 'default' => '',
523 ]
524 );
525
526
527 $this->add_control(
528 'author_icon_type',
529 [
530 'label' => esc_html__( 'Author Indicator', 'easy-elements' ),
531 'type' => Controls_Manager::SELECT,
532 'default' => 'icon',
533 'options' => [
534 'none' => esc_html__( 'None', 'easy-elements' ),
535 'icon' => esc_html__( 'Icon', 'easy-elements' ),
536 'avatar' => esc_html__( 'Avatar', 'easy-elements' ),
537 ],
538 'condition' => [
539 'show_meta' => 'author',
540 ],
541 ]
542 );
543
544 $this->add_control(
545 'author_icon',
546 [
547 'label' => esc_html__( 'Author Icon', 'easy-elements' ),
548 'type' => \Elementor\Controls_Manager::ICONS,
549 'default' => [
550 'value' => '',
551 'library' => 'fa-solid',
552 ],
553 'condition' => [
554 'author_icon_type' => 'icon',
555 'show_meta' => 'author',
556 ],
557 ]
558 );
559
560 $this->add_responsive_control(
561 'author_avatar_size',
562 [
563 'label' => esc_html__( 'Avatar Size', 'easy-elements' ),
564 'type' => Controls_Manager::SLIDER,
565 'range' => [
566 'px' => [ 'min' => 16, 'max' => 100 ],
567 ],
568 'default' => [ 'size' => 22, 'unit' => 'px' ],
569 'selectors' => [
570 '{{WRAPPER}} .eel--blog-author.eel--has-avatar .eel--author-avatar' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
571 ],
572 'condition' => [
573 'author_icon_type' => 'avatar',
574 'show_meta' => 'author',
575 ],
576 ]
577 );
578
579 $this->add_responsive_control(
580 'author_avatar_border_radius',
581 [
582 'label' => esc_html__( 'Avatar Border Radius', 'easy-elements' ),
583 'type' => Controls_Manager::SLIDER,
584 'range' => [
585 'px' => [ 'min' => 0, 'max' => 100 ],
586 '%' => [ 'min' => 0, 'max' => 100 ],
587 ],
588 'size_units' => [ 'px', '%' ],
589 'default' => [ 'size' => 50, 'unit' => '%' ],
590 'selectors' => [
591 '{{WRAPPER}} .eel--blog-author.eel--has-avatar .eel--author-avatar' => 'border-radius: {{SIZE}}{{UNIT}};',
592 ],
593 'condition' => [
594 'author_icon_type' => 'avatar',
595 'show_meta' => 'author',
596 ],
597 ]
598 );
599
600
601 $this->add_control(
602 'show_category_icon',
603 [
604 'label' => esc_html__( 'Show Category Icon', 'easy-elements' ),
605 'type' => Controls_Manager::SWITCHER,
606 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
607 'label_off' => esc_html__( 'No', 'easy-elements' ),
608 'default' => 'yes',
609 'condition' => [
610 'show_meta' => 'category',
611 ]
612 ]
613 );
614
615 $this->add_control(
616 'category_icon',
617 [
618 'label' => esc_html__( 'Category Icon', 'easy-elements' ),
619 'type' => \Elementor\Controls_Manager::ICONS,
620 'default' => [
621 'value' => '',
622 'library' => 'fa-solid',
623 ],
624 'condition' => [
625 'show_category_icon' => 'yes',
626 'show_meta' => 'category',
627 ],
628 ]
629 );
630
631 $this->add_control(
632 'show_comments_icon',
633 [
634 'label' => esc_html__( 'Show Comments Icon', 'easy-elements' ),
635 'type' => \Elementor\Controls_Manager::SWITCHER,
636 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
637 'label_off' => esc_html__( 'No', 'easy-elements' ),
638 'default' => 'yes',
639 'condition' => [
640 'show_meta' => 'comments',
641 ]
642 ]
643 );
644
645 $this->add_control(
646 'comments_icon',
647 [
648 'label' => esc_html__( 'Comments Icon', 'easy-elements' ),
649 'type' => \Elementor\Controls_Manager::ICONS,
650 'condition' => [
651 'show_comments_icon' => 'yes',
652 'show_meta' => 'comments',
653 ],
654 ]
655 );
656
657 $this->add_control(
658 'show_read_time_icon',
659 [
660 'label' => esc_html__('Show Reading Time Icon', 'easy-elements'),
661 'type' => \Elementor\Controls_Manager::SWITCHER,
662 'default' => 'yes',
663 ]
664 );
665
666 $this->add_control(
667 'read_time_icon',
668 [
669 'label' => esc_html__('Reading Time Icon', 'easy-elements'),
670 'type' => \Elementor\Controls_Manager::ICONS,
671 'condition' => [
672 'show_read_time_icon' => 'yes',
673 ],
674 ]
675 );
676
677 $this->add_control(
678 'show_date_on_top',[
679 'label' => esc_html__( 'Date Badge', 'easy-elements' ),
680 'type' => \Elementor\Controls_Manager::SWITCHER,
681 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
682 'label_off' => esc_html__( 'No', 'easy-elements' ),
683 'default' => 'no',
684 ]
685 );
686
687 $this->add_control(
688 'show_category_badge',[
689 'label' => esc_html__( 'Category Badge', 'easy-elements' ),
690 'type' => \Elementor\Controls_Manager::SWITCHER,
691 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
692 'label_off' => esc_html__( 'No', 'easy-elements' ),
693 'default' => 'no',
694 ]
695 );
696
697 $this->add_responsive_control(
698 'meta_icon_offset',
699 [
700 'label' => esc_html__( 'Meta Icon Offset (px)', 'easy-elements' ),
701 'type' => \Elementor\Controls_Manager::SLIDER,
702 'size_units' => [ 'px' ],
703 'range' => [
704 'px' => [
705 'min' => -50,
706 'max' => 100,
707 ],
708 ],
709 'selectors' => [
710 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta svg, {{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta i' => 'top: {{SIZE}}{{UNIT}};',
711 ],
712 ]
713 );
714
715 $this->add_control(
716 'meta_position',
717 [
718 'label' => esc_html__( 'Meta Position', 'easy-elements' ),
719 'type' => \Elementor\Controls_Manager::CHOOSE,
720 'default' => 'up_title',
721 'options' => [
722 'up_title' => [
723 'title' => esc_html__( 'Above Title', 'easy-elements' ),
724 'icon' => 'eicon-v-align-top',
725 ],
726 'below_title' => [
727 'title' => esc_html__( 'Below Title', 'easy-elements' ),
728 'icon' => 'eicon-v-align-middle',
729 ],
730 'below_content' => [
731 'title' => esc_html__( 'Below Content', 'easy-elements' ),
732 'icon' => 'eicon-v-align-bottom',
733 ],
734 ],
735 'toggle' => false,
736 ]
737 );
738
739
740 $this->add_control(
741 'eel_separator',
742 [
743 'label' => esc_html__( 'Separator Type', 'easy-elements' ),
744 'type' => \Elementor\Controls_Manager::SELECT,
745 'options' => [
746 '' => esc_html__( 'None', 'easy-elements' ),
747 'line' => esc_html__( 'Line', 'easy-elements' ),
748 'circle' => esc_html__( 'Circle', 'easy-elements' ),
749 ],
750 'default' => '',
751 ]
752 );
753
754 $this->add_control(
755 'separator_color',
756 [
757 'label' => __( 'Separator Color', 'easy-elements' ),
758 'type' => \Elementor\Controls_Manager::COLOR,
759 'selectors' => [
760 '{{WRAPPER}} .eel--separator--line li + li::before, {{WRAPPER}} .eel--separator--circle li + li::before' => 'background-color: {{VALUE}};',
761 ],
762 'condition' => [
763 'eel_separator!' => '',
764 ],
765 ]
766 );
767
768 $this->add_responsive_control(
769 'separator_offset',
770 [
771 'label' => esc_html__( 'Separator Offset (px)', 'easy-elements' ),
772 'type' => \Elementor\Controls_Manager::SLIDER,
773 'size_units' => [ 'px' ],
774 'range' => [
775 'px' => [
776 'min' => -50,
777 'max' => 100,
778 ],
779 ],
780 'selectors' => [
781 '{{WRAPPER}} .eel--separator--line li + li::before, {{WRAPPER}} .eel--separator--circle li + li::before' => 'top: {{SIZE}}{{UNIT}};',
782 ],
783 'condition' => [
784 'eel_separator!' => '',
785 ],
786 ]
787 );
788
789 $this->add_responsive_control(
790 'meta_margin',
791 [
792 'label' => __( 'Margin', 'easy-elements' ),
793 'type' => \Elementor\Controls_Manager::DIMENSIONS,
794 'size_units' => [ 'px', 'em', '%' ],
795 'selectors' => [
796 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
797 ],
798 ]
799 );
800 $this->end_controls_section();
801
802 $this->start_controls_section(
803 'section_post_thumbnail',
804 [
805 'label' => esc_html__( 'Post Thumbnail', 'easy-elements' ),
806 'tab' => Controls_Manager::TAB_CONTENT,
807 ]
808 );
809
810 $this->add_control(
811 'show_thumbnail',
812 [
813 'label' => esc_html__( 'Show Thumbnail', 'easy-elements' ),
814 'type' => Controls_Manager::SWITCHER,
815 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
816 'label_off' => esc_html__( 'No', 'easy-elements' ),
817 'default' => 'yes',
818 ]
819 );
820
821 $this->add_responsive_control(
822 'post_image_alignment',
823 [
824 'label' => esc_html__( 'Alignment', 'easy-elements' ),
825 'type' => \Elementor\Controls_Manager::CHOOSE,
826 'options' => [
827 'row' => [
828 'title' => esc_html__( 'Left', 'easy-elements' ),
829 'icon' => 'eicon-h-align-left',
830 ],
831 'row-reverse' => [
832 'title' => esc_html__( 'Right', 'easy-elements' ),
833 'icon' => 'eicon-h-align-right',
834 ],
835 'column' => [
836 'title' => esc_html__( 'Top', 'easy-elements' ),
837 'icon' => 'eicon-v-align-top',
838 ],
839 'column-reverse' => [
840 'title' => esc_html__( 'Bottom', 'easy-elements' ),
841 'icon' => 'eicon-v-align-bottom',
842 ],
843 ],
844 'default' => '',
845 'toggle' => true,
846 'selectors' => [
847 '{{WRAPPER}} .grid-item-inner' => 'display:inline-flex; flex-direction: {{VALUE}}; align-items: center; gap: 30px;',
848 ],
849 ]
850 );
851
852
853 $this->add_responsive_control(
854 'flex_item_width_image',
855 [
856 'label' => esc_html__( 'Width', 'easy-elements' ),
857 'type' => \Elementor\Controls_Manager::SLIDER,
858 'size_units' => [ '%', 'px', 'vw' ],
859 'range' => [
860 '%' => [
861 'min' => 1,
862 'max' => 100,
863 ],
864 'px' => [
865 'min' => 50,
866 'max' => 1200,
867 ],
868 'vw' => [
869 'min' => 1,
870 'max' => 100,
871 ],
872 ],
873 'default' => [
874 'unit' => '%',
875 'size' => 100,
876 ],
877 'selectors' => [
878 '{{WRAPPER}} .eel--blog-img' => 'width: {{SIZE}}{{UNIT}}; max-width: {{SIZE}}{{UNIT}}; flex:0 0 {{SIZE}}{{UNIT}};',
879 ],
880 'condition' => [
881 'show_thumbnail' => 'yes',
882 'post_image_alignment!' => ['row', 'row-reverse'],
883 ]
884 ]
885 );
886
887
888 $this->add_responsive_control(
889 'flex_item_width',
890 [
891 'label' => esc_html__( 'Flex Width', 'easy-elements' ),
892 'type' => \Elementor\Controls_Manager::SLIDER,
893 'size_units' => [ '%', 'px', 'vw' ],
894 'range' => [
895 '%' => [
896 'min' => 1,
897 'max' => 100,
898 ],
899 'px' => [
900 'min' => 50,
901 'max' => 1200,
902 ],
903 'vw' => [
904 'min' => 1,
905 'max' => 100,
906 ],
907 ],
908 'default' => [
909 'unit' => '%',
910 'size' => 100,
911 ],
912 'selectors' => [
913 '{{WRAPPER}} .eel--blog-img' => 'flex: 0 0 {{SIZE}}{{UNIT}}; max-width: {{SIZE}}{{UNIT}};',
914 ],
915 'condition' => [
916 'show_thumbnail' => 'yes',
917 'post_image_alignment' => ['row', 'row-reverse'],
918 ]
919 ]
920 );
921
922 $this->add_responsive_control(
923 'post_image_height',
924 [
925 'label' => esc_html__( 'Height', 'easy-elements' ),
926 'type' => \Elementor\Controls_Manager::SLIDER,
927 'size_units' => [ 'px', 'em', '%' ],
928 'range' => [
929 'px' => [
930 'min' => 0,
931 'max' => 1000,
932 ],
933 'em' => [
934 'min' => 0,
935 'max' => 50,
936 ],
937 '%' => [
938 'min' => 0,
939 'max' => 100,
940 ],
941 ],
942 'selectors' => [
943 '{{WRAPPER}} .eel-post-grid-wrap .grid-item img' => 'height: {{SIZE}}{{UNIT}};',
944 ],
945 ]
946 );
947
948 $this->add_group_control(
949 Group_Control_Image_Size::get_type(),
950 [
951 'name' => 'thumbnail',
952 'default' => 'medium',
953 ]
954 );
955
956
957 $this->add_responsive_control(
958 'image_border_radius',
959 [
960 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
961 'type' => \Elementor\Controls_Manager::DIMENSIONS,
962 'size_units' => [ 'px', '%' ],
963 'selectors' => [
964 '{{WRAPPER}} .eel-post-grid-wrap .grid-item img, {{WRAPPER}} .grid-item-inner.eel--transparent-post .eel--overlay-all' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
965 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-img img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
966 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
967 ],
968 ]
969 );
970
971
972 $this->add_control(
973 'thumb_animation',
974 [
975 'label' => esc_html__( 'Hover Animation', 'easy-elements' ),
976 'type' => Controls_Manager::SWITCHER,
977 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
978 'label_off' => esc_html__( 'No', 'easy-elements' ),
979 'default' => 'no',
980 'condition' => [
981 'show_thumbnail' => 'yes',
982 ],
983 ]
984 );
985
986 $this->add_control(
987 'eel_animation_style',[
988 'label' => esc_html__( 'Animation', 'easy-elements' ),
989 'type' => Controls_Manager::SELECT,
990 'default' => 'left_right',
991 'options' => [
992 'left_right' => esc_html__( 'Left to Right', 'easy-elements' ),
993 'top_bottom' => esc_html__( 'Top to Bottom', 'easy-elements' ),
994 ],
995 'condition' => [
996 'show_thumbnail' => 'yes',
997 'thumb_animation' => 'yes',
998 ],
999 ]
1000 );
1001 $this->end_controls_section();
1002
1003 $this->start_controls_section(
1004 '_section_button',
1005 [
1006 'label' => esc_html__( 'Button Settings', 'easy-elements' ),
1007 'tab' => Controls_Manager::TAB_CONTENT,
1008 ]
1009 );
1010
1011 $this->add_control(
1012 'show_read_more',
1013 [
1014 'label' => esc_html__( 'Show Read More', 'easy-elements' ),
1015 'type' => \Elementor\Controls_Manager::SWITCHER,
1016 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
1017 'label_off' => esc_html__( 'No', 'easy-elements' ),
1018 'return_value' => 'yes',
1019 'default' => 'yes',
1020 ]
1021 );
1022
1023 $this->add_control(
1024 'read_more_text',
1025 [
1026 'label' => esc_html__( 'Read More', 'easy-elements' ),
1027 'type' => \Elementor\Controls_Manager::TEXT,
1028 'default' => esc_html__( 'Read More', 'easy-elements' ),
1029 'condition' => [
1030 'show_read_more' => 'yes',
1031 ],
1032 ]
1033 );
1034
1035 $this->add_control(
1036 'read_more_icon',
1037 [
1038 'label' => esc_html__( 'Read More Icon', 'easy-elements' ),
1039 'type' => \Elementor\Controls_Manager::ICONS,
1040 'default' => [
1041 'value' => '',
1042 'library' => 'fa-solid',
1043 ],
1044 'condition' => [
1045 'show_read_more' => 'yes',
1046 ],
1047 ]
1048 );
1049
1050 $this->add_control(
1051 'read_more_icon_position',
1052 [
1053 'label' => esc_html__( 'Icon Position', 'easy-elements' ),
1054 'type' => \Elementor\Controls_Manager::SELECT,
1055 'default' => 'after',
1056 'options' => [
1057 'before' => esc_html__( 'Before Text', 'easy-elements' ),
1058 'after' => esc_html__( 'After Text', 'easy-elements' ),
1059 ],
1060 'condition' => [
1061 'show_read_more' => 'yes',
1062 ],
1063 ]
1064 );
1065
1066 $this->start_controls_tabs( 'read_more_button_style_tabs' );
1067
1068 // Normal State
1069 $this->start_controls_tab(
1070 'button_style_normal',
1071 [
1072 'label' => esc_html__( 'Normal', 'easy-elements' ),
1073 ]
1074 );
1075
1076 $this->add_control(
1077 'button_text_color',
1078 [
1079 'label' => esc_html__( 'Color', 'easy-elements' ),
1080 'type' => \Elementor\Controls_Manager::COLOR,
1081 'selectors' => [
1082 '{{WRAPPER}} .eel--read-more a' => 'color: {{VALUE}};',
1083 '{{WRAPPER}} .eel--read-more a svg, {{WRAPPER}} .eel--read-more a svg path' => 'fill: {{VALUE}};',
1084 ],
1085 ]
1086 );
1087
1088 $this->add_group_control(
1089 \Elementor\Group_Control_Typography::get_type(),
1090 [
1091 'name' => 'button_typography',
1092 'selector' => '{{WRAPPER}} .eel--read-more a',
1093 ]
1094 );
1095
1096 $this->add_group_control(
1097 \Elementor\Group_Control_Background::get_type(),
1098 [
1099 'name' => 'eel_btn_background',
1100 'label' => __( 'Button Background', 'easy-elements' ),
1101 'types' => [ 'classic', 'gradient' ],
1102 'selector' => '{{WRAPPER}} .eel--read-more a',
1103 ]
1104 );
1105
1106 $this->add_group_control(
1107 \Elementor\Group_Control_Border::get_type(),
1108 [
1109 'name' => 'button_border',
1110 'selector' => '{{WRAPPER}} .eel--read-more a',
1111 ]
1112 );
1113
1114 $this->add_responsive_control(
1115 'button_border_radius',
1116 [
1117 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
1118 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1119 'size_units' => [ 'px', '%' ],
1120 'selectors' => [
1121 '{{WRAPPER}} .eel--read-more a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1122 ],
1123 ]
1124 );
1125
1126 $this->add_responsive_control(
1127 'button_padding',
1128 [
1129 'label' => esc_html__( 'Padding', 'easy-elements' ),
1130 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1131 'size_units' => [ 'px', 'em', '%' ],
1132 'selectors' => [
1133 '{{WRAPPER}} .eel--read-more a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1134 ],
1135 ]
1136 );
1137
1138 $this->add_responsive_control(
1139 'button_margin',
1140 [
1141 'label' => esc_html__( 'Margin', 'easy-elements' ),
1142 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1143 'size_units' => [ 'px', 'em', '%' ],
1144 'selectors' => [
1145 '{{WRAPPER}} .eel--read-more' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1146 ],
1147 ]
1148 );
1149
1150 $this->end_controls_tab();
1151
1152 $this->start_controls_tab(
1153 'button_style_hover',
1154 [
1155 'label' => esc_html__( 'Hover', 'easy-elements' ),
1156 ]
1157 );
1158
1159 $this->add_control(
1160 'button_text_color_hover',
1161 [
1162 'label' => esc_html__( 'Color', 'easy-elements' ),
1163 'type' => \Elementor\Controls_Manager::COLOR,
1164 'selectors' => [
1165 '{{WRAPPER}} .eel--read-more a:hover' => 'color: {{VALUE}};',
1166 '{{WRAPPER}} .eel--read-more a:hover svg, {{WRAPPER}} .eel--read-more a:hover svg path' => 'fill: {{VALUE}};',
1167 ],
1168 ]
1169 );
1170
1171 $this->add_control(
1172 'button_bg_color_hover',
1173 [
1174 'label' => esc_html__( 'Background Color', 'easy-elements' ),
1175 'type' => \Elementor\Controls_Manager::COLOR,
1176 'selectors' => [
1177 '{{WRAPPER}} .eel--read-more a:hover' => 'background-color: {{VALUE}};',
1178 ],
1179 ]
1180 );
1181
1182 $this->add_group_control(
1183 \Elementor\Group_Control_Border::get_type(),
1184 [
1185 'name' => 'button_border_hover',
1186 'selector' => '{{WRAPPER}} .eel--read-more a:hover',
1187 ]
1188 );
1189
1190 $this->end_controls_tab();
1191
1192 $this->end_controls_tabs();
1193
1194 $this->add_responsive_control(
1195 'icon__size',
1196 [
1197 'label' => esc_html__( 'Icon Size', 'easy-elements' ),
1198 'type' => \Elementor\Controls_Manager::SLIDER,
1199 'size_units' => [ 'px' ],
1200 'range' => [
1201 'px' => [
1202 'min' => -50,
1203 'max' => 100,
1204 ],
1205 ],
1206 'selectors' => [
1207 '{{WRAPPER}} .eel--read-more svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
1208 '{{WRAPPER}} .eel--read-more i' => 'font-size: {{SIZE}}{{UNIT}};',
1209 ],
1210 'condition' => [
1211 'show_read_more' => 'yes',
1212 ],
1213 ]
1214 );
1215
1216 $this->add_control(
1217 'icon_box_color',
1218 [
1219 'label' => esc_html__( 'Icon Color', 'easy-elements' ),
1220 'type' => \Elementor\Controls_Manager::COLOR,
1221 'selectors' => [
1222 '{{WRAPPER}} .eel-post-grid-wrap .eel--read-more a svg' => 'fill: {{VALUE}};',
1223 '{{WRAPPER}} .eel-post-grid-wrap .eel--read-more a svg path' => 'fill: {{VALUE}};',
1224 '{{WRAPPER}} .eel-post-grid-wrap .eel--read-more a i' => 'color: {{VALUE}};',
1225 '{{WRAPPER}} .eel-post-grid-wrap .eel--read-more a i' => 'color: {{VALUE}};',
1226 ],
1227 'condition' => [
1228 'show_read_more' => 'yes',
1229 ],
1230 ]
1231 );
1232
1233 $this->add_control(
1234 'icon_box_color_hover',
1235 [
1236 'label' => esc_html__( 'Icon Color (Hover)', 'easy-elements' ),
1237 'type' => \Elementor\Controls_Manager::COLOR,
1238 'selectors' => [
1239 '{{WRAPPER}} .eel-post-grid-wrap .eel--read-more a:hover svg' => 'fill: {{VALUE}};',
1240 '{{WRAPPER}} .eel-post-grid-wrap .eel--read-more a:hover svg path' => 'fill: {{VALUE}};',
1241 '{{WRAPPER}} .eel-post-grid-wrap .eel--read-more a:hover i' => 'color: {{VALUE}};',
1242 ],
1243 'condition' => [
1244 'show_read_more' => 'yes',
1245 ],
1246 ]
1247 );
1248
1249 $this->add_responsive_control(
1250 'icon_box_padding',
1251 [
1252 'label' => esc_html__( 'Icon Padding', 'easy-elements' ),
1253 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1254 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
1255 'selectors' => [
1256 '{{WRAPPER}} .eel--read-more-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1257 ],
1258 'condition' => [
1259 'show_read_more' => 'yes',
1260 ],
1261 ]
1262 );
1263
1264 $this->add_group_control(
1265 \Elementor\Group_Control_Background::get_type(),
1266 [
1267 'name' => 'icon_box_background',
1268 'label' => esc_html__( 'Icon Background', 'easy-elements' ),
1269 'types' => [ 'classic', 'gradient' ],
1270 'selector' => '{{WRAPPER}} .eel--read-more-icon',
1271 'condition' => [
1272 'show_read_more' => 'yes',
1273 ],
1274 ]
1275 );
1276
1277 $this->add_group_control(
1278 \Elementor\Group_Control_Border::get_type(),
1279 [
1280 'name' => 'icon_box_border',
1281 'selector' => '{{WRAPPER}} .eel--read-more-icon',
1282 'condition' => [
1283 'show_read_more' => 'yes',
1284 ],
1285 ]
1286 );
1287
1288 $this->add_responsive_control(
1289 'icon_box_border_radius',
1290 [
1291 'label' => esc_html__( 'Icon Border Radius', 'easy-elements' ),
1292 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1293 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
1294 'selectors' => [
1295 '{{WRAPPER}} .eel--read-more-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1296 ],
1297 'condition' => [
1298 'show_read_more' => 'yes',
1299 ],
1300 ]
1301 );
1302
1303 $this->add_group_control(
1304 \Elementor\Group_Control_Box_Shadow::get_type(),
1305 [
1306 'name' => 'icon_box_shadow',
1307 'selector' => '{{WRAPPER}} .eel--read-more-icon',
1308 'condition' => [
1309 'show_read_more' => 'yes',
1310 ],
1311 ]
1312 );
1313
1314 $this->add_responsive_control(
1315 'btn_icon_offset',
1316 [
1317 'label' => esc_html__( 'Icon Offset (Vertical)', 'easy-elements' ),
1318 'type' => \Elementor\Controls_Manager::SLIDER,
1319 'size_units' => [ 'px' ],
1320 'range' => [
1321 'px' => [
1322 'min' => -50,
1323 'max' => 100,
1324 ],
1325 ],
1326 'selectors' => [
1327 '{{WRAPPER}} .eel--read-more-icon.after, {{WRAPPER}} .eel--read-more svg' => 'top: {{SIZE}}{{UNIT}};',
1328 ],
1329 'condition' => [
1330 'show_read_more' => 'yes',
1331 ],
1332 ]
1333 );
1334
1335 $this->add_responsive_control(
1336 'btn_icon_offset_ho',
1337 [
1338 'label' => esc_html__( 'Icon Offset (Horizontal)', 'easy-elements' ),
1339 'type' => \Elementor\Controls_Manager::SLIDER,
1340 'size_units' => [ 'px' ],
1341 'range' => [
1342 'px' => [
1343 'min' => -50,
1344 'max' => 100,
1345 ],
1346 ],
1347 'selectors' => [
1348 '{{WRAPPER}} .eel--read-more-icon.after, {{WRAPPER}} .eel--read-more svg' => 'left: {{SIZE}}{{UNIT}};',
1349 ],
1350 'condition' => [
1351 'show_read_more' => 'yes',
1352 ],
1353 ]
1354 );
1355
1356 $this->end_controls_section();
1357
1358 $this->start_controls_section(
1359 '_section_button_icon',
1360 [
1361 'label' => esc_html__( 'Only Icon Button', 'easy-elements' ),
1362 'tab' => Controls_Manager::TAB_CONTENT,
1363 ]
1364 );
1365
1366 $this->add_control(
1367 'only_icon_show',
1368 [
1369 'label' => esc_html__( 'Show Icon', 'easy-elements' ),
1370 'type' => \Elementor\Controls_Manager::SWITCHER,
1371 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
1372 'label_off' => esc_html__( 'No', 'easy-elements' ),
1373 'return_value' => 'yes',
1374 'default' => '',
1375 ]
1376 );
1377
1378 $this->add_control(
1379 'only_icon',
1380 [
1381 'label' => esc_html__( 'Icon', 'easy-elements' ),
1382 'type' => \Elementor\Controls_Manager::ICONS,
1383 'default' => [
1384 'value' => '',
1385 'library' => 'fa-solid',
1386 ],
1387 ]
1388 );
1389
1390 $this->start_controls_tabs( 'button_style_tabs' );
1391
1392 $this->start_controls_tab(
1393 'icon_btn_style_normal',
1394 [
1395 'label' => __( 'Normal', 'easy-elements' ),
1396 ]
1397 );
1398
1399 $this->add_control(
1400 'icon_color',
1401 [
1402 'label' => __( 'Color', 'easy-elements' ),
1403 'type' => \Elementor\Controls_Manager::COLOR,
1404 'selectors' => [
1405 '{{WRAPPER}} .eel--button-icon svg, {{WRAPPER}} .eel--button-icon i' => 'color: {{VALUE}}; fill: {{VALUE}};',
1406 ],
1407 ]
1408 );
1409
1410 $this->add_group_control(
1411 \Elementor\Group_Control_Background::get_type(),
1412 [
1413 'name' => 'eel_iocn_background',
1414 'label' => __( 'Button Background', 'easy-elements' ),
1415 'types' => [ 'classic', 'gradient' ],
1416 'selector' => '{{WRAPPER}} .eel--button-icon',
1417 ]
1418 );
1419
1420 $this->add_group_control(
1421 \Elementor\Group_Control_Border::get_type(),
1422 [
1423 'name' => 'icon_btn_border',
1424 'label' => __( 'Button Border', 'easy-elements' ),
1425 'selector' => '{{WRAPPER}} .eel--button-icon',
1426 ]
1427 );
1428
1429 $this->add_control(
1430 'icon_border_radius',
1431 [
1432 'label' => __( 'Border Radius', 'easy-elements' ),
1433 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1434 'size_units' => [ 'px', '%' ],
1435 'selectors' => [
1436 '{{WRAPPER}} .eel--button-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1437 ],
1438 ]
1439 );
1440
1441 $this->end_controls_tab();
1442
1443 $this->start_controls_tab(
1444 'icon_btn_style_hover',
1445 [
1446 'label' => __( 'Hover', 'easy-elements' ),
1447 ]
1448 );
1449
1450 $this->add_control(
1451 'icon_color_hover',
1452 [
1453 'label' => __( 'Color', 'easy-elements' ),
1454 'type' => \Elementor\Controls_Manager::COLOR,
1455 'selectors' => [
1456 '{{WRAPPER}} .eel--button-icon:hover svg, {{WRAPPER}} .eel--button-icon:hover i' => 'color: {{VALUE}}; fill: {{VALUE}};',
1457 ],
1458 ]
1459 );
1460
1461 $this->add_group_control(
1462 \Elementor\Group_Control_Background::get_type(),
1463 [
1464 'name' => 'eel_iocn_background_hover',
1465 'label' => __( 'Button Background', 'easy-elements' ),
1466 'types' => [ 'classic', 'gradient' ],
1467 'selector' => '{{WRAPPER}} .eel--button-icon:hover',
1468 ]
1469 );
1470
1471 $this->end_controls_tab();
1472 $this->end_controls_tabs();
1473 $this->end_controls_section();
1474
1475 $this->start_controls_section(
1476 'section_transparent_settings',
1477 [
1478 'label' => __( 'Transparent Layout', 'easy-elements' ),
1479 'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
1480 ]
1481 );
1482
1483 $this->add_control(
1484 'style_transparent',
1485 [
1486 'label' => esc_html__( 'Blog Transparent', 'easy-elements' ),
1487 'type' => Controls_Manager::SWITCHER,
1488 'label_on' => esc_html__( 'Show', 'easy-elements' ),
1489 'label_off' => esc_html__( 'Hide', 'easy-elements' ),
1490 'return_value' => 'yes',
1491 'default' => '',
1492 ]
1493 );
1494
1495 $this->add_control(
1496 'transparent_overlay_heading',[
1497 'label' => esc_html__( 'Overlay Background', 'easy-elements' ),
1498 'type' => \Elementor\Controls_Manager::HEADING,
1499 'condition' => [
1500 'style_transparent' => 'yes',
1501 ],
1502 ]
1503 );
1504
1505 $this->add_group_control(
1506 \Elementor\Group_Control_Background::get_type(),
1507 [
1508 'name' => 'eel_transparent_background',
1509 'label' => __( 'Overlay Background', 'easy-elements' ),
1510 'types' => [ 'classic', 'gradient' ],
1511 'selector' => '{{WRAPPER}} .eel--transparent-post .eel--overlay-all',
1512 'condition' => [
1513 'style_transparent' => 'yes',
1514 ],
1515 ]
1516 );
1517
1518 $this->add_responsive_control(
1519 'eel_overlay_height',
1520 [
1521 'label' => __( 'Overlay Height', 'easy-elements' ),
1522 'type' => \Elementor\Controls_Manager::SLIDER,
1523 'size_units' => [ 'px', '%', 'vh' ],
1524 'range' => [
1525 'px' => [
1526 'min' => 0,
1527 'max' => 1000,
1528 'step' => 1,
1529 ],
1530 '%' => [
1531 'min' => 0,
1532 'max' => 100,
1533 ],
1534 ],
1535 'selectors' => [
1536 '{{WRAPPER}} .eel--transparent-post .eel--overlay-all' => 'height: {{SIZE}}{{UNIT}};',
1537 ],
1538 'condition' => [
1539 'style_transparent' => 'yes',
1540 ],
1541 ]
1542 );
1543
1544 $this->end_controls_section();
1545
1546
1547 $this->start_controls_section(
1548 'section_pagination_settings',
1549 [
1550 'label' => __( 'Pagination', 'easy-elements' ),
1551 'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
1552 ]
1553 );
1554
1555 $this->add_control(
1556 'show_pagination',
1557 [
1558 'label' => esc_html__( 'Show Pagination', 'easy-elements' ),
1559 'type' => Controls_Manager::SWITCHER,
1560 'label_on' => esc_html__( 'Show', 'easy-elements' ),
1561 'label_off' => esc_html__( 'Hide', 'easy-elements' ),
1562 'return_value' => 'yes',
1563 'default' => 'yes',
1564 ]
1565 );
1566
1567 $this->add_responsive_control( 'pagination_top_spacing', [
1568 'label' => esc_html__( 'Top Spacing', 'easy-elements' ),
1569 'type' => Controls_Manager::SLIDER,
1570 'range' => [ 'px' => [ 'min' => 0, 'max' => 100 ] ],
1571 'selectors' => [ '{{WRAPPER}} .eel-blog-pagination' => 'margin-top: {{SIZE}}{{UNIT}};' ],
1572 'condition' => [ 'show_pagination' => 'yes' ],
1573 ]);
1574
1575 $this->add_responsive_control( 'pagination_gap', [
1576 'label' => esc_html__( 'Gap', 'easy-elements' ),
1577 'type' => Controls_Manager::SLIDER,
1578 'range' => [ 'px' => [ 'min' => 0, 'max' => 20 ] ],
1579 'selectors' => [ '{{WRAPPER}} .eel-blog-pagination ul' => 'gap: {{SIZE}}{{UNIT}};' ],
1580 'condition' => [ 'show_pagination' => 'yes' ],
1581 ]);
1582
1583 $this->start_controls_tabs( 'pagination__tabs' );
1584
1585 $this->start_controls_tab(
1586 'pagination__normal',
1587 [
1588 'label' => __( 'Normal', 'easy-elements' ),
1589 ]
1590 );
1591
1592 $this->add_control(
1593 'pagination_color',
1594 [
1595 'label' => esc_html__( 'Color', 'easy-elements' ),
1596 'type' => \Elementor\Controls_Manager::COLOR,
1597 'selectors' => [
1598 '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span' => 'color: {{VALUE}};',
1599 ],
1600 ]
1601 );
1602
1603 $this->add_group_control(
1604 \Elementor\Group_Control_Background::get_type(),
1605 [
1606 'name' => 'pagination_background',
1607 'types' => [ 'classic', 'gradient' ],
1608 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span',
1609 ]
1610 );
1611
1612 $this->add_group_control(
1613 \Elementor\Group_Control_Typography::get_type(),
1614 [
1615 'name' => 'pagination_typography',
1616 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span',
1617 ]
1618 );
1619
1620 $this->add_group_control(
1621 \Elementor\Group_Control_Border::get_type(),
1622 [
1623 'name' => 'pagination_border',
1624 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li a',
1625 ]
1626 );
1627
1628 $this->add_responsive_control(
1629 'pagination_border_radius',
1630 [
1631 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
1632 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1633 'size_units' => [ 'px', '%' ],
1634 'selectors' => [
1635 '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1636 ],
1637 ]
1638 );
1639
1640 $this->add_responsive_control(
1641 'pagination_width',
1642 [
1643 'label' => esc_html__( 'Width', 'easy-elements' ),
1644 'type' => \Elementor\Controls_Manager::SLIDER,
1645 'size_units' => [ 'px' ],
1646 'range' => [
1647 'px' => [
1648 'min' => 40,
1649 'max' => 100,
1650 ],
1651 ],
1652 'selectors' => [
1653 '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
1654 ],
1655 'condition' => [
1656 'show_pagination' => 'yes',
1657 ],
1658 ]
1659 );
1660
1661 $this->add_responsive_control( 'pagination_padding', [
1662 'label' => esc_html__( 'Padding', 'easy-elements' ),
1663 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1664 'size_units' => [ 'px', 'em' ],
1665 'selectors' => [
1666 '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1667 ],
1668 ]);
1669
1670 $this->add_group_control(
1671 \Elementor\Group_Control_Box_Shadow::get_type(),
1672 [
1673 'name' => 'pagination_box_shadow',
1674 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span',
1675 ]
1676 );
1677
1678 $this->add_control(
1679 'pagination_alignment',
1680 [
1681 'label' => __( 'Alignment', 'easy-elements' ),
1682 'type' => \Elementor\Controls_Manager::CHOOSE,
1683 'options' => [
1684 'left' => [
1685 'title' => __( 'Left', 'easy-elements' ),
1686 'icon' => 'eicon-text-align-left',
1687 ],
1688 'center' => [
1689 'title' => __( 'Center', 'easy-elements' ),
1690 'icon' => 'eicon-text-align-center',
1691 ],
1692 'right' => [
1693 'title' => __( 'Right', 'easy-elements' ),
1694 'icon' => 'eicon-text-align-right',
1695 ],
1696 ],
1697 'default' => 'center',
1698 'toggle' => true,
1699 'selectors' => [
1700 '{{WRAPPER}} .eel-blog-pagination' => 'text-align: {{VALUE}};',
1701 ],
1702 ]
1703 );
1704
1705 $this->end_controls_tab();
1706
1707 $this->start_controls_tab(
1708 'pagination__hover',
1709 [
1710 'label' => __( 'Hover', 'easy-elements' ),
1711 ]
1712 );
1713
1714 $this->add_control(
1715 'pagination_color_current',
1716 [
1717 'label' => esc_html__( 'Color', 'easy-elements' ),
1718 'type' => \Elementor\Controls_Manager::COLOR,
1719 'selectors' => [
1720 '{{WRAPPER}} .eel-blog-pagination ul li a:hover, {{WRAPPER}} .eel-blog-pagination ul li span.current' => 'color: {{VALUE}};',
1721 ],
1722 ]
1723 );
1724
1725 $this->add_group_control(
1726 \Elementor\Group_Control_Background::get_type(),
1727 [
1728 'name' => 'pagination_background_current',
1729 'types' => [ 'classic', 'gradient' ],
1730 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li span.current, {{WRAPPER}} .eel-blog-pagination ul li a:hover',
1731 ]
1732 );
1733
1734 $this->add_group_control(
1735 \Elementor\Group_Control_Border::get_type(),
1736 [
1737 'name' => 'pagination_border_hover',
1738 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li span.current, {{WRAPPER}} .eel-blog-pagination ul li a:hover',
1739 ]
1740 );
1741
1742 $this->add_group_control(
1743 \Elementor\Group_Control_Box_Shadow::get_type(),
1744 [
1745 'name' => 'pagination_hover_box_shadow',
1746 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li span.current, {{WRAPPER}} .eel-blog-pagination ul li a:hover',
1747 ]
1748 );
1749
1750 $this->end_controls_tab();
1751 $this->end_controls_tabs();
1752 $this->end_controls_section();
1753
1754
1755 $this->start_controls_section(
1756 'section_item_style',
1757 [
1758 'label' => __( 'Items', 'easy-elements' ),
1759 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
1760 ]
1761 );
1762
1763 $this->add_group_control(
1764 \Elementor\Group_Control_Background::get_type(),
1765 [
1766 'name' => 'item_background',
1767 'label' => __( 'Item Background', 'easy-elements' ),
1768 'types' => [ 'classic', 'gradient' ],
1769 'selector' => '{{WRAPPER}} .eel-post-grid-wrap .grid-item-inner',
1770 ]
1771 );
1772
1773 $this->add_responsive_control(
1774 'item_padding',
1775 [
1776 'label' => __( 'Padding', 'easy-elements' ),
1777 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1778 'size_units' => [ 'px', 'em', '%' ],
1779 'selectors' => [
1780 '{{WRAPPER}} .eel-post-grid-wrap .grid-item-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1781 ],
1782 ]
1783 );
1784
1785 $this->add_responsive_control(
1786 'item_border_radius',
1787 [
1788 'label' => __( 'Border Radius', 'easy-elements' ),
1789 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1790 'size_units' => [ 'px', '%' ],
1791 'selectors' => [
1792 '{{WRAPPER}} .eel-post-grid-wrap .grid-item-inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1793 ],
1794 ]
1795 );
1796
1797 $this->add_group_control(
1798 \Elementor\Group_Control_Border::get_type(),
1799 [
1800 'name' => 'item_border',
1801 'selector' => '{{WRAPPER}} .eel-post-grid-wrap .grid-item-inner',
1802 ]
1803 );
1804
1805 $this->add_group_control(
1806 \Elementor\Group_Control_Box_Shadow::get_type(),
1807 [
1808 'name' => 'item_box_shadow',
1809 'selector' => '{{WRAPPER}} .eel-post-grid-wrap .grid-item-inner',
1810 ]
1811 );
1812
1813
1814 $this->end_controls_section();
1815
1816 $this->start_controls_section(
1817 'section_conten_style',
1818 [
1819 'label' => __( 'Content Part', 'easy-elements' ),
1820 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
1821 ]
1822 );
1823
1824 $this->add_group_control(
1825 \Elementor\Group_Control_Background::get_type(),
1826 [
1827 'name' => 'content_background',
1828 'label' => __( 'Item Background', 'easy-elements' ),
1829 'types' => [ 'classic', 'gradient' ],
1830 'selector' => '{{WRAPPER}} .ee--blog-content-wrap',
1831 ]
1832 );
1833
1834 $this->add_responsive_control(
1835 'content_padding',
1836 [
1837 'label' => __( 'Padding', 'easy-elements' ),
1838 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1839 'size_units' => [ 'px', 'em', '%' ],
1840 'selectors' => [
1841 '{{WRAPPER}} .ee--blog-content-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1842 ],
1843 ]
1844 );
1845
1846 $this->add_responsive_control(
1847 'content_border_radius',
1848 [
1849 'label' => __( 'Border Radius', 'easy-elements' ),
1850 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1851 'size_units' => [ 'px', '%' ],
1852 'selectors' => [
1853 '{{WRAPPER}} .ee--blog-content-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1854 ],
1855 ]
1856 );
1857
1858 $this->add_responsive_control(
1859 'content_margin',
1860 [
1861 'label' => __( 'Margin', 'easy-elements' ),
1862 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1863 'size_units' => [ 'px', '%', 'em' ],
1864 'selectors' => [
1865 '{{WRAPPER}} .ee--blog-content-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1866 ],
1867 ]
1868 );
1869
1870 $this->end_controls_section();
1871
1872 $this->start_controls_section(
1873 'section_title_style',
1874 [
1875 'label' => __( 'Title', 'easy-elements' ),
1876 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
1877 ]
1878 );
1879
1880 // Typography
1881 $this->add_group_control(
1882 \Elementor\Group_Control_Typography::get_type(),
1883 [
1884 'name' => 'title_typography',
1885 'selector' => '{{WRAPPER}} .ee--blog-title',
1886 ]
1887 );
1888
1889 // Tabs for Normal and Hover state
1890 $this->start_controls_tabs( 'title_color_tabs' );
1891
1892 // Normal
1893 $this->start_controls_tab(
1894 'title_color_normal',
1895 [
1896 'label' => esc_html__( 'Normal', 'easy-elements' ),
1897 ]
1898 );
1899 $this->add_control(
1900 'title_color',
1901 [
1902 'label' => esc_html__( 'Color', 'easy-elements' ),
1903 'type' => \Elementor\Controls_Manager::COLOR,
1904 'selectors' => [
1905 '{{WRAPPER}} .ee--blog-title' => 'color: {{VALUE}};',
1906 ],
1907 ]
1908 );
1909
1910 $this->add_group_control(
1911 \Elementor\Group_Control_Border::get_type(),
1912 [
1913 'name' => 'title_border',
1914 'selector' => '{{WRAPPER}} .ee--blog-title',
1915 ]
1916 );
1917
1918 $this->add_responsive_control(
1919 'title_margin',
1920 [
1921 'label' => __( 'Margin', 'easy-elements' ),
1922 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1923 'size_units' => [ 'px', 'em', '%' ],
1924 'selectors' => [
1925 '{{WRAPPER}} .ee--blog-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1926 ],
1927 ]
1928 );
1929
1930 $this->add_responsive_control(
1931 'title_padding',
1932 [
1933 'label' => __( 'Padding', 'easy-elements' ),
1934 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1935 'size_units' => [ 'px', 'em', '%' ],
1936 'selectors' => [
1937 '{{WRAPPER}} .ee--blog-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1938 ],
1939 ]
1940 );
1941
1942 $this->end_controls_tab();
1943
1944 // Hover
1945 $this->start_controls_tab(
1946 'title_color_hover',
1947 [
1948 'label' => esc_html__( 'Hover', 'easy-elements' ),
1949 ]
1950 );
1951 $this->add_control(
1952 'title_hover_color',
1953 [
1954 'label' => esc_html__( 'Color', 'easy-elements' ),
1955 'type' => \Elementor\Controls_Manager::COLOR,
1956 'selectors' => [
1957 '{{WRAPPER}} .ee--blog-title:hover a' => 'color: {{VALUE}};',
1958 ],
1959 ]
1960 );
1961 $this->end_controls_tab();
1962
1963 $this->end_controls_tabs();
1964
1965 $this->end_controls_section();
1966
1967
1968 $this->start_controls_section(
1969 'section_excerpt_style',
1970 [
1971 'label' => __( 'Excerpt', 'easy-elements' ),
1972 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
1973 ]
1974 );
1975
1976 $this->add_control(
1977 'excerpt_color',
1978 [
1979 'label' => esc_html__( 'Color', 'easy-elements' ),
1980 'type' => \Elementor\Controls_Manager::COLOR,
1981 'selectors' => [
1982 '{{WRAPPER}} .eel--blog-excerpt' => 'color: {{VALUE}};',
1983 ],
1984 ]
1985 );
1986
1987 $this->add_group_control(
1988 \Elementor\Group_Control_Typography::get_type(),
1989 [
1990 'name' => 'excerpt_typography',
1991 'selector' => '{{WRAPPER}} .eel--blog-excerpt',
1992 ]
1993 );
1994
1995 $this->add_responsive_control(
1996 'excerpt_margin',
1997 [
1998 'label' => __( 'Margin', 'easy-elements' ),
1999 'type' => \Elementor\Controls_Manager::DIMENSIONS,
2000 'size_units' => [ 'px', 'em', '%' ],
2001 'selectors' => [
2002 '{{WRAPPER}} .eel--blog-excerpt' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2003 ],
2004 ]
2005 );
2006
2007
2008 $this->end_controls_section();
2009
2010
2011 $this->start_controls_section(
2012 'section_meta_style',
2013 [
2014 'label' => __( 'Meta', 'easy-elements' ),
2015 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
2016 ]
2017 );
2018
2019 $this->add_control(
2020 'meta_text_color',
2021 [
2022 'label' => __( 'Color', 'easy-elements' ),
2023 'type' => \Elementor\Controls_Manager::COLOR,
2024 'selectors' => [
2025 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li, {{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li *, {{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li i, {{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li svg' => 'color: {{VALUE}}; fill: {{VALUE}};',
2026 ],
2027 ]
2028 );
2029
2030 $this->add_control(
2031 'meta_icon_color',
2032 [
2033 'label' => __( 'Icon Color', 'easy-elements' ),
2034 'type' => \Elementor\Controls_Manager::COLOR,
2035 'selectors' => [
2036 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li i' => 'color: {{VALUE}};',
2037 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li svg' => 'color: {{VALUE}}; fill: {{VALUE}};',
2038 ],
2039 ]
2040 );
2041
2042 $this->add_responsive_control(
2043 'meta_icon_size',
2044 [
2045 'label' => __( 'Icon Size', 'easy-elements' ),
2046 'type' => \Elementor\Controls_Manager::SLIDER,
2047 'range' => [ 'px' => [ 'min' => 8, 'max' => 30 ] ],
2048 'selectors' => [
2049 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li i' => 'font-size: {{SIZE}}{{UNIT}};',
2050 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
2051 ],
2052 ]
2053 );
2054
2055 $this->add_responsive_control(
2056 'meta_icon_spacing',
2057 [
2058 'label' => __( 'Icon Spacing', 'easy-elements' ),
2059 'type' => \Elementor\Controls_Manager::SLIDER,
2060 'range' => [ 'px' => [ 'min' => 0, 'max' => 20 ] ],
2061 'selectors' => [
2062 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li i, {{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li svg' => 'margin-right: {{SIZE}}{{UNIT}};',
2063 ],
2064 'separator' => 'after',
2065 ]
2066 );
2067
2068 $this->add_group_control(
2069 \Elementor\Group_Control_Background::get_type(),
2070 [
2071 'name' => 'eel_meta_background',
2072 'label' => __( 'Button Background', 'easy-elements' ),
2073 'types' => [ 'classic', 'gradient' ],
2074 'selector' => '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li',
2075 ]
2076 );
2077
2078 $this->add_group_control(
2079 \Elementor\Group_Control_Typography::get_type(),
2080 [
2081 'name' => 'meta_typography',
2082 'label' => __( 'Typography', 'easy-elements' ),
2083 'selector' => '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li',
2084 ]
2085 );
2086
2087 $this->add_responsive_control(
2088 'meta_padding',
2089 [
2090 'label' => esc_html__( 'Padding', 'easy-elements' ),
2091 'type' => \Elementor\Controls_Manager::DIMENSIONS,
2092 'size_units' => [ 'px', '%' ],
2093 'selectors' => [
2094 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2095 ],
2096 ]
2097 );
2098
2099 $this->add_responsive_control(
2100 'meta_spancing',
2101 [
2102 'label' => esc_html__( 'Meta Spacing', 'easy-elements' ),
2103 'type' => \Elementor\Controls_Manager::SLIDER,
2104 'size_units' => [ 'px' ],
2105 'range' => [
2106 'px' => [
2107 'min' => 0,
2108 'max' => 100,
2109 ],
2110 ],
2111 'selectors' => [
2112 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li+li' => 'margin-left: {{SIZE}}{{UNIT}}; padding-left: {{SIZE}}{{UNIT}};',
2113 ],
2114 ]
2115 );
2116
2117 $this->add_responsive_control(
2118 'meta_border_radius',
2119 [
2120 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
2121 'type' => \Elementor\Controls_Manager::DIMENSIONS,
2122 'size_units' => [ 'px', '%' ],
2123 'selectors' => [
2124 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2125 ],
2126 ]
2127 );
2128
2129 $this->end_controls_section();
2130
2131 $this->start_controls_section(
2132 'date_badge_style',
2133 [
2134 'label' => __( 'Date Badge', 'easy-elements' ),
2135 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
2136 'condition' => [
2137 'show_date_on_top' => 'yes',
2138 ],
2139 ]
2140 );
2141
2142 $this->add_control(
2143 'date_text_color_badge',
2144 [
2145 'label' => __( 'Color', 'easy-elements' ),
2146 'type' => \Elementor\Controls_Manager::COLOR,
2147 'selectors' => [
2148 '{{WRAPPER}} .eel--blog-date-top, {{WRAPPER}} .eel--blog-date-top h4' => 'color: {{VALUE}};',
2149 ],
2150 ]
2151 );
2152
2153 $this->add_group_control(
2154 \Elementor\Group_Control_Background::get_type(),
2155 [
2156 'name' => 'eel_date_background_badge',
2157 'label' => __( 'Button Background', 'easy-elements' ),
2158 'types' => [ 'classic', 'gradient' ],
2159 'selector' => '{{WRAPPER}} .eel--blog-date-top',
2160 ]
2161 );
2162
2163 $this->add_group_control(
2164 \Elementor\Group_Control_Typography::get_type(),
2165 [
2166 'name' => 'date_typography_badge_top',
2167 'label' => __( 'Typography', 'easy-elements' ),
2168 'selector' => '{{WRAPPER}} .eel--blog-date-top h4',
2169 ]
2170 );
2171
2172 $this->add_group_control(
2173 \Elementor\Group_Control_Typography::get_type(),
2174 [
2175 'name' => 'date_typography_badge_btm',
2176 'label' => __( 'Typography', 'easy-elements' ),
2177 'selector' => '{{WRAPPER}} .eel--blog-date-top',
2178 ]
2179 );
2180
2181 $this->add_responsive_control(
2182 'date_border_radius_badge',
2183 [
2184 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
2185 'type' => \Elementor\Controls_Manager::DIMENSIONS,
2186 'size_units' => [ 'px', '%' ],
2187 'selectors' => [
2188 '{{WRAPPER}} .eel--blog-date-top' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2189 ],
2190 ]
2191 );
2192
2193 $this->add_responsive_control(
2194 'date_padding_radius_badge',
2195 [
2196 'label' => esc_html__( 'Padding', 'easy-elements' ),
2197 'type' => \Elementor\Controls_Manager::DIMENSIONS,
2198 'size_units' => [ 'px', '%' ],
2199 'selectors' => [
2200 '{{WRAPPER}} .eel--blog-date-top' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2201 ],
2202 ]
2203 );
2204
2205 $this->add_responsive_control(
2206 'show_date_on_top_position_horizontal',
2207 [
2208 'label' => esc_html__('Offset Horizontal', 'easy-elements'),
2209 'type' => \Elementor\Controls_Manager::SLIDER,
2210 'size_units' => [ 'px', '%' ],
2211 'range' => [
2212 'px' => [ 'min' => -400, 'max' => 400, 'step' => 1 ],
2213 '%' => [ 'min' => -100, 'max' => 100 ],
2214 ],
2215 'selectors' => [
2216 '{{WRAPPER}} .eel--blog-date-top' => 'right: {{SIZE}}{{UNIT}};',
2217 ],
2218 ]
2219 );
2220
2221 $this->add_responsive_control(
2222 'show_date_on_top_position_vartical',
2223 [
2224 'label' => esc_html__('Offset Vertical', 'easy-elements'),
2225 'type' => \Elementor\Controls_Manager::SLIDER,
2226 'size_units' => [ 'px', '%' ],
2227 'range' => [
2228 'px' => [ 'min' => -400, 'max' => 400, 'step' => 1 ],
2229 '%' => [ 'min' => -100, 'max' => 100 ],
2230 ],
2231 'selectors' => [
2232 '{{WRAPPER}} .eel--blog-date-top' => 'top: {{SIZE}}{{UNIT}};',
2233 ],
2234 ]
2235 );
2236
2237 $this->add_control(
2238 'eel_enable_blur_switcher',
2239 [
2240 'label' => __( 'Enable Blur', 'easy-elements' ),
2241 'type' => \Elementor\Controls_Manager::SWITCHER,
2242 'label_on' => __( 'Yes', 'easy-elements' ),
2243 'label_off' => __( 'No', 'easy-elements' ),
2244 'return_value' => 'yes',
2245 'default' => 'no',
2246 ]
2247 );
2248
2249 $this->add_control(
2250 'eel_blur_badge',
2251 [
2252 'label' => __( 'Blur', 'easy-elements' ),
2253 'type' => \Elementor\Controls_Manager::SLIDER,
2254 'size_units' => [ 'px', '%' ],
2255 'range' => [
2256 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1 ],
2257 '%' => [ 'min' => 0, 'max' => 100 ],
2258 ],
2259 'condition' => [
2260 'eel_enable_blur_switcher' => 'yes',
2261 ],
2262 'selectors' => [
2263 '{{WRAPPER}} .eel--blog-date-top' => 'backdrop-filter: blur({{SIZE}}{{UNIT}});',
2264 ],
2265 ]
2266 );
2267
2268 $this->end_controls_section();
2269
2270 // Category Badge Style
2271 $this->start_controls_section(
2272 'category_badge_style',
2273 [
2274 'label' => __( 'Category Badge', 'easy-elements' ),
2275 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
2276 'condition' => [
2277 'show_category_badge' => 'yes',
2278 ],
2279 ]
2280 );
2281
2282 $this->add_control(
2283 'category_badge_color',
2284 [
2285 'label' => __( 'Color', 'easy-elements' ),
2286 'type' => \Elementor\Controls_Manager::COLOR,
2287 'selectors' => [
2288 '{{WRAPPER}} .eel--blog-category-badge a' => 'color: {{VALUE}};',
2289 ],
2290 ]
2291 );
2292
2293 $this->add_group_control(
2294 \Elementor\Group_Control_Background::get_type(),
2295 [
2296 'name' => 'category_badge_background',
2297 'label' => __( 'Background', 'easy-elements' ),
2298 'types' => [ 'classic', 'gradient' ],
2299 'selector' => '{{WRAPPER}} .eel--blog-category-badge',
2300 ]
2301 );
2302
2303 $this->add_group_control(
2304 \Elementor\Group_Control_Typography::get_type(),
2305 [
2306 'name' => 'category_badge_typography',
2307 'label' => __( 'Typography', 'easy-elements' ),
2308 'selector' => '{{WRAPPER}} .eel--blog-category-badge a',
2309 ]
2310 );
2311
2312 $this->add_responsive_control(
2313 'category_badge_border_radius',
2314 [
2315 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
2316 'type' => \Elementor\Controls_Manager::DIMENSIONS,
2317 'size_units' => [ 'px', '%' ],
2318 'selectors' => [
2319 '{{WRAPPER}} .eel--blog-category-badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2320 ],
2321 ]
2322 );
2323
2324 $this->add_responsive_control(
2325 'category_badge_padding',
2326 [
2327 'label' => esc_html__( 'Padding', 'easy-elements' ),
2328 'type' => \Elementor\Controls_Manager::DIMENSIONS,
2329 'size_units' => [ 'px', '%' ],
2330 'selectors' => [
2331 '{{WRAPPER}} .eel--blog-category-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2332 ],
2333 ]
2334 );
2335
2336 $this->add_responsive_control(
2337 'category_badge_position_horizontal',
2338 [
2339 'label' => esc_html__('Offset Horizontal', 'easy-elements'),
2340 'type' => \Elementor\Controls_Manager::SLIDER,
2341 'size_units' => [ 'px', '%' ],
2342 'range' => [
2343 'px' => [ 'min' => -400, 'max' => 400, 'step' => 1 ],
2344 '%' => [ 'min' => -100, 'max' => 100 ],
2345 ],
2346 'selectors' => [
2347 '{{WRAPPER}} .eel--blog-category-badge' => 'left: {{SIZE}}{{UNIT}};',
2348 ],
2349 ]
2350 );
2351
2352 $this->add_responsive_control(
2353 'category_badge_position_vertical',
2354 [
2355 'label' => esc_html__('Offset Vertical', 'easy-elements'),
2356 'type' => \Elementor\Controls_Manager::SLIDER,
2357 'size_units' => [ 'px', '%' ],
2358 'range' => [
2359 'px' => [ 'min' => -400, 'max' => 400, 'step' => 1 ],
2360 '%' => [ 'min' => -100, 'max' => 100 ],
2361 ],
2362 'selectors' => [
2363 '{{WRAPPER}} .eel--blog-category-badge' => 'top: {{SIZE}}{{UNIT}};',
2364 ],
2365 ]
2366 );
2367
2368 $this->add_control(
2369 'category_badge_blur',
2370 [
2371 'label' => __( 'Backdrop Blur', 'easy-elements' ),
2372 'type' => \Elementor\Controls_Manager::SLIDER,
2373 'size_units' => [ 'px' ],
2374 'range' => [
2375 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1 ],
2376 ],
2377 'selectors' => [
2378 '{{WRAPPER}} .eel--blog-category-badge' => 'backdrop-filter: blur({{SIZE}}{{UNIT}}); -webkit-backdrop-filter: blur({{SIZE}}{{UNIT}});',
2379 ],
2380 ]
2381 );
2382
2383 $this->end_controls_section();
2384 }
2385
2386 protected function render_blog_meta( $settings ) {
2387 if ( empty( $settings['show_meta'] ) || ! is_array( $settings['show_meta'] ) ) {
2388 return;
2389 }
2390
2391 $show_meta = $settings['show_meta'];
2392
2393 usort( $show_meta, function( $a, $b ) use ( $settings ) {
2394 $order_a = ! empty( $settings['meta_order_' . $a] ) ? (int) $settings['meta_order_' . $a] : 99;
2395 $order_b = ! empty( $settings['meta_order_' . $b] ) ? (int) $settings['meta_order_' . $b] : 99;
2396 return $order_a - $order_b;
2397 });
2398
2399 $eel_separator = ! empty( $settings['eel_separator'] ) ? 'eel--separator--' . esc_attr( $settings['eel_separator'] ) : '';
2400 ?>
2401 <ul class="eel--blog-meta <?php echo esc_attr($eel_separator); ?>">
2402 <?php foreach ( $show_meta as $meta ) :
2403 switch ( $meta ) :
2404 case 'date': ?>
2405 <li class="eel--blog-date">
2406 <?php
2407 if ( ! empty($settings['show_date_icon']) && $settings['show_date_icon'] === 'yes' ) {
2408 if ( empty( $settings['date_icon']['value'] ) ) {
2409 echo '<i class="unicon-calendar"></i>';
2410 } else {
2411 \Elementor\Icons_Manager::render_icon( $settings['date_icon'], [ 'aria-hidden' => 'true' ] );
2412 }
2413 }
2414 echo esc_html( get_the_date() );
2415 ?>
2416 </li>
2417 <?php break;
2418
2419 case 'author':
2420 $author_icon_type = $settings['author_icon_type'] ?? 'icon';
2421 ?>
2422 <li class="eel--blog-author <?php echo $author_icon_type === 'avatar' ? 'eel--has-avatar' : ''; ?>">
2423 <?php
2424 $author_id = get_the_author_meta( 'ID' );
2425 $author_name = get_the_author();
2426 $author_url = get_author_posts_url( $author_id );
2427
2428 if ( $author_icon_type === 'icon' ) {
2429 if ( empty( $settings['author_icon']['value'] ) ) {
2430 echo '<i class="unicon-user"></i>';
2431 } else {
2432 \Elementor\Icons_Manager::render_icon( $settings['author_icon'], [ 'aria-hidden' => 'true' ] );
2433 }
2434 } elseif ( $author_icon_type === 'avatar' ) {
2435 $avatar_size = ! empty( $settings['author_avatar_size']['size'] ) ? (int) $settings['author_avatar_size']['size'] : 22;
2436 echo '<img class="eel--author-avatar" src="' . esc_url( get_avatar_url( $author_id, [ 'size' => $avatar_size * 2 ] ) ) . '" alt="' . esc_attr( $author_name ) . '">';
2437 }
2438
2439 if ( ! empty($settings['show_by_label']) && $settings['show_by_label'] === 'yes' ) {
2440 echo '<em class="eel--meta-by">' . esc_html__( 'By', 'easy-elements' ) . '</em> ';
2441 }
2442
2443 if ( ! empty($settings['author_link_enable']) && $settings['author_link_enable'] === 'yes' ) {
2444 echo '<a class="eel--meta-author" href="' . esc_url( $author_url ) . '">' . esc_html( $author_name ) . '</a>';
2445 } else {
2446 echo '<span class="eel--meta-author">' . esc_html( $author_name ) . '</span>';
2447 }
2448 ?>
2449 </li>
2450 <?php break;
2451
2452 case 'category': ?>
2453 <li class="eel--blog-cat">
2454 <?php
2455 if ( ! empty($settings['show_category_icon']) && $settings['show_category_icon'] === 'yes' ) {
2456 if ( empty( $settings['category_icon']['value'] ) ) {
2457 echo '<i class="unicon-folder"></i>';
2458 } else {
2459 \Elementor\Icons_Manager::render_icon( $settings['category_icon'], [ 'aria-hidden' => 'true' ] );
2460 }
2461 }
2462 the_category( ', ' );
2463 ?>
2464 </li>
2465 <?php break;
2466
2467 case 'comments': ?>
2468 <li class="eel--blog-comments">
2469 <?php
2470 if ( ! empty($settings['show_comments_icon']) && $settings['show_comments_icon'] === 'yes' ) {
2471 if ( empty( $settings['comments_icon']['value'] ) ) {
2472 echo '<i class="unicon-forum"></i>';
2473 } else {
2474 \Elementor\Icons_Manager::render_icon( $settings['comments_icon'], [ 'aria-hidden' => 'true' ] );
2475 }
2476 }
2477 $comments_number = get_comments_number();
2478 echo '<a href="' . esc_url( get_comments_link() ) . '">' . esc_html( $comments_number ) . ' ' . esc_html( _n( 'Comment', 'Comments', $comments_number, 'easy-elements' ) ) . '</a>';
2479 ?>
2480 </li>
2481 <?php break;
2482
2483 case 'read_time': ?>
2484 <li class="eel--blog-read-time">
2485 <?php
2486 if ( ! empty($settings['show_read_time_icon']) && $settings['show_read_time_icon'] === 'yes' ) {
2487 if ( empty( $settings['read_time_icon']['value'] ) ) {
2488 echo '<i class="unicon-time"></i>';
2489 } else {
2490 \Elementor\Icons_Manager::render_icon( $settings['read_time_icon'], [ 'aria-hidden' => 'true' ] );
2491 }
2492 }
2493 $word_count = str_word_count( wp_strip_all_tags( get_the_content() ) );
2494 $reading_time = ceil( $word_count / 80 );
2495 echo esc_html( $reading_time ) . ' ' . esc_html__( 'min read', 'easy-elements' );
2496 ?>
2497 </li>
2498 <?php break;
2499 endswitch;
2500 endforeach; ?>
2501 </ul>
2502 <?php
2503 }
2504
2505 protected function render() {
2506 $settings = $this->get_settings_for_display();
2507 $post_type = $settings['post_type'] ?? 'post';
2508 $title_tag = $settings['title_tag'];
2509 $posts_per_page = isset($settings['posts_per_page']) ? (int) $settings['posts_per_page'] : 6;
2510
2511 $orderby = $settings['orderby'];
2512 $order = $settings['order'];
2513 $offset = isset($settings['offset']) ? (int) $settings['offset'] : 0;
2514
2515 $exclude_categories = $settings['exclude_categories'] ?? [];
2516 $thumbnail_size = $settings['thumbnail_size'];
2517 $thumb_anim = ($settings['thumb_animation'] ?? 'yes') === 'yes' ? 'eel--animate' : '';
2518 $anim_style = ($settings['eel_animation_style'] ?? 'left_right') === 'left_right' ? 'left_right' : 'top_bottom';
2519 $title_trim = $settings['title_trim'] ?? '';
2520 $date_options = ($settings['show_date_on_top'] === 'yes') ? 'd-block' : '';
2521 $excerpt_trim = $settings['excerpt_trim'];
2522
2523 $is_editor = \Elementor\Plugin::$instance->editor->is_edit_mode();
2524
2525 $widget_id = $this->get_id();
2526 $paged_key = 'paged_' . $widget_id;
2527
2528 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
2529 $current_paged = isset( $_GET[$paged_key] ) ? absint( $_GET[$paged_key] ) : ( isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1 );
2530
2531
2532 $paged = $is_editor ? 1 : max( 1, $current_paged );
2533
2534 $args = [
2535 'post_type' => $post_type,
2536 'posts_per_page' => ($posts_per_page <= 0) ? 6 : $posts_per_page,
2537 'paged' => $paged,
2538 'orderby' => $orderby,
2539 'order' => $order,
2540 'post_status' => 'publish',
2541 ];
2542
2543 if ( $offset > 0 ) {
2544 $args['offset'] = ( $paged - 1 ) * $posts_per_page + $offset;
2545 }
2546
2547 if ( apply_filters( 'easyel/pro_enabled', false ) ) {
2548 $args = apply_filters( 'easyel/apply_user_source_query', $args, $settings );
2549 }
2550
2551 if ( $settings['source_type'] === 'category' && ! empty( $settings['categories'] ) ) {
2552 $args['category__in'] = array_map( 'intval', (array) $settings['categories'] );
2553 } elseif ( $settings['source_type'] === 'post' && ! empty( $settings['post__in'] ) ) {
2554 $args['post__in'] = $settings['post__in'];
2555 $args['orderby'] = 'post__in';
2556 }
2557
2558 if ( ! empty( $exclude_categories ) ) {
2559 $args['category__not_in'] = array_map( 'intval', (array) $exclude_categories );
2560 }
2561
2562
2563 if ( ! $is_editor && ( is_category() || is_tag() || is_tax() ) ) {
2564 global $wp_query;
2565 $query = $wp_query;
2566 } else {
2567 $query = new \WP_Query( $args );
2568 }
2569
2570 if ( ! empty( $settings['exclude_posts'] ) && $query->have_posts() ) {
2571 $exclude_ids = (array) $settings['exclude_posts'];
2572 $query->posts = array_filter( $query->posts, function( $post ) use ( $exclude_ids ) {
2573 return ! in_array( $post->ID, $exclude_ids, true );
2574 });
2575 $query->post_count = count( $query->posts );
2576 }
2577
2578 if ( $offset > 0 && $posts_per_page > 0 ) {
2579 $query->found_posts = max( 0, $query->found_posts - $offset );
2580 $query->max_num_pages = ceil( $query->found_posts / $posts_per_page );
2581 }
2582
2583 if ( ! $query->have_posts() ) {
2584 echo '<p>' . esc_html__( 'No posts found.', 'easy-elements' ) . '</p>';
2585 return;
2586 }
2587
2588 if ( $query->have_posts() ) :
2589 echo '<div class="eel-post-grid-wrap">';
2590 while ( $query->have_posts() ) : $query->the_post();
2591 $trimmed_title = wp_trim_words( get_the_title(), $title_trim ?: 100, '...' );
2592 $trimmed_excerpt = wp_trim_words( get_the_excerpt(), $excerpt_trim ?: 20, '...' );
2593 $style_transparent = ($settings['style_transparent'] === 'yes') ? 'eel--transparent-post' : '' ;
2594 ?>
2595 <div class="grid-item <?php echo esc_attr( $anim_style ); ?>">
2596 <div class="grid-item-inner <?php echo esc_attr( $style_transparent ); ?>">
2597 <?php if ( 'yes' === $settings['show_thumbnail'] ) { ?>
2598 <div class="eel--blog-img <?php echo esc_attr( $thumb_anim ); ?> <?php echo esc_attr( $anim_style ); ?>">
2599 <a href="<?php the_permalink(); ?>">
2600 <?php if ( has_post_thumbnail() ) { the_post_thumbnail( $thumbnail_size ); } ?>
2601 <?php if ( 'yes' === $settings['style_transparent'] ) { ?>
2602 <div class="eel--overlay-all"></div>
2603 <?php } ?>
2604 </a>
2605 </div>
2606 <?php } ?>
2607
2608 <div class="ee--blog-content-wrap">
2609 <div class="ee--blog-content eel-content--<?php echo esc_attr( $style_transparent ); ?>">
2610 <?php if ( 'up_title' === $settings['meta_position'] ) : $this->render_blog_meta( $settings ); endif; ?>
2611
2612 <<?php echo esc_attr( $title_tag ); ?> class="ee--blog-title">
2613 <a href="<?php the_permalink(); ?>"><?php echo esc_html( $trimmed_title ); ?></a>
2614 </<?php echo esc_attr( $title_tag ); ?>>
2615
2616 <?php if ( 'below_title' === $settings['meta_position'] ) : $this->render_blog_meta( $settings ); endif; ?>
2617
2618 <?php if ( $settings['show_excerpt'] === 'yes' ) : ?>
2619 <div class="eel--blog-excerpt"><?php echo esc_html( $trimmed_excerpt ); ?></div>
2620 <?php endif; ?>
2621
2622 <?php if ( 'below_content' === $settings['meta_position'] ) : $this->render_blog_meta( $settings ); endif; ?>
2623 </div>
2624
2625 <?php if ( ! empty( $settings['read_more_text'] ) ) : ?>
2626 <div class="eel--read-more eel-read-more--<?php echo esc_attr( $style_transparent ); ?>">
2627 <a href="<?php the_permalink(); ?>" class="eel--read-more-link">
2628 <?php
2629 if ( isset( $settings['read_more_icon'] ) && ! empty( $settings['read_more_icon']['value'] ) && $settings['read_more_icon_position'] === 'before' ) {
2630 \Elementor\Icons_Manager::render_icon( $settings['read_more_icon'], [ 'aria-hidden' => 'true', 'class' => 'eel--read-more-icon before' ] );
2631 } elseif ( $settings['read_more_icon_position'] === 'before' ) {
2632 echo '<i class="unicon-chevron-right eel--read-more-icon before"></i>';
2633 }
2634 echo esc_html( $settings['read_more_text'] );
2635 if ( isset( $settings['read_more_icon'] ) && ! empty( $settings['read_more_icon']['value'] ) && $settings['read_more_icon_position'] === 'after' ) {
2636 \Elementor\Icons_Manager::render_icon( $settings['read_more_icon'], [ 'aria-hidden' => 'true', 'class' => 'eel--read-more-icon after' ] );
2637 } elseif ( $settings['read_more_icon_position'] === 'after' ) {
2638 echo '<i class="unicon-chevron-right eel--read-more-icon after"></i>';
2639 }
2640 ?>
2641 </a>
2642 </div>
2643 <?php endif; ?>
2644
2645 <?php if ( 'yes' === $settings['only_icon_show'] ) { ?>
2646 <a href="<?php the_permalink(); ?>" class="eel--button-icon">
2647 <?php
2648 if ( empty( $settings['only_icon']['value'] ) ) {
2649 echo '<i class="unicon-chevron-right"></i>';
2650 } else {
2651 \Elementor\Icons_Manager::render_icon( $settings['only_icon'], [ 'aria-hidden' => 'true' ] );
2652 } ?>
2653 </a>
2654 <?php } ?>
2655 </div>
2656
2657 <?php if(!empty($date_options) && !empty($settings['show_date_on_top'])): ?>
2658 <div class="eel--blog-date-top">
2659 <h4><?php echo esc_html(get_the_time('d')); ?></h4>
2660 <span><?php echo esc_html(get_the_time('M')); ?></span>
2661 </div>
2662 <?php endif; ?>
2663
2664 <?php if( 'yes' === ( $settings['show_category_badge'] ?? '' ) ) :
2665 $cats = get_the_category();
2666 if ( ! empty( $cats ) ) : ?>
2667 <div class="eel--blog-category-badge">
2668 <?php
2669 $cat_links = [];
2670 foreach ( $cats as $cat ) {
2671 $cat_links[] = '<a href="' . esc_url( get_category_link( $cat->term_id ) ) . '">' . esc_html( $cat->name ) . '</a>';
2672 }
2673
2674 echo wp_kses(
2675 implode( ',&nbsp;', $cat_links ),
2676 easyel_allowed_html()
2677 );
2678 ?>
2679 </div>
2680 <?php endif;
2681 endif; ?>
2682 </div>
2683 </div>
2684 <?php
2685 endwhile;
2686 echo '</div>';
2687
2688 if ( 'yes' === $settings['show_pagination'] && $query->max_num_pages > 1 ) {
2689
2690 $pagination = paginate_links([
2691 'base' => add_query_arg( $paged_key, '%#%' ),
2692 'format' => '?paged=%#%',
2693 'current' => $paged,
2694 'total' => $query->max_num_pages,
2695 'prev_text' => '&laquo;',
2696 'next_text' => '&raquo;',
2697 'type' => 'list',
2698 ]);
2699
2700 if ( $pagination ) {
2701 echo '<nav class="eel-blog-pagination">' . wp_kses_post( $pagination ) . '</nav>';
2702 }
2703 }
2704 wp_reset_postdata();
2705 endif;
2706 }
2707 }