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

2,117 lines 78.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 use Elementor\Utils;
3 use Elementor\Icons_Manager;
4 use Elementor\Controls_Manager;
5 use Elementor\Group_Control_Image_Size;
6
7 defined( 'ABSPATH' ) || die();
8
9 class Easyel_Blog_Grid__Widget extends \Elementor\Widget_Base {
10
11 public function get_style_depends() {
12 $handle = 'eel-blog-grid-style';
13 $css_path = plugin_dir_path( __FILE__ ) . 'css/blog-grid.min.css';
14 if ( ! wp_style_is( $handle, 'registered' ) && file_exists( $css_path ) ) {
15 wp_register_style( $handle, plugins_url( 'css/blog-grid.min.css', __FILE__ ), [], defined( 'WP_DEBUG' ) && WP_DEBUG ? filemtime( $css_path ) : EASYELEMENTS_VER );
16 }
17 return [ $handle ];
18 }
19 protected function get_all_posts() {
20 $posts = get_posts( [ 'numberposts' => -1 ] );
21 $options = [];
22 foreach ( $posts as $post ) {
23 $options[ $post->ID ] = $post->post_title;
24 }
25 return $options;
26 }
27
28 protected function get_post_type_options() {
29 $exclude_post_types = ['attachment', 'revision', 'nav_menu_item', 'custom_post_type_slug'];
30
31 $post_types = get_post_types(['public' => true], 'objects');
32 $options = [];
33
34 foreach ($post_types as $post_type => $post_type_obj) {
35 if (!in_array($post_type, $exclude_post_types)) {
36 $taxonomies = get_object_taxonomies($post_type, 'names');
37 if (!empty($taxonomies)) {
38 $options[$post_type] = $post_type_obj->label;
39 }
40 }
41 }
42 return $options;
43 }
44
45
46 protected function get_all_categories() {
47 $cats = get_categories( [ 'hide_empty' => false ] );
48 $options = [];
49 foreach ( $cats as $cat ) {
50 $options[ $cat->term_id ] = $cat->name;
51 }
52 return $options;
53 }
54
55
56 public function get_name() {
57 return 'eel-blog-grid';
58 }
59
60 public function get_title() {
61 return esc_html__( 'Post Grid', 'easy-elements' );
62 }
63
64 public function get_icon() {
65 return 'easyicon easyelIcon-post-grid';
66 }
67
68 public function get_categories() {
69 return [ 'easyicon easyelIcon-post-grid' ];
70 }
71
72 public function get_keywords() {
73 return [ 'blog', 'grid', 'post', 'news' ];
74 }
75
76 protected function register_controls() {
77 $this->start_controls_section(
78 '_section_grid',
79 [
80 'label' => esc_html__( 'Posts Settings', 'easy-elements' ),
81 'tab' => Controls_Manager::TAB_CONTENT,
82 ]
83 );
84
85 $this->add_control(
86 'title_trim',
87 [
88 'label' => esc_html__( 'Title Trim Words', 'easy-elements' ),
89 'type' => Controls_Manager::NUMBER,
90 'description' => esc_html__('Limit number of words in the post title', 'easy-elements'),
91 ]
92 );
93
94 $this->add_control(
95 'show_excerpt',
96 [
97 'label' => esc_html__( 'Show Excerpt', 'easy-elements' ),
98 'type' => Controls_Manager::SWITCHER,
99 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
100 'label_off' => esc_html__( 'No', 'easy-elements' ),
101 'default' => 'yes',
102 ]
103 );
104
105 $this->add_control(
106 'excerpt_trim',
107 [
108 'label' => esc_html__( 'Excerpt Trim Words', 'easy-elements' ),
109 'type' => Controls_Manager::NUMBER,
110 'description' => esc_html__('Limit number of words in the excerpt', 'easy-elements'),
111 'condition' => [
112 'show_excerpt' => 'yes',
113 ]
114 ]
115 );
116
117 $this->add_control(
118 'title_tag',
119 [
120 'label' => esc_html__( 'Title HTML Tag', 'easy-elements' ),
121 'type' => Controls_Manager::SELECT,
122 'options' => [
123 'h1' => 'H1',
124 'h2' => 'H2',
125 'h3' => 'H3',
126 'h4' => 'H4',
127 'h5' => 'H5',
128 'h6' => 'H6',
129 ],
130 'default' => 'h3',
131 ]
132 );
133
134 $this->add_control(
135 'show_thumbnail',
136 [
137 'label' => esc_html__( 'Show Thumbnail', 'easy-elements' ),
138 'type' => Controls_Manager::SWITCHER,
139 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
140 'label_off' => esc_html__( 'No', 'easy-elements' ),
141 'default' => 'yes',
142 ]
143 );
144
145 $this->add_control(
146 'thumb_animation',
147 [
148 'label' => esc_html__( 'Image Animation', 'easy-elements' ),
149 'type' => Controls_Manager::SWITCHER,
150 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
151 'label_off' => esc_html__( 'No', 'easy-elements' ),
152 'default' => 'no',
153 'condition' => [
154 'show_thumbnail' => 'yes',
155 ],
156 ]
157 );
158
159 $this->add_control(
160 'eel_animation_style',[
161 'label' => esc_html__( 'Animation', 'easy-elements' ),
162 'type' => Controls_Manager::SELECT,
163 'default' => 'left_right',
164 'options' => [
165 'left_right' => esc_html__( 'Left to Right', 'easy-elements' ),
166 'top_bottom' => esc_html__( 'Top to Bottom', 'easy-elements' ),
167 ],
168 'condition' => [
169 'show_thumbnail' => 'yes',
170 'thumb_animation' => 'yes',
171 ],
172 ]
173 );
174
175
176 $this->add_group_control(
177 Group_Control_Image_Size::get_type(),
178 [
179 'name' => 'thumbnail',
180 'default' => 'medium',
181 ]
182 );
183
184 $this->add_responsive_control(
185 'post_image_height',
186 [
187 'label' => esc_html__( 'Image Height', 'easy-elements' ),
188 'type' => \Elementor\Controls_Manager::SLIDER,
189 'size_units' => [ 'px', 'em', '%' ],
190 'range' => [
191 'px' => [
192 'min' => 0,
193 'max' => 1000,
194 ],
195 'em' => [
196 'min' => 0,
197 'max' => 50,
198 ],
199 '%' => [
200 'min' => 0,
201 'max' => 100,
202 ],
203 ],
204 'selectors' => [
205 '{{WRAPPER}} .eel-post-grid-wrap .grid-item img' => 'height: {{SIZE}}{{UNIT}};',
206 ],
207 ]
208 );
209
210 $this->add_responsive_control(
211 'flex_item_width',
212 [
213 'label' => esc_html__( 'image Width', 'easy-elements' ),
214 'type' => \Elementor\Controls_Manager::SLIDER,
215 'size_units' => [ '%', 'px', 'vw' ],
216 'range' => [
217 '%' => [
218 'min' => 1,
219 'max' => 100,
220 ],
221 'px' => [
222 'min' => 50,
223 'max' => 1200,
224 ],
225 'vw' => [
226 'min' => 1,
227 'max' => 100,
228 ],
229 ],
230 'default' => [
231 'unit' => '%',
232 'size' => 100,
233 ],
234 'selectors' => [
235 '{{WRAPPER}} .eel--blog-img' => 'flex: 0 0 {{SIZE}}{{UNIT}}; max-width: {{SIZE}}{{UNIT}};',
236 ],
237 ]
238 );
239
240 $this->add_responsive_control(
241 'image_border_radius',
242 [
243 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
244 'type' => \Elementor\Controls_Manager::DIMENSIONS,
245 'size_units' => [ 'px', '%' ],
246 'selectors' => [
247 '{{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}};',
248 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-img img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
249 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
250 ],
251 ]
252 );
253
254 $this->add_responsive_control(
255 'post_image_alignment',
256 [
257 'label' => esc_html__( 'Image Alignment', 'easy-elements' ),
258 'type' => \Elementor\Controls_Manager::CHOOSE,
259 'options' => [
260 'row' => [
261 'title' => esc_html__( 'Left', 'easy-elements' ),
262 'icon' => 'eicon-h-align-left',
263 ],
264 'row-reverse' => [
265 'title' => esc_html__( 'Right', 'easy-elements' ),
266 'icon' => 'eicon-h-align-right',
267 ],
268 'column' => [
269 'title' => esc_html__( 'Top', 'easy-elements' ),
270 'icon' => 'eicon-v-align-top',
271 ],
272 'column-reverse' => [
273 'title' => esc_html__( 'Bottom', 'easy-elements' ),
274 'icon' => 'eicon-v-align-bottom',
275 ],
276 ],
277 'default' => 'column',
278 'toggle' => true,
279 'selectors' => [
280 '{{WRAPPER}} .grid-item-inner' => 'display:inline-flex; flex-direction: {{VALUE}}; align-items: center; gap: 40px;',
281 ],
282 ]
283 );
284
285 $this->add_responsive_control(
286 'flex_gap',
287 [
288 'label' => esc_html__( 'Gap', 'easy-elements' ),
289 'type' => \Elementor\Controls_Manager::SLIDER,
290 'size_units' => [ 'px', 'em', 'rem' ],
291 'range' => [
292 'px' => [
293 'min' => 0,
294 'max' => 100,
295 ],
296 'em' => [
297 'min' => 0,
298 'max' => 10,
299 ],
300 'rem' => [
301 'min' => 0,
302 'max' => 10,
303 ],
304 ],
305 'default' => [
306 'unit' => 'px',
307 'size' => 20,
308 ],
309 'selectors' => [
310 '{{WRAPPER}} .grid-item-inner' => 'gap: {{SIZE}}{{UNIT}};',
311 ],
312 ]
313 );
314 $this->add_control(
315 'item_alignment',
316 [
317 'label' => __( 'Alignment', 'easy-elements' ),
318 'type' => \Elementor\Controls_Manager::CHOOSE,
319 'options' => [
320 'left' => [
321 'title' => __( 'Left', 'easy-elements' ),
322 'icon' => 'eicon-text-align-left',
323 ],
324 'center' => [
325 'title' => __( 'Center', 'easy-elements' ),
326 'icon' => 'eicon-text-align-center',
327 ],
328 'right' => [
329 'title' => __( 'Right', 'easy-elements' ),
330 'icon' => 'eicon-text-align-right',
331 ],
332 ],
333 'default' => 'left',
334 'toggle' => true,
335 'selectors' => [
336 '{{WRAPPER}} .eel-post-grid-wrap .grid-item' => 'text-align: {{VALUE}};',
337 ],
338 ]
339 );
340
341 $this->add_responsive_control(
342 'columns',
343 [
344 'label' => esc_html__( 'Select Columns', 'easy-elements' ),
345 'type' => Controls_Manager::SELECT,
346 'default' => '4',
347 'tablet_default' => '3',
348 'mobile_default' => '2',
349 'options' => [
350 '1' => '1 Column',
351 '2' => '2 Columns',
352 '3' => '3 Columns',
353 '4' => '4 Columns',
354 '5' => '5 Columns',
355 '6' => '6 Columns',
356 ],
357 'selectors' => [
358 '{{WRAPPER}} .eel-post-grid-wrap .grid-item' => 'width: calc(100% / {{VALUE}});',
359 ],
360 ]
361 );
362
363 $this->add_responsive_control(
364 'column_padding',
365 [
366 'label' => esc_html__( 'Column Space', 'easy-elements' ),
367 'type' => \Elementor\Controls_Manager::DIMENSIONS,
368 'size_units' => [ 'px', 'em', '%' ],
369 'selectors' => [
370 '{{WRAPPER}} .eel-post-grid-wrap .grid-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
371 ],
372 ]
373 );
374
375 $this->end_controls_section();
376
377 $this->start_controls_section(
378 '_section_grid_query',
379 [
380 'label' => esc_html__( 'Query Settings', 'easy-elements' ),
381 'tab' => Controls_Manager::TAB_CONTENT,
382 ]
383 );
384
385 $this->add_control(
386 'post_type',
387 [
388 'label' => esc_html__( 'Post Type', 'easy-elements' ),
389 'type' => Controls_Manager::SELECT,
390 'options' => $this->get_post_type_options(),
391 'default' => 'post',
392 'description' => '',
393 ]
394 );
395
396 $this->add_control(
397 'source_type',
398 [
399 'label' => esc_html__( 'Source Type', 'easy-elements' ),
400 'type' => Controls_Manager::SELECT,
401 'options' => [
402 'category' => esc_html__( 'Category', 'easy-elements' ),
403 'post' => esc_html__( 'Specific Posts', 'easy-elements' ),
404 ],
405 'default' => 'category',
406 ]
407 );
408
409
410 $this->add_control(
411 'categories',
412 [
413 'label' => esc_html__( 'Select Categories', 'easy-elements' ),
414 'type' => Controls_Manager::SELECT2,
415 'multiple' => true,
416 'options' => $this->get_all_categories(),
417 'label_block' => true,
418 'condition' => [
419 'source_type' => 'category',
420 ],
421 ]
422 );
423
424 $this->add_control(
425 'post__in',
426 [
427 'label' => esc_html__( 'Select Specific Posts', 'easy-elements' ),
428 'type' => Controls_Manager::SELECT2,
429 'options' => $this->get_all_posts(),
430 'multiple' => true,
431 'label_block' => true,
432 'description' => '',
433 'condition' => [
434 'source_type' => 'post',
435 ],
436 ]
437 );
438
439
440 $this->add_control(
441 'exclude_posts',
442 [
443 'label' => esc_html__( 'Exclude Posts', 'easy-elements' ),
444 'type' => \Elementor\Controls_Manager::SELECT2,
445 'multiple' => true,
446 'options' => $this->get_all_posts(),
447 'label_block' => true,
448 'description' => '',
449 'condition' => [
450 'source_type!' => 'post',
451 ],
452 ]
453 );
454
455
456 $this->add_control(
457 'posts_per_page',
458 [
459 'label' => esc_html__( 'Posts Per Page', 'easy-elements' ),
460 'type' => Controls_Manager::NUMBER,
461 'default' => 6,
462 'min' => 1,
463 'max' => 50,
464 ]
465 );
466
467 $this->add_control(
468 'orderby',
469 [
470 'label' => esc_html__( 'Order By', 'easy-elements' ),
471 'type' => Controls_Manager::SELECT,
472 'options' => [
473 'date' => esc_html__( 'Date', 'easy-elements' ),
474 'title' => esc_html__( 'Title', 'easy-elements' ),
475 'rand' => esc_html__( 'Random', 'easy-elements' ),
476 'menu_order' => esc_html__( 'Menu Order', 'easy-elements' ),
477 ],
478 'default' => 'date',
479 'description' => '',
480 ]
481 );
482
483 $this->add_control(
484 'order',
485 [
486 'label' => esc_html__( 'Order', 'easy-elements' ),
487 'type' => Controls_Manager::SELECT,
488 'options' => [
489 'DESC' => esc_html__( 'Descending', 'easy-elements' ),
490 'ASC' => esc_html__( 'Ascending', 'easy-elements' ),
491 ],
492 'default' => 'DESC',
493 'description' => '',
494 ]
495 );
496
497
498 $this->end_controls_section();
499
500
501 $this->start_controls_section(
502 '_section_meta',
503 [
504 'label' => esc_html__( 'Meta Settings', 'easy-elements' ),
505 'tab' => Controls_Manager::TAB_CONTENT,
506 ]
507 );
508
509 $this->add_control(
510 'show_meta',
511 [
512 'label' => esc_html__('Show Meta', 'easy-elements'),
513 'type' => \Elementor\Controls_Manager::SELECT2,
514 'multiple' => true,
515 'options' => [
516 'date' => esc_html__('Date', 'easy-elements'),
517 'author' => esc_html__('Author', 'easy-elements'),
518 'category' => esc_html__('Category', 'easy-elements'),
519 'comments' => esc_html__('Comments', 'easy-elements'),
520 'read_time' => esc_html__('Reading Time', 'easy-elements'),
521 ],
522 'default' => ['date', 'author'],
523 'label_block' => true,
524 ]
525 );
526
527 $this->add_control(
528 'show_date_icon',
529 [
530 'label' => esc_html__( 'Show Date Icon', 'easy-elements' ),
531 'type' => Controls_Manager::SWITCHER,
532 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
533 'label_off' => esc_html__( 'No', 'easy-elements' ),
534 'default' => 'yes',
535 'condition' => [
536 'show_meta' => 'date',
537 ]
538 ]
539 );
540
541 $this->add_control(
542 'date_icon',
543 [
544 'label' => esc_html__( 'Date Icon', 'easy-elements' ),
545 'type' => \Elementor\Controls_Manager::ICONS,
546 'default' => [
547 'value' => '',
548 'library' => 'fa-solid',
549 ],
550 'condition' => [
551 'show_date_icon' => 'yes',
552 'show_meta' => 'date',
553 ],
554 ]
555 );
556
557 $this->add_control(
558 'show_by_label',
559 [
560 'label' => __( 'Show "By" Label', 'easy-elements' ),
561 'type' => \Elementor\Controls_Manager::SWITCHER,
562 'label_on' => __( 'Yes', 'easy-elements' ),
563 'label_off' => __( 'No', 'easy-elements' ),
564 'return_value' => 'yes',
565 'default' => 'yes',
566 ]
567 );
568
569 $this->add_control(
570 'author_link_enable',
571 [
572 'label' => __( 'Author Link', 'easy-elements' ),
573 'type' => \Elementor\Controls_Manager::SWITCHER,
574 'label_on' => __( 'Yes', 'easy-elements' ),
575 'label_off' => __( 'No', 'easy-elements' ),
576 'return_value' => 'yes',
577 'default' => '',
578 ]
579 );
580
581
582 $this->add_control(
583 'show_author_icon',
584 [
585 'label' => esc_html__( 'Show Author Icon', 'easy-elements' ),
586 'type' => Controls_Manager::SWITCHER,
587 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
588 'label_off' => esc_html__( 'No', 'easy-elements' ),
589 'default' => 'yes',
590 'condition' => [
591 'show_meta' => 'author',
592 ]
593 ]
594 );
595
596 $this->add_control(
597 'author_icon',
598 [
599 'label' => esc_html__( 'Author Icon', 'easy-elements' ),
600 'type' => \Elementor\Controls_Manager::ICONS,
601 'default' => [
602 'value' => '',
603 'library' => 'fa-solid',
604 ],
605 'condition' => [
606 'show_author_icon' => 'yes',
607 'show_meta' => 'author',
608 ],
609 ]
610 );
611
612
613 $this->add_control(
614 'show_category_icon',
615 [
616 'label' => esc_html__( 'Show Category Icon', 'easy-elements' ),
617 'type' => Controls_Manager::SWITCHER,
618 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
619 'label_off' => esc_html__( 'No', 'easy-elements' ),
620 'default' => 'yes',
621 'condition' => [
622 'show_meta' => 'category',
623 ]
624 ]
625 );
626
627 $this->add_control(
628 'category_icon',
629 [
630 'label' => esc_html__( 'Category Icon', 'easy-elements' ),
631 'type' => \Elementor\Controls_Manager::ICONS,
632 'default' => [
633 'value' => '',
634 'library' => 'fa-solid',
635 ],
636 'condition' => [
637 'show_category_icon' => 'yes',
638 'show_meta' => 'category',
639 ],
640 ]
641 );
642
643 $this->add_control(
644 'show_comments_icon',
645 [
646 'label' => esc_html__( 'Show Comments Icon', 'easy-elements' ),
647 'type' => \Elementor\Controls_Manager::SWITCHER,
648 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
649 'label_off' => esc_html__( 'No', 'easy-elements' ),
650 'default' => 'yes',
651 'condition' => [
652 'show_meta' => 'comments',
653 ]
654 ]
655 );
656
657 $this->add_control(
658 'comments_icon',
659 [
660 'label' => esc_html__( 'Comments Icon', 'easy-elements' ),
661 'type' => \Elementor\Controls_Manager::ICONS,
662 'condition' => [
663 'show_comments_icon' => 'yes',
664 'show_meta' => 'comments',
665 ],
666 ]
667 );
668
669 $this->add_control(
670 'show_read_time_icon',
671 [
672 'label' => esc_html__('Show Reading Time Icon', 'easy-elements'),
673 'type' => \Elementor\Controls_Manager::SWITCHER,
674 'default' => 'yes',
675 ]
676 );
677
678 $this->add_control(
679 'read_time_icon',
680 [
681 'label' => esc_html__('Reading Time Icon', 'easy-elements'),
682 'type' => \Elementor\Controls_Manager::ICONS,
683 'condition' => [
684 'show_read_time_icon' => 'yes',
685 ],
686 ]
687 );
688
689 $this->add_control(
690 'show_date_on_top',[
691 'label' => esc_html__( 'Date Badge', 'easy-elements' ),
692 'type' => \Elementor\Controls_Manager::SWITCHER,
693 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
694 'label_off' => esc_html__( 'No', 'easy-elements' ),
695 'default' => 'no',
696 ]
697 );
698
699 $this->add_responsive_control(
700 'meta_icon_offset',
701 [
702 'label' => esc_html__( 'Meta Icon Offset (px)', 'easy-elements' ),
703 'type' => \Elementor\Controls_Manager::SLIDER,
704 'size_units' => [ 'px' ],
705 'range' => [
706 'px' => [
707 'min' => -50,
708 'max' => 100,
709 ],
710 ],
711 'selectors' => [
712 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta svg, {{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta i' => 'top: {{SIZE}}{{UNIT}};',
713 ],
714 ]
715 );
716
717 $this->add_control(
718 'meta_position',
719 [
720 'label' => esc_html__( 'Meta Position', 'easy-elements' ),
721 'type' => \Elementor\Controls_Manager::SELECT,
722 'default' => 'up_title',
723 'options' => [
724 'up_title' => esc_html__( 'Up Title', 'easy-elements' ),
725 'below_title' => esc_html__( 'Below Title', 'easy-elements' ),
726 'below_content'=> esc_html__( 'Below Content', 'easy-elements' ),
727 ],
728 'description' => '',
729 ]
730 );
731
732
733 $this->add_control(
734 'eel_separator',
735 [
736 'label' => esc_html__( 'Separator Type', 'easy-elements' ),
737 'type' => \Elementor\Controls_Manager::SELECT,
738 'options' => [
739 '' => esc_html__( 'None', 'easy-elements' ),
740 'line' => esc_html__( 'Line', 'easy-elements' ),
741 'circle' => esc_html__( 'Circle', 'easy-elements' ),
742 ],
743 'default' => '',
744 ]
745 );
746
747 $this->add_control(
748 'separator_color',
749 [
750 'label' => __( 'Separator Color', 'easy-elements' ),
751 'type' => \Elementor\Controls_Manager::COLOR,
752 'selectors' => [
753 '{{WRAPPER}} .eel--separator--line li + li::before, {{WRAPPER}} .eel--separator--circle li + li::before' => 'background-color: {{VALUE}};',
754 ],
755 'condition' => [
756 'eel_separator!' => '',
757 ],
758 ]
759 );
760
761 $this->add_responsive_control(
762 'separator_offset',
763 [
764 'label' => esc_html__( 'Separator Offset (px)', 'easy-elements' ),
765 'type' => \Elementor\Controls_Manager::SLIDER,
766 'size_units' => [ 'px' ],
767 'range' => [
768 'px' => [
769 'min' => -50,
770 'max' => 100,
771 ],
772 ],
773 'selectors' => [
774 '{{WRAPPER}} .eel--separator--line li + li::before, {{WRAPPER}} .eel--separator--circle li + li::before' => 'top: {{SIZE}}{{UNIT}};',
775 ],
776 'condition' => [
777 'eel_separator!' => '',
778 ],
779 ]
780 );
781
782
783 $this->add_responsive_control(
784 'meta_margin',
785 [
786 'label' => __( 'Margin', 'easy-elements' ),
787 'type' => \Elementor\Controls_Manager::DIMENSIONS,
788 'size_units' => [ 'px', 'em', '%' ],
789 'selectors' => [
790 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
791 ],
792 ]
793 );
794
795 $this->end_controls_section();
796
797 $this->start_controls_section(
798 '_section_button',
799 [
800 'label' => esc_html__( 'Button Settings', 'easy-elements' ),
801 'tab' => Controls_Manager::TAB_CONTENT,
802 ]
803 );
804
805 $this->add_control(
806 'show_read_more',
807 [
808 'label' => esc_html__( 'Show Read More', 'easy-elements' ),
809 'type' => \Elementor\Controls_Manager::SWITCHER,
810 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
811 'label_off' => esc_html__( 'No', 'easy-elements' ),
812 'return_value' => 'yes',
813 'default' => 'yes',
814 ]
815 );
816
817 $this->add_control(
818 'read_more_text',
819 [
820 'label' => esc_html__( 'Read More', 'easy-elements' ),
821 'type' => \Elementor\Controls_Manager::TEXT,
822 'default' => esc_html__( 'Read More', 'easy-elements' ),
823 'condition' => [
824 'show_read_more' => 'yes',
825 ],
826 ]
827 );
828
829 $this->add_control(
830 'read_more_icon',
831 [
832 'label' => esc_html__( 'Read More Icon', 'easy-elements' ),
833 'type' => \Elementor\Controls_Manager::ICONS,
834 'default' => [
835 'value' => '',
836 'library' => 'fa-solid',
837 ],
838 'condition' => [
839 'show_read_more' => 'yes',
840 ],
841 ]
842 );
843
844 $this->add_control(
845 'read_more_icon_position',
846 [
847 'label' => esc_html__( 'Icon Position', 'easy-elements' ),
848 'type' => \Elementor\Controls_Manager::SELECT,
849 'default' => 'after',
850 'options' => [
851 'before' => esc_html__( 'Before Text', 'easy-elements' ),
852 'after' => esc_html__( 'After Text', 'easy-elements' ),
853 ],
854 'condition' => [
855 'show_read_more' => 'yes',
856 ],
857 ]
858 );
859
860 $this->start_controls_tabs( 'read_more_button_style_tabs' );
861
862 // Normal State
863 $this->start_controls_tab(
864 'button_style_normal',
865 [
866 'label' => esc_html__( 'Normal', 'easy-elements' ),
867 ]
868 );
869
870 $this->add_control(
871 'button_text_color',
872 [
873 'label' => esc_html__( 'Color', 'easy-elements' ),
874 'type' => \Elementor\Controls_Manager::COLOR,
875 'selectors' => [
876 '{{WRAPPER}} .eel--read-more a' => 'color: {{VALUE}};',
877 '{{WRAPPER}} .eel--read-more a svg, {{WRAPPER}} .eel--read-more a svg path' => 'fill: {{VALUE}};',
878 ],
879 ]
880 );
881
882 $this->add_group_control(
883 \Elementor\Group_Control_Typography::get_type(),
884 [
885 'name' => 'button_typography',
886 'selector' => '{{WRAPPER}} .eel--read-more a',
887 ]
888 );
889
890 $this->add_group_control(
891 \Elementor\Group_Control_Background::get_type(),
892 [
893 'name' => 'eel_btn_background',
894 'label' => __( 'Button Background', 'easy-elements' ),
895 'types' => [ 'classic', 'gradient' ],
896 'selector' => '{{WRAPPER}} .eel--read-more a',
897 ]
898 );
899
900 $this->add_group_control(
901 \Elementor\Group_Control_Border::get_type(),
902 [
903 'name' => 'button_border',
904 'selector' => '{{WRAPPER}} .eel--read-more a',
905 ]
906 );
907
908 $this->add_responsive_control(
909 'button_border_radius',
910 [
911 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
912 'type' => \Elementor\Controls_Manager::DIMENSIONS,
913 'size_units' => [ 'px', '%' ],
914 'selectors' => [
915 '{{WRAPPER}} .eel--read-more a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
916 ],
917 ]
918 );
919
920 $this->add_responsive_control(
921 'button_padding',
922 [
923 'label' => esc_html__( 'Padding', 'easy-elements' ),
924 'type' => \Elementor\Controls_Manager::DIMENSIONS,
925 'size_units' => [ 'px', 'em', '%' ],
926 'selectors' => [
927 '{{WRAPPER}} .eel--read-more a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
928 ],
929 ]
930 );
931
932 $this->add_responsive_control(
933 'button_margin',
934 [
935 'label' => esc_html__( 'Margin', 'easy-elements' ),
936 'type' => \Elementor\Controls_Manager::DIMENSIONS,
937 'size_units' => [ 'px', 'em', '%' ],
938 'selectors' => [
939 '{{WRAPPER}} .eel--read-more' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
940 ],
941 ]
942 );
943
944 $this->end_controls_tab();
945
946 $this->start_controls_tab(
947 'button_style_hover',
948 [
949 'label' => esc_html__( 'Hover', 'easy-elements' ),
950 ]
951 );
952
953 $this->add_control(
954 'button_text_color_hover',
955 [
956 'label' => esc_html__( 'Color', 'easy-elements' ),
957 'type' => \Elementor\Controls_Manager::COLOR,
958 'selectors' => [
959 '{{WRAPPER}} .eel--read-more a:hover' => 'color: {{VALUE}};',
960 '{{WRAPPER}} .eel--read-more a:hover svg, {{WRAPPER}} .eel--read-more a:hover svg path' => 'fill: {{VALUE}};',
961 ],
962 ]
963 );
964
965 $this->add_control(
966 'button_bg_color_hover',
967 [
968 'label' => esc_html__( 'Background Color', 'easy-elements' ),
969 'type' => \Elementor\Controls_Manager::COLOR,
970 'selectors' => [
971 '{{WRAPPER}} .eel--read-more a:hover' => 'background-color: {{VALUE}};',
972 ],
973 ]
974 );
975
976 $this->add_group_control(
977 \Elementor\Group_Control_Border::get_type(),
978 [
979 'name' => 'button_border_hover',
980 'selector' => '{{WRAPPER}} .eel--read-more a:hover',
981 ]
982 );
983
984 $this->end_controls_tab();
985
986 $this->end_controls_tabs();
987
988 $this->add_responsive_control(
989 'icon__size',
990 [
991 'label' => esc_html__( 'Icon Size', 'easy-elements' ),
992 'type' => \Elementor\Controls_Manager::SLIDER,
993 'size_units' => [ 'px' ],
994 'range' => [
995 'px' => [
996 'min' => -50,
997 'max' => 100,
998 ],
999 ],
1000 'selectors' => [
1001 '{{WRAPPER}} .eel--read-more svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
1002 '{{WRAPPER}} .eel--read-more i' => 'font-size: {{SIZE}}{{UNIT}};',
1003 ],
1004 'condition' => [
1005 'show_read_more' => 'yes',
1006 ],
1007 ]
1008 );
1009 $this->add_responsive_control(
1010 'btn_icon_offset',
1011 [
1012 'label' => esc_html__( 'Icon Offset (Vertical)', 'easy-elements' ),
1013 'type' => \Elementor\Controls_Manager::SLIDER,
1014 'size_units' => [ 'px' ],
1015 'range' => [
1016 'px' => [
1017 'min' => -50,
1018 'max' => 100,
1019 ],
1020 ],
1021 'selectors' => [
1022 '{{WRAPPER}} .eel--read-more-icon.after, {{WRAPPER}} .eel--read-more svg' => 'top: {{SIZE}}{{UNIT}};',
1023 ],
1024 'condition' => [
1025 'show_read_more' => 'yes',
1026 ],
1027 ]
1028 );
1029
1030 $this->add_responsive_control(
1031 'btn_icon_offset_ho',
1032 [
1033 'label' => esc_html__( 'Icon Offset (Horizontal)', 'easy-elements' ),
1034 'type' => \Elementor\Controls_Manager::SLIDER,
1035 'size_units' => [ 'px' ],
1036 'range' => [
1037 'px' => [
1038 'min' => -50,
1039 'max' => 100,
1040 ],
1041 ],
1042 'selectors' => [
1043 '{{WRAPPER}} .eel--read-more-icon.after, {{WRAPPER}} .eel--read-more svg' => 'left: {{SIZE}}{{UNIT}};',
1044 ],
1045 'condition' => [
1046 'show_read_more' => 'yes',
1047 ],
1048 ]
1049 );
1050
1051 $this->end_controls_section();
1052
1053 $this->start_controls_section(
1054 '_section_button_icon',
1055 [
1056 'label' => esc_html__( 'Only Icon Button Settings', 'easy-elements' ),
1057 'tab' => Controls_Manager::TAB_CONTENT,
1058 ]
1059 );
1060
1061 $this->add_control(
1062 'only_icon_show',
1063 [
1064 'label' => esc_html__( 'Show Icon', 'easy-elements' ),
1065 'type' => \Elementor\Controls_Manager::SWITCHER,
1066 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
1067 'label_off' => esc_html__( 'No', 'easy-elements' ),
1068 'return_value' => 'yes',
1069 'default' => '',
1070 ]
1071 );
1072
1073 $this->add_control(
1074 'only_icon',
1075 [
1076 'label' => esc_html__( 'Icon', 'easy-elements' ),
1077 'type' => \Elementor\Controls_Manager::ICONS,
1078 'default' => [
1079 'value' => '',
1080 'library' => 'fa-solid',
1081 ],
1082 ]
1083 );
1084
1085 $this->start_controls_tabs( 'button_style_tabs' );
1086
1087 $this->start_controls_tab(
1088 'icon_btn_style_normal',
1089 [
1090 'label' => __( 'Normal', 'easy-elements' ),
1091 ]
1092 );
1093
1094 $this->add_control(
1095 'icon_color',
1096 [
1097 'label' => __( 'Color', 'easy-elements' ),
1098 'type' => \Elementor\Controls_Manager::COLOR,
1099 'selectors' => [
1100 '{{WRAPPER}} .eel--button-icon svg, {{WRAPPER}} .eel--button-icon i' => 'color: {{VALUE}}; fill: {{VALUE}};',
1101 ],
1102 ]
1103 );
1104
1105 $this->add_group_control(
1106 \Elementor\Group_Control_Background::get_type(),
1107 [
1108 'name' => 'eel_iocn_background',
1109 'label' => __( 'Button Background', 'easy-elements' ),
1110 'types' => [ 'classic', 'gradient' ],
1111 'selector' => '{{WRAPPER}} .eel--button-icon',
1112 ]
1113 );
1114
1115 $this->add_group_control(
1116 \Elementor\Group_Control_Border::get_type(),
1117 [
1118 'name' => 'icon_btn_border',
1119 'label' => __( 'Button Border', 'easy-elements' ),
1120 'selector' => '{{WRAPPER}} .eel--button-icon',
1121 ]
1122 );
1123
1124 $this->add_control(
1125 'icon_border_radius',
1126 [
1127 'label' => __( 'Border Radius', 'easy-elements' ),
1128 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1129 'size_units' => [ 'px', '%' ],
1130 'selectors' => [
1131 '{{WRAPPER}} .eel--button-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1132 ],
1133 ]
1134 );
1135
1136 $this->end_controls_tab();
1137
1138 $this->start_controls_tab(
1139 'icon_btn_style_hover',
1140 [
1141 'label' => __( 'Hover', 'easy-elements' ),
1142 ]
1143 );
1144
1145 $this->add_control(
1146 'icon_color_hover',
1147 [
1148 'label' => __( 'Color', 'easy-elements' ),
1149 'type' => \Elementor\Controls_Manager::COLOR,
1150 'selectors' => [
1151 '{{WRAPPER}} .eel--button-icon:hover svg, {{WRAPPER}} .eel--button-icon:hover i' => 'color: {{VALUE}}; fill: {{VALUE}};',
1152 ],
1153 ]
1154 );
1155
1156 $this->add_group_control(
1157 \Elementor\Group_Control_Background::get_type(),
1158 [
1159 'name' => 'eel_iocn_background_hover',
1160 'label' => __( 'Button Background', 'easy-elements' ),
1161 'types' => [ 'classic', 'gradient' ],
1162 'selector' => '{{WRAPPER}} .eel--button-icon:hover',
1163 ]
1164 );
1165
1166 $this->end_controls_tab();
1167 $this->end_controls_tabs();
1168 $this->end_controls_section();
1169
1170 $this->start_controls_section(
1171 'section_transparent_settings',
1172 [
1173 'label' => __( 'Transparent Layout', 'easy-elements' ),
1174 'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
1175 ]
1176 );
1177
1178 $this->add_control(
1179 'style_transparent',
1180 [
1181 'label' => esc_html__( 'Blog Transparent', 'easy-elements' ),
1182 'type' => Controls_Manager::SWITCHER,
1183 'label_on' => esc_html__( 'Show', 'easy-elements' ),
1184 'label_off' => esc_html__( 'Hide', 'easy-elements' ),
1185 'return_value' => 'yes',
1186 'default' => '',
1187 ]
1188 );
1189
1190 $this->add_control(
1191 'transparent_overlay_heading',[
1192 'label' => esc_html__( 'Overlay Background', 'easy-elements' ),
1193 'type' => \Elementor\Controls_Manager::HEADING,
1194 'condition' => [
1195 'style_transparent' => 'yes',
1196 ],
1197 ]
1198 );
1199
1200 $this->add_group_control(
1201 \Elementor\Group_Control_Background::get_type(),
1202 [
1203 'name' => 'eel_transparent_background',
1204 'label' => __( 'Overlay Background', 'easy-elements' ),
1205 'types' => [ 'classic', 'gradient' ],
1206 'selector' => '{{WRAPPER}} .eel--transparent-post .eel--overlay-all',
1207 'condition' => [
1208 'style_transparent' => 'yes',
1209 ],
1210 ]
1211 );
1212
1213 $this->add_responsive_control(
1214 'eel_overlay_height',
1215 [
1216 'label' => __( 'Overlay Height', 'easy-elements' ),
1217 'type' => \Elementor\Controls_Manager::SLIDER,
1218 'size_units' => [ 'px', '%', 'vh' ],
1219 'range' => [
1220 'px' => [
1221 'min' => 0,
1222 'max' => 1000,
1223 'step' => 1,
1224 ],
1225 '%' => [
1226 'min' => 0,
1227 'max' => 100,
1228 ],
1229 ],
1230 'selectors' => [
1231 '{{WRAPPER}} .eel--transparent-post .eel--overlay-all' => 'height: {{SIZE}}{{UNIT}};',
1232 ],
1233 'condition' => [
1234 'style_transparent' => 'yes',
1235 ],
1236 ]
1237 );
1238
1239 $this->end_controls_section();
1240
1241
1242 $this->start_controls_section(
1243 'section_pagination_settings',
1244 [
1245 'label' => __( 'Pagination', 'easy-elements' ),
1246 'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
1247 ]
1248 );
1249
1250 $this->add_control(
1251 'show_pagination',
1252 [
1253 'label' => esc_html__( 'Show Pagination', 'easy-elements' ),
1254 'type' => Controls_Manager::SWITCHER,
1255 'label_on' => esc_html__( 'Show', 'easy-elements' ),
1256 'label_off' => esc_html__( 'Hide', 'easy-elements' ),
1257 'return_value' => 'yes',
1258 'default' => 'yes',
1259 ]
1260 );
1261
1262 $this->start_controls_tabs( 'pagination__tabs' );
1263
1264 $this->start_controls_tab(
1265 'pagination__normal',
1266 [
1267 'label' => __( 'Normal', 'easy-elements' ),
1268 ]
1269 );
1270
1271 $this->add_control(
1272 'pagination_color',
1273 [
1274 'label' => esc_html__( 'Color', 'easy-elements' ),
1275 'type' => \Elementor\Controls_Manager::COLOR,
1276 'selectors' => [
1277 '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span' => 'color: {{VALUE}};',
1278 ],
1279 ]
1280 );
1281
1282 $this->add_group_control(
1283 \Elementor\Group_Control_Background::get_type(),
1284 [
1285 'name' => 'pagination_background',
1286 'types' => [ 'classic', 'gradient' ],
1287 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span',
1288 ]
1289 );
1290
1291 $this->add_group_control(
1292 \Elementor\Group_Control_Typography::get_type(),
1293 [
1294 'name' => 'pagination_typography',
1295 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span',
1296 ]
1297 );
1298
1299 $this->add_group_control(
1300 \Elementor\Group_Control_Border::get_type(),
1301 [
1302 'name' => 'pagination_border',
1303 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li a',
1304 ]
1305 );
1306
1307 $this->add_responsive_control(
1308 'pagination_border_radius',
1309 [
1310 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
1311 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1312 'size_units' => [ 'px', '%' ],
1313 'selectors' => [
1314 '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1315 ],
1316 ]
1317 );
1318
1319 $this->add_responsive_control(
1320 'pagination_width',
1321 [
1322 'label' => esc_html__( 'Width', 'easy-elements' ),
1323 'type' => \Elementor\Controls_Manager::SLIDER,
1324 'size_units' => [ 'px' ],
1325 'range' => [
1326 'px' => [
1327 'min' => 40,
1328 'max' => 100,
1329 ],
1330 ],
1331 'selectors' => [
1332 '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
1333 ],
1334 'condition' => [
1335 'show_pagination' => 'yes',
1336 ],
1337 ]
1338 );
1339
1340 $this->add_group_control(
1341 \Elementor\Group_Control_Box_Shadow::get_type(),
1342 [
1343 'name' => 'pagination_box_shadow',
1344 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li a, {{WRAPPER}} .eel-blog-pagination ul li span',
1345 ]
1346 );
1347
1348 $this->add_control(
1349 'pagination_alignment',
1350 [
1351 'label' => __( 'Alignment', 'easy-elements' ),
1352 'type' => \Elementor\Controls_Manager::CHOOSE,
1353 'options' => [
1354 'left' => [
1355 'title' => __( 'Left', 'easy-elements' ),
1356 'icon' => 'eicon-text-align-left',
1357 ],
1358 'center' => [
1359 'title' => __( 'Center', 'easy-elements' ),
1360 'icon' => 'eicon-text-align-center',
1361 ],
1362 'right' => [
1363 'title' => __( 'Right', 'easy-elements' ),
1364 'icon' => 'eicon-text-align-right',
1365 ],
1366 ],
1367 'default' => 'center',
1368 'toggle' => true,
1369 'selectors' => [
1370 '{{WRAPPER}} .eel-blog-pagination' => 'text-align: {{VALUE}};',
1371 ],
1372 ]
1373 );
1374
1375 $this->end_controls_tab();
1376
1377 $this->start_controls_tab(
1378 'pagination__hover',
1379 [
1380 'label' => __( 'Hover', 'easy-elements' ),
1381 ]
1382 );
1383
1384 $this->add_control(
1385 'pagination_color_current',
1386 [
1387 'label' => esc_html__( 'Color', 'easy-elements' ),
1388 'type' => \Elementor\Controls_Manager::COLOR,
1389 'selectors' => [
1390 '{{WRAPPER}} .eel-blog-pagination ul li a:hover, {{WRAPPER}} .eel-blog-pagination ul li span.current' => 'color: {{VALUE}};',
1391 ],
1392 ]
1393 );
1394
1395 $this->add_group_control(
1396 \Elementor\Group_Control_Background::get_type(),
1397 [
1398 'name' => 'pagination_background_current',
1399 'types' => [ 'classic', 'gradient' ],
1400 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li span.current, {{WRAPPER}} .eel-blog-pagination ul li a:hover',
1401 ]
1402 );
1403
1404 $this->add_group_control(
1405 \Elementor\Group_Control_Border::get_type(),
1406 [
1407 'name' => 'pagination_border_hover',
1408 'selector' => '{{WRAPPER}} .eel-blog-pagination ul li span.current, {{WRAPPER}} .eel-blog-pagination ul li a:hover',
1409 ]
1410 );
1411
1412 $this->end_controls_tab();
1413 $this->end_controls_tabs();
1414 $this->end_controls_section();
1415
1416
1417 $this->start_controls_section(
1418 'section_item_style',
1419 [
1420 'label' => __( 'Items', 'easy-elements' ),
1421 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
1422 ]
1423 );
1424
1425 $this->add_group_control(
1426 \Elementor\Group_Control_Background::get_type(),
1427 [
1428 'name' => 'item_background',
1429 'label' => __( 'Item Background', 'easy-elements' ),
1430 'types' => [ 'classic', 'gradient' ],
1431 'selector' => '{{WRAPPER}} .eel-post-grid-wrap .grid-item-inner',
1432 ]
1433 );
1434
1435 $this->add_responsive_control(
1436 'item_padding',
1437 [
1438 'label' => __( 'Padding', 'easy-elements' ),
1439 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1440 'size_units' => [ 'px', 'em', '%' ],
1441 'selectors' => [
1442 '{{WRAPPER}} .eel-post-grid-wrap .grid-item-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1443 ],
1444 ]
1445 );
1446
1447 $this->add_responsive_control(
1448 'item_border_radius',
1449 [
1450 'label' => __( 'Border Radius', 'easy-elements' ),
1451 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1452 'size_units' => [ 'px', '%' ],
1453 'selectors' => [
1454 '{{WRAPPER}} .eel-post-grid-wrap .grid-item-inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1455 ],
1456 ]
1457 );
1458
1459 $this->add_group_control(
1460 \Elementor\Group_Control_Border::get_type(),
1461 [
1462 'name' => 'item_border',
1463 'selector' => '{{WRAPPER}} .eel-post-grid-wrap .grid-item-inner',
1464 ]
1465 );
1466
1467 $this->end_controls_section();
1468
1469 $this->start_controls_section(
1470 'section_conten_style',
1471 [
1472 'label' => __( 'Content Part', 'easy-elements' ),
1473 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
1474 ]
1475 );
1476
1477 $this->add_group_control(
1478 \Elementor\Group_Control_Background::get_type(),
1479 [
1480 'name' => 'content_background',
1481 'label' => __( 'Item Background', 'easy-elements' ),
1482 'types' => [ 'classic', 'gradient' ],
1483 'selector' => '{{WRAPPER}} .ee--blog-content-wrap',
1484 ]
1485 );
1486
1487 $this->add_responsive_control(
1488 'content_padding',
1489 [
1490 'label' => __( 'Padding', 'easy-elements' ),
1491 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1492 'size_units' => [ 'px', 'em', '%' ],
1493 'selectors' => [
1494 '{{WRAPPER}} .ee--blog-content-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1495 ],
1496 ]
1497 );
1498
1499 $this->add_responsive_control(
1500 'content_border_radius',
1501 [
1502 'label' => __( 'Border Radius', 'easy-elements' ),
1503 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1504 'size_units' => [ 'px', '%' ],
1505 'selectors' => [
1506 '{{WRAPPER}} .ee--blog-content-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1507 ],
1508 ]
1509 );
1510
1511 $this->end_controls_section();
1512
1513 $this->start_controls_section(
1514 'section_title_style',
1515 [
1516 'label' => __( 'Title', 'easy-elements' ),
1517 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
1518 ]
1519 );
1520
1521 // Typography
1522 $this->add_group_control(
1523 \Elementor\Group_Control_Typography::get_type(),
1524 [
1525 'name' => 'title_typography',
1526 'selector' => '{{WRAPPER}} .ee--blog-title',
1527 ]
1528 );
1529
1530 // Tabs for Normal and Hover state
1531 $this->start_controls_tabs( 'title_color_tabs' );
1532
1533 // Normal
1534 $this->start_controls_tab(
1535 'title_color_normal',
1536 [
1537 'label' => esc_html__( 'Normal', 'easy-elements' ),
1538 ]
1539 );
1540 $this->add_control(
1541 'title_color',
1542 [
1543 'label' => esc_html__( 'Color', 'easy-elements' ),
1544 'type' => \Elementor\Controls_Manager::COLOR,
1545 'selectors' => [
1546 '{{WRAPPER}} .ee--blog-title' => 'color: {{VALUE}};',
1547 ],
1548 ]
1549 );
1550
1551 $this->add_group_control(
1552 \Elementor\Group_Control_Border::get_type(),
1553 [
1554 'name' => 'title_border',
1555 'selector' => '{{WRAPPER}} .ee--blog-title',
1556 ]
1557 );
1558
1559 $this->add_responsive_control(
1560 'title_margin',
1561 [
1562 'label' => __( 'Margin', 'easy-elements' ),
1563 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1564 'size_units' => [ 'px', 'em', '%' ],
1565 'selectors' => [
1566 '{{WRAPPER}} .ee--blog-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1567 ],
1568 ]
1569 );
1570
1571 $this->add_responsive_control(
1572 'title_padding',
1573 [
1574 'label' => __( 'Padding', 'easy-elements' ),
1575 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1576 'size_units' => [ 'px', 'em', '%' ],
1577 'selectors' => [
1578 '{{WRAPPER}} .ee--blog-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1579 ],
1580 ]
1581 );
1582
1583 $this->end_controls_tab();
1584
1585 // Hover
1586 $this->start_controls_tab(
1587 'title_color_hover',
1588 [
1589 'label' => esc_html__( 'Hover', 'easy-elements' ),
1590 ]
1591 );
1592 $this->add_control(
1593 'title_hover_color',
1594 [
1595 'label' => esc_html__( 'Hover Color', 'easy-elements' ),
1596 'type' => \Elementor\Controls_Manager::COLOR,
1597 'selectors' => [
1598 '{{WRAPPER}} .ee--blog-title:hover a' => 'color: {{VALUE}};',
1599 ],
1600 ]
1601 );
1602 $this->end_controls_tab();
1603
1604 $this->end_controls_tabs();
1605
1606 $this->end_controls_section();
1607
1608
1609 $this->start_controls_section(
1610 'section_excerpt_style',
1611 [
1612 'label' => __( 'Excerpt', 'easy-elements' ),
1613 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
1614 ]
1615 );
1616
1617 $this->add_control(
1618 'excerpt_color',
1619 [
1620 'label' => esc_html__( 'Color', 'easy-elements' ),
1621 'type' => \Elementor\Controls_Manager::COLOR,
1622 'selectors' => [
1623 '{{WRAPPER}} .eel--blog-excerpt' => 'color: {{VALUE}};',
1624 ],
1625 ]
1626 );
1627
1628 $this->add_group_control(
1629 \Elementor\Group_Control_Typography::get_type(),
1630 [
1631 'name' => 'excerpt_typography',
1632 'selector' => '{{WRAPPER}} .eel--blog-excerpt',
1633 ]
1634 );
1635
1636 $this->add_responsive_control(
1637 'excerpt_margin',
1638 [
1639 'label' => __( 'Margin', 'easy-elements' ),
1640 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1641 'size_units' => [ 'px', 'em', '%' ],
1642 'selectors' => [
1643 '{{WRAPPER}} .eel--blog-excerpt' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1644 ],
1645 ]
1646 );
1647
1648
1649 $this->end_controls_section();
1650
1651
1652 $this->start_controls_section(
1653 'section_meta_style',
1654 [
1655 'label' => __( 'Meta', 'easy-elements' ),
1656 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
1657 ]
1658 );
1659
1660 $this->add_control(
1661 'meta_text_color',
1662 [
1663 'label' => __( 'Color', 'easy-elements' ),
1664 'type' => \Elementor\Controls_Manager::COLOR,
1665 'selectors' => [
1666 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li, {{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li *' => 'color: {{VALUE}};',
1667 ],
1668 ]
1669 );
1670
1671 $this->add_group_control(
1672 \Elementor\Group_Control_Background::get_type(),
1673 [
1674 'name' => 'eel_meta_background',
1675 'label' => __( 'Button Background', 'easy-elements' ),
1676 'types' => [ 'classic', 'gradient' ],
1677 'selector' => '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li',
1678 ]
1679 );
1680
1681 $this->add_group_control(
1682 \Elementor\Group_Control_Typography::get_type(),
1683 [
1684 'name' => 'meta_typography',
1685 'label' => __( 'Typography', 'easy-elements' ),
1686 'selector' => '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li',
1687 ]
1688 );
1689
1690 $this->add_responsive_control(
1691 'meta_padding',
1692 [
1693 'label' => esc_html__( 'Padding', 'easy-elements' ),
1694 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1695 'size_units' => [ 'px', '%' ],
1696 'selectors' => [
1697 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1698 ],
1699 ]
1700 );
1701
1702 $this->add_responsive_control(
1703 'meta_border_radius',
1704 [
1705 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
1706 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1707 'size_units' => [ 'px', '%' ],
1708 'selectors' => [
1709 '{{WRAPPER}} .eel-post-grid-wrap .eel--blog-meta li' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1710 ],
1711 ]
1712 );
1713
1714 $this->end_controls_section();
1715
1716 $this->start_controls_section(
1717 'date_badge_style',
1718 [
1719 'label' => __( 'Date Badge', 'easy-elements' ),
1720 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
1721 'condition' => [
1722 'show_date_on_top' => 'yes',
1723 ],
1724 ]
1725 );
1726
1727 $this->add_control(
1728 'date_text_color_badge',
1729 [
1730 'label' => __( 'Color', 'easy-elements' ),
1731 'type' => \Elementor\Controls_Manager::COLOR,
1732 'selectors' => [
1733 '{{WRAPPER}} .eel--blog-date-top, {{WRAPPER}} .eel--blog-date-top h4' => 'color: {{VALUE}};',
1734 ],
1735 ]
1736 );
1737
1738 $this->add_group_control(
1739 \Elementor\Group_Control_Background::get_type(),
1740 [
1741 'name' => 'eel_date_background_badge',
1742 'label' => __( 'Button Background', 'easy-elements' ),
1743 'types' => [ 'classic', 'gradient' ],
1744 'selector' => '{{WRAPPER}} .eel--blog-date-top',
1745 ]
1746 );
1747
1748 $this->add_group_control(
1749 \Elementor\Group_Control_Typography::get_type(),
1750 [
1751 'name' => 'date_typography_badge_top',
1752 'label' => __( 'Typography', 'easy-elements' ),
1753 'selector' => '{{WRAPPER}} .eel--blog-date-top h4',
1754 ]
1755 );
1756
1757 $this->add_group_control(
1758 \Elementor\Group_Control_Typography::get_type(),
1759 [
1760 'name' => 'date_typography_badge_btm',
1761 'label' => __( 'Typography', 'easy-elements' ),
1762 'selector' => '{{WRAPPER}} .eel--blog-date-top',
1763 ]
1764 );
1765
1766 $this->add_responsive_control(
1767 'date_border_radius_badge',
1768 [
1769 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
1770 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1771 'size_units' => [ 'px', '%' ],
1772 'selectors' => [
1773 '{{WRAPPER}} .eel--blog-date-top' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1774 ],
1775 ]
1776 );
1777
1778 $this->add_responsive_control(
1779 'show_date_on_top_position_horizontal',
1780 [
1781 'label' => esc_html__('Offset Horizontal', 'easy-elements'),
1782 'type' => \Elementor\Controls_Manager::SLIDER,
1783 'size_units' => [ 'px', '%' ],
1784 'range' => [
1785 'px' => [ 'min' => -400, 'max' => 400, 'step' => 1 ],
1786 '%' => [ 'min' => -100, 'max' => 100 ],
1787 ],
1788 'selectors' => [
1789 '{{WRAPPER}} .eel--blog-date-top' => 'right: {{SIZE}}{{UNIT}};',
1790 ],
1791 ]
1792 );
1793
1794 $this->add_responsive_control(
1795 'show_date_on_top_position_vartical',
1796 [
1797 'label' => esc_html__('Offset Vertical', 'easy-elements'),
1798 'type' => \Elementor\Controls_Manager::SLIDER,
1799 'size_units' => [ 'px', '%' ],
1800 'range' => [
1801 'px' => [ 'min' => -400, 'max' => 400, 'step' => 1 ],
1802 '%' => [ 'min' => -100, 'max' => 100 ],
1803 ],
1804 'selectors' => [
1805 '{{WRAPPER}} .eel--blog-date-top' => 'top: {{SIZE}}{{UNIT}};',
1806 ],
1807 ]
1808 );
1809
1810 $this->add_control(
1811 'eel_enable_blur_switcher',
1812 [
1813 'label' => __( 'Enable Blur', 'easy-elements' ),
1814 'type' => \Elementor\Controls_Manager::SWITCHER,
1815 'label_on' => __( 'Yes', 'easy-elements' ),
1816 'label_off' => __( 'No', 'easy-elements' ),
1817 'return_value' => 'yes',
1818 'default' => 'no',
1819 ]
1820 );
1821
1822 $this->add_control(
1823 'eel_blur_badge',
1824 [
1825 'label' => __( 'Blur', 'easy-elements' ),
1826 'type' => \Elementor\Controls_Manager::SLIDER,
1827 'size_units' => [ 'px', '%' ],
1828 'range' => [
1829 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1 ],
1830 '%' => [ 'min' => 0, 'max' => 100 ],
1831 ],
1832 'condition' => [
1833 'eel_enable_blur_switcher' => 'yes',
1834 ],
1835 'selectors' => [
1836 '{{WRAPPER}} .eel--blog-date-top' => 'backdrop-filter: blur({{SIZE}}{{UNIT}});',
1837 ],
1838 ]
1839 );
1840
1841 $this->end_controls_section();
1842 }
1843
1844 protected function render_blog_meta( $settings ) {
1845 if ( empty( $settings['show_meta'] ) || ! is_array( $settings['show_meta'] ) ) {
1846 return;
1847 }
1848
1849 $show_meta = $settings['show_meta'];
1850 $eel_separator = ! empty( $settings['eel_separator'] ) ? 'eel--separator--' . esc_attr( $settings['eel_separator'] ) : '';
1851 ?>
1852 <ul class="eel--blog-meta <?php echo esc_attr($eel_separator); ?>">
1853 <?php if ( in_array( 'date', $show_meta ) ) : ?>
1854 <li class="eel--blog-date">
1855 <?php
1856 if ( ! empty($settings['show_date_icon']) && $settings['show_date_icon'] === 'yes' ) {
1857 if ( empty( $settings['date_icon']['value'] ) ) {
1858 echo '<i class="unicon-calendar"></i>';
1859 } else {
1860 \Elementor\Icons_Manager::render_icon( $settings['date_icon'], [ 'aria-hidden' => 'true' ] );
1861 }
1862 }
1863 echo esc_html( get_the_date() );
1864 ?>
1865 </li>
1866 <?php endif; ?>
1867
1868 <?php if ( in_array( 'author', $show_meta ) ) : ?>
1869 <li class="eel--blog-author">
1870 <?php
1871 if ( ! empty($settings['show_author_icon']) && $settings['show_author_icon'] === 'yes' ) {
1872 if ( empty( $settings['author_icon']['value'] ) ) {
1873 echo '<i class="unicon-user"></i>';
1874 } else {
1875 \Elementor\Icons_Manager::render_icon( $settings['author_icon'], [ 'aria-hidden' => 'true' ] );
1876 }
1877 }
1878
1879 if ( ! empty($settings['show_by_label']) && $settings['show_by_label'] === 'yes' ) {
1880 echo '<em class="eel--meta-by">' . esc_html__( 'By', 'easy-elements' ) . '</em> ';
1881 }
1882
1883 $author_id = get_the_author_meta( 'ID' );
1884 $author_name = get_the_author();
1885 $author_url = get_author_posts_url( $author_id );
1886
1887 if ( ! empty($settings['author_link_enable']) && $settings['author_link_enable'] === 'yes' ) {
1888 echo '<a class="eel--meta-author" href="' . esc_url( $author_url ) . '">' . esc_html( $author_name ) . '</a>';
1889 } else {
1890 echo '<span class="eel--meta-author">' . esc_html( $author_name ) . '</span>';
1891 }
1892 ?>
1893 </li>
1894 <?php endif; ?>
1895
1896 <?php if ( in_array( 'category', $show_meta ) ) : ?>
1897 <li class="eel--blog-cat">
1898 <?php
1899 if ( ! empty($settings['show_category_icon']) && $settings['show_category_icon'] === 'yes' ) {
1900 if ( empty( $settings['category_icon']['value'] ) ) {
1901 echo '<i class="unicon-folder"></i>';
1902 } else {
1903 \Elementor\Icons_Manager::render_icon( $settings['category_icon'], [ 'aria-hidden' => 'true' ] );
1904 }
1905 }
1906 the_category( ', ' );
1907 ?>
1908 </li>
1909 <?php endif; ?>
1910
1911 <?php if ( in_array( 'comments', $show_meta ) ) : ?>
1912 <li class="eel--blog-comments">
1913 <?php
1914 if ( ! empty($settings['show_comments_icon']) && $settings['show_comments_icon'] === 'yes' ) {
1915 if ( empty( $settings['comments_icon']['value'] ) ) {
1916 echo '<i class="unicon-forum"></i>';
1917 } else {
1918 \Elementor\Icons_Manager::render_icon( $settings['comments_icon'], [ 'aria-hidden' => 'true' ] );
1919 }
1920 }
1921 $comments_number = get_comments_number();
1922 echo '<a href="' . esc_url( get_comments_link() ) . '">' . esc_html( $comments_number ) . ' ' . esc_html( _n( 'Comment', 'Comments', $comments_number, 'easy-elements' ) ) . '</a>';
1923 ?>
1924 </li>
1925 <?php endif; ?>
1926 <?php if ( in_array( 'read_time', $show_meta ) ) : ?>
1927 <li class="eel--blog-read-time">
1928 <?php
1929 if ( ! empty($settings['show_read_time_icon']) && $settings['show_read_time_icon'] === 'yes' ) {
1930 if ( empty( $settings['read_time_icon']['value'] ) ) {
1931 echo '<i class="unicon-time"></i>';
1932 } else {
1933 \Elementor\Icons_Manager::render_icon( $settings['read_time_icon'], [ 'aria-hidden' => 'true' ] );
1934 }
1935 }
1936 $word_count = str_word_count( wp_strip_all_tags( get_the_content() ) );
1937 $reading_time = ceil( $word_count / 80 );
1938 echo esc_html( $reading_time ) . ' ' . esc_html__( 'min read', 'easy-elements' );
1939 ?>
1940 </li>
1941 <?php endif; ?>
1942 </ul>
1943 <?php
1944 }
1945
1946 protected function render() {
1947 $settings = $this->get_settings_for_display();
1948 $post_type = $settings['post_type']?? '';
1949 $title_tag = $settings['title_tag'];
1950 $posts_per_page = $settings['posts_per_page'];
1951 $orderby = $settings['orderby'];
1952 $order = $settings['order'];
1953 $thumbnail_size = $settings['thumbnail_size'];
1954 $thumb_anim = ($settings['thumb_animation'] ?? 'yes') === 'yes' ? 'eel--animate' : '';
1955 $anim_style = ($settings['eel_animation_style'] ?? 'left_right') === 'left_right' ? 'left_right' : 'top_bottom';
1956 $title_trim = $settings['title_trim'] ?? '';
1957 $date_options = ($settings['show_date_on_top'] === 'yes') ? 'd-block' : '';
1958 $excerpt_trim = $settings['excerpt_trim'];
1959 $post_type = !empty( $settings['post_type'] ) ? $settings['post_type'] : 'post';
1960 $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
1961
1962 $args = [
1963 'post_type' => $post_type,
1964 'posts_per_page' => $settings['posts_per_page'],
1965 'paged' => $paged,
1966 'orderby' => 'date',
1967 'order' => 'DESC',
1968 ];
1969
1970 // Include based on source type
1971 if ( $settings['source_type'] === 'category' && ! empty( $settings['categories'] ) ) {
1972 $args['category__in'] = $settings['categories'];
1973 } elseif ( $settings['source_type'] === 'post' && ! empty( $settings['post__in'] ) ) {
1974 $args['post__in'] = $settings['post__in'];
1975 $args['orderby'] = 'post__in'; // Preserve selected order
1976 }
1977
1978
1979
1980 $query = new \WP_Query( $args );
1981
1982 if ( ! empty( $settings['exclude_posts'] ) && $query->have_posts() ) {
1983 $exclude_ids = (array) $settings['exclude_posts'];
1984
1985 $query->posts = array_filter( $query->posts, function( $post ) use ( $exclude_ids ) {
1986 return ! in_array( $post->ID, $exclude_ids, true );
1987 });
1988
1989 // Update post_count after filtering
1990 $query->post_count = count( $query->posts );
1991 }
1992
1993 if ( $query->have_posts() ) :
1994 echo '<div class="eel-post-grid-wrap">';
1995 while ( $query->have_posts() ) : $query->the_post();
1996 $trimmed_title = wp_trim_words( get_the_title(), $title_trim ?: 100, '...' );
1997 $trimmed_excerpt = wp_trim_words( get_the_excerpt(), $excerpt_trim ?: 20, '...' );
1998 $style_transparent = ($settings['style_transparent'] === 'yes') ? 'eel--transparent-post' : '' ;
1999 ?>
2000 <div class="grid-item">
2001 <div class="grid-item-inner <?php echo esc_attr( $style_transparent ); ?>">
2002 <?php if ( 'yes' === $settings['show_thumbnail'] ) { ?>
2003 <div class="eel--blog-img <?php echo esc_attr( $thumb_anim ); ?> <?php echo esc_attr( $anim_style ); ?>">
2004 <a href="<?php the_permalink(); ?>">
2005 <?php
2006 if ( has_post_thumbnail() ) {
2007 the_post_thumbnail( $thumbnail_size );
2008 }
2009 ?>
2010 </a>
2011 <?php if ( 'yes' === $settings['style_transparent'] ) { ?>
2012 <div class="eel--overlay-all"></div>
2013 <?php } ?>
2014 </div>
2015 <?php } ?>
2016
2017 <div class="ee--blog-content-wrap">
2018 <div class="ee--blog-content eel-content--<?php echo esc_attr( $style_transparent ); ?>">
2019 <?php if ( 'up_title' === $settings['meta_position'] ) : ?>
2020 <?php $this->render_blog_meta( $settings ); ?>
2021 <?php endif; ?>
2022 <<?php echo esc_attr( $title_tag ); ?> class="ee--blog-title">
2023 <a href="<?php the_permalink(); ?>"><?php echo esc_html( $trimmed_title ); ?></a>
2024 </<?php echo esc_attr( $title_tag ); ?>>
2025
2026 <?php if ( 'below_title' === $settings['meta_position'] ) : ?>
2027 <?php $this->render_blog_meta( $settings ); ?>
2028 <?php endif; ?>
2029 <?php if ( $settings['show_excerpt'] === 'yes' ) : ?>
2030 <div class="eel--blog-excerpt">
2031 <?php echo esc_html( $trimmed_excerpt ); ?>
2032 </div>
2033 <?php endif; ?>
2034 <?php if ( 'below_content' === $settings['meta_position'] ) : ?>
2035 <?php $this->render_blog_meta( $settings ); ?>
2036 <?php endif; ?>
2037 </div>
2038
2039 <?php if ( ! empty( $settings['read_more_text'] ) ) : ?>
2040 <div class="eel--read-more eel-read-more--<?php echo esc_attr( $style_transparent ); ?>">
2041 <a href="<?php the_permalink(); ?>" class="eel--read-more-link">
2042 <?php
2043 if ( isset( $settings['read_more_icon'] ) && ! empty( $settings['read_more_icon']['value'] ) && $settings['read_more_icon_position'] === 'before' ) {
2044 \Elementor\Icons_Manager::render_icon( $settings['read_more_icon'], [
2045 'aria-hidden' => 'true',
2046 'class' => 'eel--read-more-icon before'
2047 ] );
2048 } elseif ( $settings['read_more_icon_position'] === 'before' ) {
2049 echo '<i class="unicon-chevron-right eel--read-more-icon before"></i>';
2050 }
2051 ?>
2052
2053 <?php echo esc_html( $settings['read_more_text'] ); ?>
2054
2055 <?php
2056 if ( isset( $settings['read_more_icon'] ) && ! empty( $settings['read_more_icon']['value'] ) && $settings['read_more_icon_position'] === 'after' ) {
2057 \Elementor\Icons_Manager::render_icon( $settings['read_more_icon'], [
2058 'aria-hidden' => 'true',
2059 'class' => 'eel--read-more-icon after'
2060 ] );
2061 } elseif ( $settings['read_more_icon_position'] === 'after' ) {
2062 echo '<i class="unicon-chevron-right eel--read-more-icon after"></i>';
2063 }
2064 ?>
2065 </a>
2066 </div>
2067 <?php endif;
2068 if ( 'yes' === $settings['only_icon_show'] ) { ?>
2069 <a href="<?php the_permalink(); ?>" class="eel--button-icon">
2070 <?php
2071 if ( empty( $settings['only_icon']['value'] ) ) {
2072 echo '<i class="unicon-chevron-right"></i>';
2073 } else {
2074 \Elementor\Icons_Manager::render_icon( $settings['only_icon'], [ 'aria-hidden' => 'true' ] );
2075 } ?>
2076 </a>
2077 <?php
2078 }
2079 ?>
2080 </div>
2081
2082 <?php if(!empty($date_options) && !empty($settings['show_date_on_top'])): ?>
2083 <div class="eel--blog-date-top">
2084 <h4><?php echo esc_html(get_the_time('d')); ?></h4>
2085 <span><?php echo esc_html(get_the_time('M')); ?></span>
2086 </div>
2087 <?php endif; ?>
2088 </div>
2089 </div>
2090 <?php
2091 endwhile;
2092
2093 echo '</div>';
2094 if ( $settings['show_pagination'] === 'yes' ) {
2095 $big = 999999999;
2096 $pagination = paginate_links( [
2097 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
2098 'format' => '?paged=%#%',
2099 'current' => $paged,
2100 'total' => $query->max_num_pages,
2101 'prev_text' => '&laquo;',
2102 'next_text' => '&raquo;',
2103 'type' => 'list',
2104 ] );
2105
2106 if ( $pagination ) {
2107 echo '<nav class="eel-blog-pagination">';
2108 echo wp_kses_post( $pagination );
2109 echo '</nav>';
2110 }
2111 }
2112 wp_reset_postdata();
2113 else :
2114 echo '<p>' . esc_html__( 'No posts found.', 'easy-elements' ) . '</p>';
2115 endif;
2116 }
2117 } ?>