PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.4.4
Easy Elements for Elementor – Addons & Website Templates v1.4.4
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.4, at widgets/blog-grid/blog-grid.php

2,599 lines 99.9 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 $this->add_responsive_control(
1216 'btn_icon_offset',
1217 [
1218 'label' => esc_html__( 'Icon Offset (Vertical)', 'easy-elements' ),
1219 'type' => \Elementor\Controls_Manager::SLIDER,
1220 'size_units' => [ 'px' ],
1221 'range' => [
1222 'px' => [
1223 'min' => -50,
1224 'max' => 100,
1225 ],
1226 ],
1227 'selectors' => [
1228 '{{WRAPPER}} .eel--read-more-icon.after, {{WRAPPER}} .eel--read-more svg' => 'top: {{SIZE}}{{UNIT}};',
1229 ],
1230 'condition' => [
1231 'show_read_more' => 'yes',
1232 ],
1233 ]
1234 );
1235
1236 $this->add_responsive_control(
1237 'btn_icon_offset_ho',
1238 [
1239 'label' => esc_html__( 'Icon Offset (Horizontal)', 'easy-elements' ),
1240 'type' => \Elementor\Controls_Manager::SLIDER,
1241 'size_units' => [ 'px' ],
1242 'range' => [
1243 'px' => [
1244 'min' => -50,
1245 'max' => 100,
1246 ],
1247 ],
1248 'selectors' => [
1249 '{{WRAPPER}} .eel--read-more-icon.after, {{WRAPPER}} .eel--read-more svg' => 'left: {{SIZE}}{{UNIT}};',
1250 ],
1251 'condition' => [
1252 'show_read_more' => 'yes',
1253 ],
1254 ]
1255 );
1256
1257 $this->end_controls_section();
1258
1259 $this->start_controls_section(
1260 '_section_button_icon',
1261 [
1262 'label' => esc_html__( 'Only Icon Button', 'easy-elements' ),
1263 'tab' => Controls_Manager::TAB_CONTENT,
1264 ]
1265 );
1266
1267 $this->add_control(
1268 'only_icon_show',
1269 [
1270 'label' => esc_html__( 'Show Icon', 'easy-elements' ),
1271 'type' => \Elementor\Controls_Manager::SWITCHER,
1272 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
1273 'label_off' => esc_html__( 'No', 'easy-elements' ),
1274 'return_value' => 'yes',
1275 'default' => '',
1276 ]
1277 );
1278
1279 $this->add_control(
1280 'only_icon',
1281 [
1282 'label' => esc_html__( 'Icon', 'easy-elements' ),
1283 'type' => \Elementor\Controls_Manager::ICONS,
1284 'default' => [
1285 'value' => '',
1286 'library' => 'fa-solid',
1287 ],
1288 ]
1289 );
1290
1291 $this->start_controls_tabs( 'button_style_tabs' );
1292
1293 $this->start_controls_tab(
1294 'icon_btn_style_normal',
1295 [
1296 'label' => __( 'Normal', 'easy-elements' ),
1297 ]
1298 );
1299
1300 $this->add_control(
1301 'icon_color',
1302 [
1303 'label' => __( 'Color', 'easy-elements' ),
1304 'type' => \Elementor\Controls_Manager::COLOR,
1305 'selectors' => [
1306 '{{WRAPPER}} .eel--button-icon svg, {{WRAPPER}} .eel--button-icon i' => 'color: {{VALUE}}; fill: {{VALUE}};',
1307 ],
1308 ]
1309 );
1310
1311 $this->add_group_control(
1312 \Elementor\Group_Control_Background::get_type(),
1313 [
1314 'name' => 'eel_iocn_background',
1315 'label' => __( 'Button Background', 'easy-elements' ),
1316 'types' => [ 'classic', 'gradient' ],
1317 'selector' => '{{WRAPPER}} .eel--button-icon',
1318 ]
1319 );
1320
1321 $this->add_group_control(
1322 \Elementor\Group_Control_Border::get_type(),
1323 [
1324 'name' => 'icon_btn_border',
1325 'label' => __( 'Button Border', 'easy-elements' ),
1326 'selector' => '{{WRAPPER}} .eel--button-icon',
1327 ]
1328 );
1329
1330 $this->add_control(
1331 'icon_border_radius',
1332 [
1333 'label' => __( 'Border Radius', 'easy-elements' ),
1334 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1335 'size_units' => [ 'px', '%' ],
1336 'selectors' => [
1337 '{{WRAPPER}} .eel--button-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1338 ],
1339 ]
1340 );
1341
1342 $this->end_controls_tab();
1343
1344 $this->start_controls_tab(
1345 'icon_btn_style_hover',
1346 [
1347 'label' => __( 'Hover', 'easy-elements' ),
1348 ]
1349 );
1350
1351 $this->add_control(
1352 'icon_color_hover',
1353 [
1354 'label' => __( 'Color', 'easy-elements' ),
1355 'type' => \Elementor\Controls_Manager::COLOR,
1356 'selectors' => [
1357 '{{WRAPPER}} .eel--button-icon:hover svg, {{WRAPPER}} .eel--button-icon:hover i' => 'color: {{VALUE}}; fill: {{VALUE}};',
1358 ],
1359 ]
1360 );
1361
1362 $this->add_group_control(
1363 \Elementor\Group_Control_Background::get_type(),
1364 [
1365 'name' => 'eel_iocn_background_hover',
1366 'label' => __( 'Button Background', 'easy-elements' ),
1367 'types' => [ 'classic', 'gradient' ],
1368 'selector' => '{{WRAPPER}} .eel--button-icon:hover',
1369 ]
1370 );
1371
1372 $this->end_controls_tab();
1373 $this->end_controls_tabs();
1374 $this->end_controls_section();
1375
1376 $this->start_controls_section(
1377 'section_transparent_settings',
1378 [
1379 'label' => __( 'Transparent Layout', 'easy-elements' ),
1380 'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
1381 ]
1382 );
1383
1384 $this->add_control(
1385 'style_transparent',
1386 [
1387 'label' => esc_html__( 'Blog Transparent', 'easy-elements' ),
1388 'type' => Controls_Manager::SWITCHER,
1389 'label_on' => esc_html__( 'Show', 'easy-elements' ),
1390 'label_off' => esc_html__( 'Hide', 'easy-elements' ),
1391 'return_value' => 'yes',
1392 'default' => '',
1393 ]
1394 );
1395
1396 $this->add_control(
1397 'transparent_overlay_heading',[
1398 'label' => esc_html__( 'Overlay Background', 'easy-elements' ),
1399 'type' => \Elementor\Controls_Manager::HEADING,
1400 'condition' => [
1401 'style_transparent' => 'yes',
1402 ],
1403 ]
1404 );
1405
1406 $this->add_group_control(
1407 \Elementor\Group_Control_Background::get_type(),
1408 [
1409 'name' => 'eel_transparent_background',
1410 'label' => __( 'Overlay Background', 'easy-elements' ),
1411 'types' => [ 'classic', 'gradient' ],
1412 'selector' => '{{WRAPPER}} .eel--transparent-post .eel--overlay-all',
1413 'condition' => [
1414 'style_transparent' => 'yes',
1415 ],
1416 ]
1417 );
1418
1419 $this->add_responsive_control(
1420 'eel_overlay_height',
1421 [
1422 'label' => __( 'Overlay Height', 'easy-elements' ),
1423 'type' => \Elementor\Controls_Manager::SLIDER,
1424 'size_units' => [ 'px', '%', 'vh' ],
1425 'range' => [
1426 'px' => [
1427 'min' => 0,
1428 'max' => 1000,
1429 'step' => 1,
1430 ],
1431 '%' => [
1432 'min' => 0,
1433 'max' => 100,
1434 ],
1435 ],
1436 'selectors' => [
1437 '{{WRAPPER}} .eel--transparent-post .eel--overlay-all' => 'height: {{SIZE}}{{UNIT}};',
1438 ],
1439 'condition' => [
1440 'style_transparent' => 'yes',
1441 ],
1442 ]
1443 );
1444
1445 $this->end_controls_section();
1446
1447
1448 $this->start_controls_section(
1449 'section_pagination_settings',
1450 [
1451 'label' => __( 'Pagination', 'easy-elements' ),
1452 'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
1453 ]
1454 );
1455
1456 $this->add_control(
1457 'show_pagination',
1458 [
1459 'label' => esc_html__( 'Show Pagination', 'easy-elements' ),
1460 'type' => Controls_Manager::SWITCHER,
1461 'label_on' => esc_html__( 'Show', 'easy-elements' ),
1462 'label_off' => esc_html__( 'Hide', 'easy-elements' ),
1463 'return_value' => 'yes',
1464 'default' => 'yes',
1465 ]
1466 );
1467
1468 $this->add_responsive_control( 'pagination_top_spacing', [
1469 'label' => esc_html__( 'Top Spacing', 'easy-elements' ),
1470 'type' => Controls_Manager::SLIDER,
1471 'range' => [ 'px' => [ 'min' => 0, 'max' => 100 ] ],
1472 'selectors' => [ '{{WRAPPER}} .eel-blog-pagination' => 'margin-top: {{SIZE}}{{UNIT}};' ],
1473 'condition' => [ 'show_pagination' => 'yes' ],
1474 ]);
1475
1476 $this->add_responsive_control( 'pagination_gap', [
1477 'label' => esc_html__( 'Gap', 'easy-elements' ),
1478 'type' => Controls_Manager::SLIDER,
1479 'range' => [ 'px' => [ 'min' => 0, 'max' => 20 ] ],
1480 'selectors' => [ '{{WRAPPER}} .eel-blog-pagination ul' => 'gap: {{SIZE}}{{UNIT}};' ],
1481 'condition' => [ 'show_pagination' => 'yes' ],
1482 ]);
1483
1484 $this->start_controls_tabs( 'pagination__tabs' );
1485
1486 $this->start_controls_tab(
1487 'pagination__normal',
1488 [
1489 'label' => __( 'Normal', 'easy-elements' ),
1490 ]
1491 );
1492
1493 $this->add_control(
1494 'pagination_color',
1495 [
1496 'label' => esc_html__( 'Color', 'easy-elements' ),
1497 'type' => \Elementor\Controls_Manager::COLOR,
1498 'selectors' => [
1499 '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span' => 'color: {{VALUE}};',
1500 ],
1501 ]
1502 );
1503
1504 $this->add_group_control(
1505 \Elementor\Group_Control_Background::get_type(),
1506 [
1507 'name' => 'pagination_background',
1508 'types' => [ 'classic', 'gradient' ],
1509 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span',
1510 ]
1511 );
1512
1513 $this->add_group_control(
1514 \Elementor\Group_Control_Typography::get_type(),
1515 [
1516 'name' => 'pagination_typography',
1517 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span',
1518 ]
1519 );
1520
1521 $this->add_group_control(
1522 \Elementor\Group_Control_Border::get_type(),
1523 [
1524 'name' => 'pagination_border',
1525 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li a',
1526 ]
1527 );
1528
1529 $this->add_responsive_control(
1530 'pagination_border_radius',
1531 [
1532 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
1533 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1534 'size_units' => [ 'px', '%' ],
1535 'selectors' => [
1536 '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1537 ],
1538 ]
1539 );
1540
1541 $this->add_responsive_control(
1542 'pagination_width',
1543 [
1544 'label' => esc_html__( 'Width', 'easy-elements' ),
1545 'type' => \Elementor\Controls_Manager::SLIDER,
1546 'size_units' => [ 'px' ],
1547 'range' => [
1548 'px' => [
1549 'min' => 40,
1550 'max' => 100,
1551 ],
1552 ],
1553 'selectors' => [
1554 '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
1555 ],
1556 'condition' => [
1557 'show_pagination' => 'yes',
1558 ],
1559 ]
1560 );
1561
1562 $this->add_responsive_control( 'pagination_padding', [
1563 'label' => esc_html__( 'Padding', 'easy-elements' ),
1564 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1565 'size_units' => [ 'px', 'em' ],
1566 'selectors' => [
1567 '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1568 ],
1569 ]);
1570
1571 $this->add_group_control(
1572 \Elementor\Group_Control_Box_Shadow::get_type(),
1573 [
1574 'name' => 'pagination_box_shadow',
1575 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span',
1576 ]
1577 );
1578
1579 $this->add_control(
1580 'pagination_alignment',
1581 [
1582 'label' => __( 'Alignment', 'easy-elements' ),
1583 'type' => \Elementor\Controls_Manager::CHOOSE,
1584 'options' => [
1585 'left' => [
1586 'title' => __( 'Left', 'easy-elements' ),
1587 'icon' => 'eicon-text-align-left',
1588 ],
1589 'center' => [
1590 'title' => __( 'Center', 'easy-elements' ),
1591 'icon' => 'eicon-text-align-center',
1592 ],
1593 'right' => [
1594 'title' => __( 'Right', 'easy-elements' ),
1595 'icon' => 'eicon-text-align-right',
1596 ],
1597 ],
1598 'default' => 'center',
1599 'toggle' => true,
1600 'selectors' => [
1601 '{{WRAPPER}} .eel-blog-pagination' => 'text-align: {{VALUE}};',
1602 ],
1603 ]
1604 );
1605
1606 $this->end_controls_tab();
1607
1608 $this->start_controls_tab(
1609 'pagination__hover',
1610 [
1611 'label' => __( 'Hover', 'easy-elements' ),
1612 ]
1613 );
1614
1615 $this->add_control(
1616 'pagination_color_current',
1617 [
1618 'label' => esc_html__( 'Color', 'easy-elements' ),
1619 'type' => \Elementor\Controls_Manager::COLOR,
1620 'selectors' => [
1621 '{{WRAPPER}} .eel-blog-pagination ul li a:hover, {{WRAPPER}} .eel-blog-pagination ul li span.current' => 'color: {{VALUE}};',
1622 ],
1623 ]
1624 );
1625
1626 $this->add_group_control(
1627 \Elementor\Group_Control_Background::get_type(),
1628 [
1629 'name' => 'pagination_background_current',
1630 'types' => [ 'classic', 'gradient' ],
1631 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li span.current, {{WRAPPER}} .eel-blog-pagination ul li a:hover',
1632 ]
1633 );
1634
1635 $this->add_group_control(
1636 \Elementor\Group_Control_Border::get_type(),
1637 [
1638 'name' => 'pagination_border_hover',
1639 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li span.current, {{WRAPPER}} .eel-blog-pagination ul li a:hover',
1640 ]
1641 );
1642
1643 $this->add_group_control(
1644 \Elementor\Group_Control_Box_Shadow::get_type(),
1645 [
1646 'name' => 'pagination_hover_box_shadow',
1647 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li span.current, {{WRAPPER}} .eel-blog-pagination ul li a:hover',
1648 ]
1649 );
1650
1651 $this->end_controls_tab();
1652 $this->end_controls_tabs();
1653 $this->end_controls_section();
1654
1655
1656 $this->start_controls_section(
1657 'section_item_style',
1658 [
1659 'label' => __( 'Items', 'easy-elements' ),
1660 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
1661 ]
1662 );
1663
1664 $this->add_group_control(
1665 \Elementor\Group_Control_Background::get_type(),
1666 [
1667 'name' => 'item_background',
1668 'label' => __( 'Item Background', 'easy-elements' ),
1669 'types' => [ 'classic', 'gradient' ],
1670 'selector' => '{{WRAPPER}} .eel-post-grid-wrap .grid-item-inner',
1671 ]
1672 );
1673
1674 $this->add_responsive_control(
1675 'item_padding',
1676 [
1677 'label' => __( 'Padding', 'easy-elements' ),
1678 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1679 'size_units' => [ 'px', 'em', '%' ],
1680 'selectors' => [
1681 '{{WRAPPER}} .eel-post-grid-wrap .grid-item-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1682 ],
1683 ]
1684 );
1685
1686 $this->add_responsive_control(
1687 'item_border_radius',
1688 [
1689 'label' => __( 'Border Radius', 'easy-elements' ),
1690 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1691 'size_units' => [ 'px', '%' ],
1692 'selectors' => [
1693 '{{WRAPPER}} .eel-post-grid-wrap .grid-item-inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1694 ],
1695 ]
1696 );
1697
1698 $this->add_group_control(
1699 \Elementor\Group_Control_Border::get_type(),
1700 [
1701 'name' => 'item_border',
1702 'selector' => '{{WRAPPER}} .eel-post-grid-wrap .grid-item-inner',
1703 ]
1704 );
1705
1706 $this->end_controls_section();
1707
1708 $this->start_controls_section(
1709 'section_conten_style',
1710 [
1711 'label' => __( 'Content Part', 'easy-elements' ),
1712 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
1713 ]
1714 );
1715
1716 $this->add_group_control(
1717 \Elementor\Group_Control_Background::get_type(),
1718 [
1719 'name' => 'content_background',
1720 'label' => __( 'Item Background', 'easy-elements' ),
1721 'types' => [ 'classic', 'gradient' ],
1722 'selector' => '{{WRAPPER}} .ee--blog-content-wrap',
1723 ]
1724 );
1725
1726 $this->add_responsive_control(
1727 'content_padding',
1728 [
1729 'label' => __( 'Padding', 'easy-elements' ),
1730 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1731 'size_units' => [ 'px', 'em', '%' ],
1732 'selectors' => [
1733 '{{WRAPPER}} .ee--blog-content-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1734 ],
1735 ]
1736 );
1737
1738 $this->add_responsive_control(
1739 'content_border_radius',
1740 [
1741 'label' => __( 'Border Radius', 'easy-elements' ),
1742 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1743 'size_units' => [ 'px', '%' ],
1744 'selectors' => [
1745 '{{WRAPPER}} .ee--blog-content-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1746 ],
1747 ]
1748 );
1749
1750 $this->add_responsive_control(
1751 'content_margin',
1752 [
1753 'label' => __( 'Margin', 'easy-elements' ),
1754 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1755 'size_units' => [ 'px', '%', 'em' ],
1756 'selectors' => [
1757 '{{WRAPPER}} .ee--blog-content-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1758 ],
1759 ]
1760 );
1761
1762 $this->end_controls_section();
1763
1764 $this->start_controls_section(
1765 'section_title_style',
1766 [
1767 'label' => __( 'Title', 'easy-elements' ),
1768 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
1769 ]
1770 );
1771
1772 // Typography
1773 $this->add_group_control(
1774 \Elementor\Group_Control_Typography::get_type(),
1775 [
1776 'name' => 'title_typography',
1777 'selector' => '{{WRAPPER}} .ee--blog-title',
1778 ]
1779 );
1780
1781 // Tabs for Normal and Hover state
1782 $this->start_controls_tabs( 'title_color_tabs' );
1783
1784 // Normal
1785 $this->start_controls_tab(
1786 'title_color_normal',
1787 [
1788 'label' => esc_html__( 'Normal', 'easy-elements' ),
1789 ]
1790 );
1791 $this->add_control(
1792 'title_color',
1793 [
1794 'label' => esc_html__( 'Color', 'easy-elements' ),
1795 'type' => \Elementor\Controls_Manager::COLOR,
1796 'selectors' => [
1797 '{{WRAPPER}} .ee--blog-title' => 'color: {{VALUE}};',
1798 ],
1799 ]
1800 );
1801
1802 $this->add_group_control(
1803 \Elementor\Group_Control_Border::get_type(),
1804 [
1805 'name' => 'title_border',
1806 'selector' => '{{WRAPPER}} .ee--blog-title',
1807 ]
1808 );
1809
1810 $this->add_responsive_control(
1811 'title_margin',
1812 [
1813 'label' => __( 'Margin', 'easy-elements' ),
1814 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1815 'size_units' => [ 'px', 'em', '%' ],
1816 'selectors' => [
1817 '{{WRAPPER}} .ee--blog-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1818 ],
1819 ]
1820 );
1821
1822 $this->add_responsive_control(
1823 'title_padding',
1824 [
1825 'label' => __( 'Padding', 'easy-elements' ),
1826 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1827 'size_units' => [ 'px', 'em', '%' ],
1828 'selectors' => [
1829 '{{WRAPPER}} .ee--blog-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1830 ],
1831 ]
1832 );
1833
1834 $this->end_controls_tab();
1835
1836 // Hover
1837 $this->start_controls_tab(
1838 'title_color_hover',
1839 [
1840 'label' => esc_html__( 'Hover', 'easy-elements' ),
1841 ]
1842 );
1843 $this->add_control(
1844 'title_hover_color',
1845 [
1846 'label' => esc_html__( 'Color', 'easy-elements' ),
1847 'type' => \Elementor\Controls_Manager::COLOR,
1848 'selectors' => [
1849 '{{WRAPPER}} .ee--blog-title:hover a' => 'color: {{VALUE}};',
1850 ],
1851 ]
1852 );
1853 $this->end_controls_tab();
1854
1855 $this->end_controls_tabs();
1856
1857 $this->end_controls_section();
1858
1859
1860 $this->start_controls_section(
1861 'section_excerpt_style',
1862 [
1863 'label' => __( 'Excerpt', 'easy-elements' ),
1864 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
1865 ]
1866 );
1867
1868 $this->add_control(
1869 'excerpt_color',
1870 [
1871 'label' => esc_html__( 'Color', 'easy-elements' ),
1872 'type' => \Elementor\Controls_Manager::COLOR,
1873 'selectors' => [
1874 '{{WRAPPER}} .eel--blog-excerpt' => 'color: {{VALUE}};',
1875 ],
1876 ]
1877 );
1878
1879 $this->add_group_control(
1880 \Elementor\Group_Control_Typography::get_type(),
1881 [
1882 'name' => 'excerpt_typography',
1883 'selector' => '{{WRAPPER}} .eel--blog-excerpt',
1884 ]
1885 );
1886
1887 $this->add_responsive_control(
1888 'excerpt_margin',
1889 [
1890 'label' => __( 'Margin', 'easy-elements' ),
1891 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1892 'size_units' => [ 'px', 'em', '%' ],
1893 'selectors' => [
1894 '{{WRAPPER}} .eel--blog-excerpt' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1895 ],
1896 ]
1897 );
1898
1899
1900 $this->end_controls_section();
1901
1902
1903 $this->start_controls_section(
1904 'section_meta_style',
1905 [
1906 'label' => __( 'Meta', 'easy-elements' ),
1907 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
1908 ]
1909 );
1910
1911 $this->add_control(
1912 'meta_text_color',
1913 [
1914 'label' => __( 'Color', 'easy-elements' ),
1915 'type' => \Elementor\Controls_Manager::COLOR,
1916 'selectors' => [
1917 '{{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}};',
1918 ],
1919 ]
1920 );
1921
1922 $this->add_control(
1923 'meta_icon_color',
1924 [
1925 'label' => __( 'Icon Color', 'easy-elements' ),
1926 'type' => \Elementor\Controls_Manager::COLOR,
1927 'selectors' => [
1928 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li i' => 'color: {{VALUE}};',
1929 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li svg' => 'color: {{VALUE}}; fill: {{VALUE}};',
1930 ],
1931 ]
1932 );
1933
1934 $this->add_responsive_control(
1935 'meta_icon_size',
1936 [
1937 'label' => __( 'Icon Size', 'easy-elements' ),
1938 'type' => \Elementor\Controls_Manager::SLIDER,
1939 'range' => [ 'px' => [ 'min' => 8, 'max' => 30 ] ],
1940 'selectors' => [
1941 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li i' => 'font-size: {{SIZE}}{{UNIT}};',
1942 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
1943 ],
1944 ]
1945 );
1946
1947 $this->add_responsive_control(
1948 'meta_icon_spacing',
1949 [
1950 'label' => __( 'Icon Spacing', 'easy-elements' ),
1951 'type' => \Elementor\Controls_Manager::SLIDER,
1952 'range' => [ 'px' => [ 'min' => 0, 'max' => 20 ] ],
1953 'selectors' => [
1954 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li i, {{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li svg' => 'margin-right: {{SIZE}}{{UNIT}};',
1955 ],
1956 'separator' => 'after',
1957 ]
1958 );
1959
1960 $this->add_group_control(
1961 \Elementor\Group_Control_Background::get_type(),
1962 [
1963 'name' => 'eel_meta_background',
1964 'label' => __( 'Button Background', 'easy-elements' ),
1965 'types' => [ 'classic', 'gradient' ],
1966 'selector' => '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li',
1967 ]
1968 );
1969
1970 $this->add_group_control(
1971 \Elementor\Group_Control_Typography::get_type(),
1972 [
1973 'name' => 'meta_typography',
1974 'label' => __( 'Typography', 'easy-elements' ),
1975 'selector' => '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li',
1976 ]
1977 );
1978
1979 $this->add_responsive_control(
1980 'meta_padding',
1981 [
1982 'label' => esc_html__( 'Padding', 'easy-elements' ),
1983 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1984 'size_units' => [ 'px', '%' ],
1985 'selectors' => [
1986 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1987 ],
1988 ]
1989 );
1990
1991 $this->add_responsive_control(
1992 'meta_spancing',
1993 [
1994 'label' => esc_html__( 'Meta Spacing', 'easy-elements' ),
1995 'type' => \Elementor\Controls_Manager::SLIDER,
1996 'size_units' => [ 'px' ],
1997 'range' => [
1998 'px' => [
1999 'min' => 0,
2000 'max' => 100,
2001 ],
2002 ],
2003 'selectors' => [
2004 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li+li' => 'margin-left: {{SIZE}}{{UNIT}}; padding-left: {{SIZE}}{{UNIT}};',
2005 ],
2006 ]
2007 );
2008
2009 $this->add_responsive_control(
2010 'meta_border_radius',
2011 [
2012 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
2013 'type' => \Elementor\Controls_Manager::DIMENSIONS,
2014 'size_units' => [ 'px', '%' ],
2015 'selectors' => [
2016 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2017 ],
2018 ]
2019 );
2020
2021 $this->end_controls_section();
2022
2023 $this->start_controls_section(
2024 'date_badge_style',
2025 [
2026 'label' => __( 'Date Badge', 'easy-elements' ),
2027 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
2028 'condition' => [
2029 'show_date_on_top' => 'yes',
2030 ],
2031 ]
2032 );
2033
2034 $this->add_control(
2035 'date_text_color_badge',
2036 [
2037 'label' => __( 'Color', 'easy-elements' ),
2038 'type' => \Elementor\Controls_Manager::COLOR,
2039 'selectors' => [
2040 '{{WRAPPER}} .eel--blog-date-top, {{WRAPPER}} .eel--blog-date-top h4' => 'color: {{VALUE}};',
2041 ],
2042 ]
2043 );
2044
2045 $this->add_group_control(
2046 \Elementor\Group_Control_Background::get_type(),
2047 [
2048 'name' => 'eel_date_background_badge',
2049 'label' => __( 'Button Background', 'easy-elements' ),
2050 'types' => [ 'classic', 'gradient' ],
2051 'selector' => '{{WRAPPER}} .eel--blog-date-top',
2052 ]
2053 );
2054
2055 $this->add_group_control(
2056 \Elementor\Group_Control_Typography::get_type(),
2057 [
2058 'name' => 'date_typography_badge_top',
2059 'label' => __( 'Typography', 'easy-elements' ),
2060 'selector' => '{{WRAPPER}} .eel--blog-date-top h4',
2061 ]
2062 );
2063
2064 $this->add_group_control(
2065 \Elementor\Group_Control_Typography::get_type(),
2066 [
2067 'name' => 'date_typography_badge_btm',
2068 'label' => __( 'Typography', 'easy-elements' ),
2069 'selector' => '{{WRAPPER}} .eel--blog-date-top',
2070 ]
2071 );
2072
2073 $this->add_responsive_control(
2074 'date_border_radius_badge',
2075 [
2076 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
2077 'type' => \Elementor\Controls_Manager::DIMENSIONS,
2078 'size_units' => [ 'px', '%' ],
2079 'selectors' => [
2080 '{{WRAPPER}} .eel--blog-date-top' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2081 ],
2082 ]
2083 );
2084
2085 $this->add_responsive_control(
2086 'date_padding_radius_badge',
2087 [
2088 'label' => esc_html__( 'Padding', 'easy-elements' ),
2089 'type' => \Elementor\Controls_Manager::DIMENSIONS,
2090 'size_units' => [ 'px', '%' ],
2091 'selectors' => [
2092 '{{WRAPPER}} .eel--blog-date-top' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2093 ],
2094 ]
2095 );
2096
2097 $this->add_responsive_control(
2098 'show_date_on_top_position_horizontal',
2099 [
2100 'label' => esc_html__('Offset Horizontal', 'easy-elements'),
2101 'type' => \Elementor\Controls_Manager::SLIDER,
2102 'size_units' => [ 'px', '%' ],
2103 'range' => [
2104 'px' => [ 'min' => -400, 'max' => 400, 'step' => 1 ],
2105 '%' => [ 'min' => -100, 'max' => 100 ],
2106 ],
2107 'selectors' => [
2108 '{{WRAPPER}} .eel--blog-date-top' => 'right: {{SIZE}}{{UNIT}};',
2109 ],
2110 ]
2111 );
2112
2113 $this->add_responsive_control(
2114 'show_date_on_top_position_vartical',
2115 [
2116 'label' => esc_html__('Offset Vertical', 'easy-elements'),
2117 'type' => \Elementor\Controls_Manager::SLIDER,
2118 'size_units' => [ 'px', '%' ],
2119 'range' => [
2120 'px' => [ 'min' => -400, 'max' => 400, 'step' => 1 ],
2121 '%' => [ 'min' => -100, 'max' => 100 ],
2122 ],
2123 'selectors' => [
2124 '{{WRAPPER}} .eel--blog-date-top' => 'top: {{SIZE}}{{UNIT}};',
2125 ],
2126 ]
2127 );
2128
2129 $this->add_control(
2130 'eel_enable_blur_switcher',
2131 [
2132 'label' => __( 'Enable Blur', 'easy-elements' ),
2133 'type' => \Elementor\Controls_Manager::SWITCHER,
2134 'label_on' => __( 'Yes', 'easy-elements' ),
2135 'label_off' => __( 'No', 'easy-elements' ),
2136 'return_value' => 'yes',
2137 'default' => 'no',
2138 ]
2139 );
2140
2141 $this->add_control(
2142 'eel_blur_badge',
2143 [
2144 'label' => __( 'Blur', 'easy-elements' ),
2145 'type' => \Elementor\Controls_Manager::SLIDER,
2146 'size_units' => [ 'px', '%' ],
2147 'range' => [
2148 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1 ],
2149 '%' => [ 'min' => 0, 'max' => 100 ],
2150 ],
2151 'condition' => [
2152 'eel_enable_blur_switcher' => 'yes',
2153 ],
2154 'selectors' => [
2155 '{{WRAPPER}} .eel--blog-date-top' => 'backdrop-filter: blur({{SIZE}}{{UNIT}});',
2156 ],
2157 ]
2158 );
2159
2160 $this->end_controls_section();
2161
2162 // Category Badge Style
2163 $this->start_controls_section(
2164 'category_badge_style',
2165 [
2166 'label' => __( 'Category Badge', 'easy-elements' ),
2167 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
2168 'condition' => [
2169 'show_category_badge' => 'yes',
2170 ],
2171 ]
2172 );
2173
2174 $this->add_control(
2175 'category_badge_color',
2176 [
2177 'label' => __( 'Color', 'easy-elements' ),
2178 'type' => \Elementor\Controls_Manager::COLOR,
2179 'selectors' => [
2180 '{{WRAPPER}} .eel--blog-category-badge a' => 'color: {{VALUE}};',
2181 ],
2182 ]
2183 );
2184
2185 $this->add_group_control(
2186 \Elementor\Group_Control_Background::get_type(),
2187 [
2188 'name' => 'category_badge_background',
2189 'label' => __( 'Background', 'easy-elements' ),
2190 'types' => [ 'classic', 'gradient' ],
2191 'selector' => '{{WRAPPER}} .eel--blog-category-badge',
2192 ]
2193 );
2194
2195 $this->add_group_control(
2196 \Elementor\Group_Control_Typography::get_type(),
2197 [
2198 'name' => 'category_badge_typography',
2199 'label' => __( 'Typography', 'easy-elements' ),
2200 'selector' => '{{WRAPPER}} .eel--blog-category-badge a',
2201 ]
2202 );
2203
2204 $this->add_responsive_control(
2205 'category_badge_border_radius',
2206 [
2207 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
2208 'type' => \Elementor\Controls_Manager::DIMENSIONS,
2209 'size_units' => [ 'px', '%' ],
2210 'selectors' => [
2211 '{{WRAPPER}} .eel--blog-category-badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2212 ],
2213 ]
2214 );
2215
2216 $this->add_responsive_control(
2217 'category_badge_padding',
2218 [
2219 'label' => esc_html__( 'Padding', 'easy-elements' ),
2220 'type' => \Elementor\Controls_Manager::DIMENSIONS,
2221 'size_units' => [ 'px', '%' ],
2222 'selectors' => [
2223 '{{WRAPPER}} .eel--blog-category-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2224 ],
2225 ]
2226 );
2227
2228 $this->add_responsive_control(
2229 'category_badge_position_horizontal',
2230 [
2231 'label' => esc_html__('Offset Horizontal', 'easy-elements'),
2232 'type' => \Elementor\Controls_Manager::SLIDER,
2233 'size_units' => [ 'px', '%' ],
2234 'range' => [
2235 'px' => [ 'min' => -400, 'max' => 400, 'step' => 1 ],
2236 '%' => [ 'min' => -100, 'max' => 100 ],
2237 ],
2238 'selectors' => [
2239 '{{WRAPPER}} .eel--blog-category-badge' => 'left: {{SIZE}}{{UNIT}};',
2240 ],
2241 ]
2242 );
2243
2244 $this->add_responsive_control(
2245 'category_badge_position_vertical',
2246 [
2247 'label' => esc_html__('Offset Vertical', 'easy-elements'),
2248 'type' => \Elementor\Controls_Manager::SLIDER,
2249 'size_units' => [ 'px', '%' ],
2250 'range' => [
2251 'px' => [ 'min' => -400, 'max' => 400, 'step' => 1 ],
2252 '%' => [ 'min' => -100, 'max' => 100 ],
2253 ],
2254 'selectors' => [
2255 '{{WRAPPER}} .eel--blog-category-badge' => 'top: {{SIZE}}{{UNIT}};',
2256 ],
2257 ]
2258 );
2259
2260 $this->add_control(
2261 'category_badge_blur',
2262 [
2263 'label' => __( 'Backdrop Blur', 'easy-elements' ),
2264 'type' => \Elementor\Controls_Manager::SLIDER,
2265 'size_units' => [ 'px' ],
2266 'range' => [
2267 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1 ],
2268 ],
2269 'selectors' => [
2270 '{{WRAPPER}} .eel--blog-category-badge' => 'backdrop-filter: blur({{SIZE}}{{UNIT}}); -webkit-backdrop-filter: blur({{SIZE}}{{UNIT}});',
2271 ],
2272 ]
2273 );
2274
2275 $this->end_controls_section();
2276 }
2277
2278 protected function render_blog_meta( $settings ) {
2279 if ( empty( $settings['show_meta'] ) || ! is_array( $settings['show_meta'] ) ) {
2280 return;
2281 }
2282
2283 $show_meta = $settings['show_meta'];
2284
2285 usort( $show_meta, function( $a, $b ) use ( $settings ) {
2286 $order_a = ! empty( $settings['meta_order_' . $a] ) ? (int) $settings['meta_order_' . $a] : 99;
2287 $order_b = ! empty( $settings['meta_order_' . $b] ) ? (int) $settings['meta_order_' . $b] : 99;
2288 return $order_a - $order_b;
2289 });
2290
2291 $eel_separator = ! empty( $settings['eel_separator'] ) ? 'eel--separator--' . esc_attr( $settings['eel_separator'] ) : '';
2292 ?>
2293 <ul class="eel--blog-meta <?php echo esc_attr($eel_separator); ?>">
2294 <?php foreach ( $show_meta as $meta ) :
2295 switch ( $meta ) :
2296 case 'date': ?>
2297 <li class="eel--blog-date">
2298 <?php
2299 if ( ! empty($settings['show_date_icon']) && $settings['show_date_icon'] === 'yes' ) {
2300 if ( empty( $settings['date_icon']['value'] ) ) {
2301 echo '<i class="unicon-calendar"></i>';
2302 } else {
2303 \Elementor\Icons_Manager::render_icon( $settings['date_icon'], [ 'aria-hidden' => 'true' ] );
2304 }
2305 }
2306 echo esc_html( get_the_date() );
2307 ?>
2308 </li>
2309 <?php break;
2310
2311 case 'author':
2312 $author_icon_type = $settings['author_icon_type'] ?? 'icon';
2313 ?>
2314 <li class="eel--blog-author <?php echo $author_icon_type === 'avatar' ? 'eel--has-avatar' : ''; ?>">
2315 <?php
2316 $author_id = get_the_author_meta( 'ID' );
2317 $author_name = get_the_author();
2318 $author_url = get_author_posts_url( $author_id );
2319
2320 if ( $author_icon_type === 'icon' ) {
2321 if ( empty( $settings['author_icon']['value'] ) ) {
2322 echo '<i class="unicon-user"></i>';
2323 } else {
2324 \Elementor\Icons_Manager::render_icon( $settings['author_icon'], [ 'aria-hidden' => 'true' ] );
2325 }
2326 } elseif ( $author_icon_type === 'avatar' ) {
2327 $avatar_size = ! empty( $settings['author_avatar_size']['size'] ) ? (int) $settings['author_avatar_size']['size'] : 22;
2328 echo '<img class="eel--author-avatar" src="' . esc_url( get_avatar_url( $author_id, [ 'size' => $avatar_size * 2 ] ) ) . '" alt="' . esc_attr( $author_name ) . '">';
2329 }
2330
2331 if ( ! empty($settings['show_by_label']) && $settings['show_by_label'] === 'yes' ) {
2332 echo '<em class="eel--meta-by">' . esc_html__( 'By', 'easy-elements' ) . '</em> ';
2333 }
2334
2335 if ( ! empty($settings['author_link_enable']) && $settings['author_link_enable'] === 'yes' ) {
2336 echo '<a class="eel--meta-author" href="' . esc_url( $author_url ) . '">' . esc_html( $author_name ) . '</a>';
2337 } else {
2338 echo '<span class="eel--meta-author">' . esc_html( $author_name ) . '</span>';
2339 }
2340 ?>
2341 </li>
2342 <?php break;
2343
2344 case 'category': ?>
2345 <li class="eel--blog-cat">
2346 <?php
2347 if ( ! empty($settings['show_category_icon']) && $settings['show_category_icon'] === 'yes' ) {
2348 if ( empty( $settings['category_icon']['value'] ) ) {
2349 echo '<i class="unicon-folder"></i>';
2350 } else {
2351 \Elementor\Icons_Manager::render_icon( $settings['category_icon'], [ 'aria-hidden' => 'true' ] );
2352 }
2353 }
2354 the_category( ', ' );
2355 ?>
2356 </li>
2357 <?php break;
2358
2359 case 'comments': ?>
2360 <li class="eel--blog-comments">
2361 <?php
2362 if ( ! empty($settings['show_comments_icon']) && $settings['show_comments_icon'] === 'yes' ) {
2363 if ( empty( $settings['comments_icon']['value'] ) ) {
2364 echo '<i class="unicon-forum"></i>';
2365 } else {
2366 \Elementor\Icons_Manager::render_icon( $settings['comments_icon'], [ 'aria-hidden' => 'true' ] );
2367 }
2368 }
2369 $comments_number = get_comments_number();
2370 echo '<a href="' . esc_url( get_comments_link() ) . '">' . esc_html( $comments_number ) . ' ' . esc_html( _n( 'Comment', 'Comments', $comments_number, 'easy-elements' ) ) . '</a>';
2371 ?>
2372 </li>
2373 <?php break;
2374
2375 case 'read_time': ?>
2376 <li class="eel--blog-read-time">
2377 <?php
2378 if ( ! empty($settings['show_read_time_icon']) && $settings['show_read_time_icon'] === 'yes' ) {
2379 if ( empty( $settings['read_time_icon']['value'] ) ) {
2380 echo '<i class="unicon-time"></i>';
2381 } else {
2382 \Elementor\Icons_Manager::render_icon( $settings['read_time_icon'], [ 'aria-hidden' => 'true' ] );
2383 }
2384 }
2385 $word_count = str_word_count( wp_strip_all_tags( get_the_content() ) );
2386 $reading_time = ceil( $word_count / 80 );
2387 echo esc_html( $reading_time ) . ' ' . esc_html__( 'min read', 'easy-elements' );
2388 ?>
2389 </li>
2390 <?php break;
2391 endswitch;
2392 endforeach; ?>
2393 </ul>
2394 <?php
2395 }
2396
2397 protected function render() {
2398 $settings = $this->get_settings_for_display();
2399 $post_type = $settings['post_type'] ?? 'post';
2400 $title_tag = $settings['title_tag'];
2401 $posts_per_page = isset($settings['posts_per_page']) ? (int) $settings['posts_per_page'] : 6;
2402
2403 $orderby = $settings['orderby'];
2404 $order = $settings['order'];
2405 $offset = isset($settings['offset']) ? (int) $settings['offset'] : 0;
2406
2407 $exclude_categories = $settings['exclude_categories'] ?? [];
2408 $thumbnail_size = $settings['thumbnail_size'];
2409 $thumb_anim = ($settings['thumb_animation'] ?? 'yes') === 'yes' ? 'eel--animate' : '';
2410 $anim_style = ($settings['eel_animation_style'] ?? 'left_right') === 'left_right' ? 'left_right' : 'top_bottom';
2411 $title_trim = $settings['title_trim'] ?? '';
2412 $date_options = ($settings['show_date_on_top'] === 'yes') ? 'd-block' : '';
2413 $excerpt_trim = $settings['excerpt_trim'];
2414
2415 $is_editor = \Elementor\Plugin::$instance->editor->is_edit_mode();
2416
2417 $widget_id = $this->get_id();
2418 $paged_key = 'paged_' . $widget_id;
2419
2420 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
2421 $current_paged = isset( $_GET[$paged_key] ) ? absint( $_GET[$paged_key] ) : ( isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1 );
2422
2423
2424 $paged = $is_editor ? 1 : max( 1, $current_paged );
2425
2426 $args = [
2427 'post_type' => $post_type,
2428 'posts_per_page' => ($posts_per_page <= 0) ? 6 : $posts_per_page,
2429 'paged' => $paged,
2430 'orderby' => $orderby,
2431 'order' => $order,
2432 'post_status' => 'publish',
2433 ];
2434
2435 if ( $offset > 0 ) {
2436 $args['offset'] = ( $paged - 1 ) * $posts_per_page + $offset;
2437 }
2438
2439 if ( apply_filters( 'easyel/pro_enabled', false ) ) {
2440 $args = apply_filters( 'easyel/apply_user_source_query', $args, $settings );
2441 }
2442
2443 if ( $settings['source_type'] === 'category' && ! empty( $settings['categories'] ) ) {
2444 $args['category__in'] = array_map( 'intval', (array) $settings['categories'] );
2445 } elseif ( $settings['source_type'] === 'post' && ! empty( $settings['post__in'] ) ) {
2446 $args['post__in'] = $settings['post__in'];
2447 $args['orderby'] = 'post__in';
2448 }
2449
2450 if ( ! empty( $exclude_categories ) ) {
2451 $args['category__not_in'] = array_map( 'intval', (array) $exclude_categories );
2452 }
2453
2454
2455 if ( ! $is_editor && ( is_category() || is_tag() || is_tax() ) ) {
2456 global $wp_query;
2457 $query = $wp_query;
2458 } else {
2459 $query = new \WP_Query( $args );
2460 }
2461
2462 if ( ! empty( $settings['exclude_posts'] ) && $query->have_posts() ) {
2463 $exclude_ids = (array) $settings['exclude_posts'];
2464 $query->posts = array_filter( $query->posts, function( $post ) use ( $exclude_ids ) {
2465 return ! in_array( $post->ID, $exclude_ids, true );
2466 });
2467 $query->post_count = count( $query->posts );
2468 }
2469
2470 if ( $offset > 0 && $posts_per_page > 0 ) {
2471 $query->found_posts = max( 0, $query->found_posts - $offset );
2472 $query->max_num_pages = ceil( $query->found_posts / $posts_per_page );
2473 }
2474
2475 if ( ! $query->have_posts() ) {
2476 echo '<p>' . esc_html__( 'No posts found.', 'easy-elements' ) . '</p>';
2477 return;
2478 }
2479
2480 if ( $query->have_posts() ) :
2481 echo '<div class="eel-post-grid-wrap">';
2482 while ( $query->have_posts() ) : $query->the_post();
2483 $trimmed_title = wp_trim_words( get_the_title(), $title_trim ?: 100, '...' );
2484 $trimmed_excerpt = wp_trim_words( get_the_excerpt(), $excerpt_trim ?: 20, '...' );
2485 $style_transparent = ($settings['style_transparent'] === 'yes') ? 'eel--transparent-post' : '' ;
2486 ?>
2487 <div class="grid-item <?php echo esc_attr( $anim_style ); ?>">
2488 <div class="grid-item-inner <?php echo esc_attr( $style_transparent ); ?>">
2489 <?php if ( 'yes' === $settings['show_thumbnail'] ) { ?>
2490 <div class="eel--blog-img <?php echo esc_attr( $thumb_anim ); ?> <?php echo esc_attr( $anim_style ); ?>">
2491 <a href="<?php the_permalink(); ?>">
2492 <?php if ( has_post_thumbnail() ) { the_post_thumbnail( $thumbnail_size ); } ?>
2493 <?php if ( 'yes' === $settings['style_transparent'] ) { ?>
2494 <div class="eel--overlay-all"></div>
2495 <?php } ?>
2496 </a>
2497 </div>
2498 <?php } ?>
2499
2500 <div class="ee--blog-content-wrap">
2501 <div class="ee--blog-content eel-content--<?php echo esc_attr( $style_transparent ); ?>">
2502 <?php if ( 'up_title' === $settings['meta_position'] ) : $this->render_blog_meta( $settings ); endif; ?>
2503
2504 <<?php echo esc_attr( $title_tag ); ?> class="ee--blog-title">
2505 <a href="<?php the_permalink(); ?>"><?php echo esc_html( $trimmed_title ); ?></a>
2506 </<?php echo esc_attr( $title_tag ); ?>>
2507
2508 <?php if ( 'below_title' === $settings['meta_position'] ) : $this->render_blog_meta( $settings ); endif; ?>
2509
2510 <?php if ( $settings['show_excerpt'] === 'yes' ) : ?>
2511 <div class="eel--blog-excerpt"><?php echo esc_html( $trimmed_excerpt ); ?></div>
2512 <?php endif; ?>
2513
2514 <?php if ( 'below_content' === $settings['meta_position'] ) : $this->render_blog_meta( $settings ); endif; ?>
2515 </div>
2516
2517 <?php if ( ! empty( $settings['read_more_text'] ) ) : ?>
2518 <div class="eel--read-more eel-read-more--<?php echo esc_attr( $style_transparent ); ?>">
2519 <a href="<?php the_permalink(); ?>" class="eel--read-more-link">
2520 <?php
2521 if ( isset( $settings['read_more_icon'] ) && ! empty( $settings['read_more_icon']['value'] ) && $settings['read_more_icon_position'] === 'before' ) {
2522 \Elementor\Icons_Manager::render_icon( $settings['read_more_icon'], [ 'aria-hidden' => 'true', 'class' => 'eel--read-more-icon before' ] );
2523 } elseif ( $settings['read_more_icon_position'] === 'before' ) {
2524 echo '<i class="unicon-chevron-right eel--read-more-icon before"></i>';
2525 }
2526 echo esc_html( $settings['read_more_text'] );
2527 if ( isset( $settings['read_more_icon'] ) && ! empty( $settings['read_more_icon']['value'] ) && $settings['read_more_icon_position'] === 'after' ) {
2528 \Elementor\Icons_Manager::render_icon( $settings['read_more_icon'], [ 'aria-hidden' => 'true', 'class' => 'eel--read-more-icon after' ] );
2529 } elseif ( $settings['read_more_icon_position'] === 'after' ) {
2530 echo '<i class="unicon-chevron-right eel--read-more-icon after"></i>';
2531 }
2532 ?>
2533 </a>
2534 </div>
2535 <?php endif; ?>
2536
2537 <?php if ( 'yes' === $settings['only_icon_show'] ) { ?>
2538 <a href="<?php the_permalink(); ?>" class="eel--button-icon">
2539 <?php
2540 if ( empty( $settings['only_icon']['value'] ) ) {
2541 echo '<i class="unicon-chevron-right"></i>';
2542 } else {
2543 \Elementor\Icons_Manager::render_icon( $settings['only_icon'], [ 'aria-hidden' => 'true' ] );
2544 } ?>
2545 </a>
2546 <?php } ?>
2547 </div>
2548
2549 <?php if(!empty($date_options) && !empty($settings['show_date_on_top'])): ?>
2550 <div class="eel--blog-date-top">
2551 <h4><?php echo esc_html(get_the_time('d')); ?></h4>
2552 <span><?php echo esc_html(get_the_time('M')); ?></span>
2553 </div>
2554 <?php endif; ?>
2555
2556 <?php if( 'yes' === ( $settings['show_category_badge'] ?? '' ) ) :
2557 $cats = get_the_category();
2558 if ( ! empty( $cats ) ) : ?>
2559 <div class="eel--blog-category-badge">
2560 <?php
2561 $cat_links = [];
2562 foreach ( $cats as $cat ) {
2563 $cat_links[] = '<a href="' . esc_url( get_category_link( $cat->term_id ) ) . '">' . esc_html( $cat->name ) . '</a>';
2564 }
2565
2566 echo wp_kses(
2567 implode( ',&nbsp;', $cat_links ),
2568 easyel_allowed_html()
2569 );
2570 ?>
2571 </div>
2572 <?php endif;
2573 endif; ?>
2574 </div>
2575 </div>
2576 <?php
2577 endwhile;
2578 echo '</div>';
2579
2580 if ( 'yes' === $settings['show_pagination'] && $query->max_num_pages > 1 ) {
2581
2582 $pagination = paginate_links([
2583 'base' => add_query_arg( $paged_key, '%#%' ),
2584 'format' => '?paged=%#%',
2585 'current' => $paged,
2586 'total' => $query->max_num_pages,
2587 'prev_text' => '&laquo;',
2588 'next_text' => '&raquo;',
2589 'type' => 'list',
2590 ]);
2591
2592 if ( $pagination ) {
2593 echo '<nav class="eel-blog-pagination">' . wp_kses_post( $pagination ) . '</nav>';
2594 }
2595 }
2596 wp_reset_postdata();
2597 endif;
2598 }
2599 }