Version Description
- Fixed issues missing Post Widget Panel
Download this release
Release Info
Developer | dudaster |
Plugin | Elementor Custom Skin |
Version | 1.3.3 |
Comparing to | |
See all releases |
Code changes from version 1.2.5 to 1.3.3
- ele-custom-skin.php +2 -1
- includes/pro-preview.php +127 -28
- readme.txt +18 -6
- skins/skin-custom.php +120 -9
ele-custom-skin.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
* Plugin Name: Ele Custom Skin
|
4 |
-
* Version: 1.
|
5 |
* Description: Elementor Custom Skin for Posts and Archive Posts. You can create a skin as you want.
|
6 |
* Plugin URI: https://dudaster.com
|
7 |
* Author: Dudaster.com
|
@@ -18,6 +18,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
18 |
define( 'ELECS_DIR', plugin_dir_path( __FILE__ ));
|
19 |
define( 'ELECS_NAME', plugin_basename( __FILE__ ));
|
20 |
define( 'ELECS_URL', plugin_dir_url( __FILE__ ));
|
|
|
21 |
|
22 |
include_once ELECS_DIR.'includes/ecs-notices.php';
|
23 |
include_once ELECS_DIR.'includes/ecs-dependencies.php';
|
1 |
<?php
|
2 |
/*
|
3 |
* Plugin Name: Ele Custom Skin
|
4 |
+
* Version: 1.3.3
|
5 |
* Description: Elementor Custom Skin for Posts and Archive Posts. You can create a skin as you want.
|
6 |
* Plugin URI: https://dudaster.com
|
7 |
* Author: Dudaster.com
|
18 |
define( 'ELECS_DIR', plugin_dir_path( __FILE__ ));
|
19 |
define( 'ELECS_NAME', plugin_basename( __FILE__ ));
|
20 |
define( 'ELECS_URL', plugin_dir_url( __FILE__ ));
|
21 |
+
define ('ELECS_VER','1.3.3');
|
22 |
|
23 |
include_once ELECS_DIR.'includes/ecs-notices.php';
|
24 |
include_once ELECS_DIR.'includes/ecs-dependencies.php';
|
includes/pro-preview.php
CHANGED
@@ -8,18 +8,20 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
8 |
|
9 |
add_action( 'ECS_after_control', function($skin){
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
'type' => \Elementor\Controls_Manager::DIVIDER,
|
15 |
-
]
|
16 |
-
);
|
17 |
-
|
18 |
-
$skin->add_control(
|
19 |
-
'alt_title',
|
20 |
[
|
21 |
-
'label' => __( 'Alternating templates', 'ele-custom-skin' ),
|
22 |
-
'type' => \Elementor\Controls_Manager::
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
]
|
24 |
);
|
25 |
|
@@ -65,24 +67,38 @@ add_action( 'ECS_after_control', function($skin){
|
|
65 |
'skin_template' => []
|
66 |
],
|
67 |
],
|
68 |
-
|
|
|
|
|
|
|
69 |
]
|
70 |
);
|
71 |
|
72 |
-
|
73 |
-
'hr5',
|
74 |
-
[
|
75 |
-
'type' => \Elementor\Controls_Manager::DIVIDER,
|
76 |
-
]
|
77 |
-
);
|
78 |
$skin->add_control(
|
79 |
'display_title',
|
80 |
[
|
81 |
'label' => __( 'Display Mode', 'ele-custom-skin' ),
|
82 |
'type' => \Elementor\Controls_Manager::HEADING,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
]
|
84 |
);
|
85 |
-
|
86 |
$skin->add_control(
|
87 |
'same_height',
|
88 |
[
|
@@ -94,19 +110,107 @@ add_action( 'ECS_after_control', function($skin){
|
|
94 |
'default' => 'auto',
|
95 |
]
|
96 |
);
|
97 |
-
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
$skin->add_control(
|
100 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
[
|
102 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
]
|
104 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
$skin->add_control(
|
106 |
'key_title',
|
107 |
[
|
108 |
'label' => __( 'Dynamic Everywhere', 'ele-custom-skin' ),
|
109 |
'type' => \Elementor\Controls_Manager::HEADING,
|
|
|
110 |
]
|
111 |
);
|
112 |
$skin->add_control(
|
@@ -130,17 +234,12 @@ add_action( 'ECS_after_control', function($skin){
|
|
130 |
]
|
131 |
);
|
132 |
|
133 |
-
$skin->add_control(
|
134 |
-
'hr6',
|
135 |
-
[
|
136 |
-
'type' => \Elementor\Controls_Manager::DIVIDER,
|
137 |
-
]
|
138 |
-
);
|
139 |
$skin->add_control(
|
140 |
'upgrade_note',
|
141 |
[
|
142 |
'label' => '<i class="fa fa-lock-open" aria-hidden="true"></i> <b>'.__( 'Unlock PRO features. ', 'ele-custom-skin' ).'</b>',
|
143 |
'type' => \Elementor\Controls_Manager::RAW_HTML,
|
|
|
144 |
'raw' => '<div style="padding-top:10px;line-height:1.6em;text-align:center;"><p>'.__( 'Get full features with <b><i>Ele Custom Skin PRO</i></b>, ', 'ele-custom-skin' ).'</p><p style="padding-top:10px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://dudaster.com/ecs-pro/" target="_blank">'.__( 'Go Pro', 'ele-custom-skin' ).'</a></p></div>',
|
145 |
'content_classes' => 'your-class',
|
146 |
]
|
8 |
|
9 |
add_action( 'ECS_after_control', function($skin){
|
10 |
|
11 |
+
|
12 |
+
$skin->add_control(
|
13 |
+
'alternating_templates',
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
[
|
15 |
+
'label' => '<i class="fa fa-lock" aria-hidden="true"></i> '.__( '<b>Alternating templates</b>', 'ele-custom-skin' ),
|
16 |
+
'type' => \Elementor\Controls_Manager::SWITCHER,
|
17 |
+
'label_off' => __( 'Hide', 'ele-custom-skin' ),
|
18 |
+
'label_on' => __( 'Show', 'ele-custom-skin' ),
|
19 |
+
'return_value' => 'yes',
|
20 |
+
'separator' => 'before',
|
21 |
+
'default' => '',
|
22 |
+
'frontend_available' => true,
|
23 |
+
'selectors' =>[' '=>' '],
|
24 |
+
|
25 |
]
|
26 |
);
|
27 |
|
67 |
'skin_template' => []
|
68 |
],
|
69 |
],
|
70 |
+
'condition' => [
|
71 |
+
$skin->get_id().'_alternating_templates' => 'yes',
|
72 |
+
],
|
73 |
+
'title_field' => '<p style="text-align:center;"><i class="fa fa-lock" aria-hidden="true"></i> '.__('Template for every ', 'ele-custom-skin').'{{{nth}}}'.__('th post', 'ele-custom-skin').'</p>',
|
74 |
]
|
75 |
);
|
76 |
|
77 |
+
|
|
|
|
|
|
|
|
|
|
|
78 |
$skin->add_control(
|
79 |
'display_title',
|
80 |
[
|
81 |
'label' => __( 'Display Mode', 'ele-custom-skin' ),
|
82 |
'type' => \Elementor\Controls_Manager::HEADING,
|
83 |
+
'separator' => 'before',
|
84 |
+
]
|
85 |
+
);
|
86 |
+
if ('2019-09-20' <= date("Y-m-d")) $skin->add_control(
|
87 |
+
'masonrys',
|
88 |
+
[
|
89 |
+
'label' => '<i class="fa fa-lock" aria-hidden="true"></i> '.__( 'Masonry', 'ele-custom-skin' ),
|
90 |
+
'type' => \Elementor\Controls_Manager::SWITCHER,
|
91 |
+
'label_off' => __( 'Off', 'ele-custom-skin' ),
|
92 |
+
'label_on' => __( 'On', 'ele-custom-skin' ),
|
93 |
+
'return_value' => 'yes',
|
94 |
+
'default' => 'no',
|
95 |
+
'frontend_available' => true,
|
96 |
+
'condition' => [
|
97 |
+
$skin->get_id().'_same_height!' => '100%',
|
98 |
+
$skin->get_id().'_post_slider!' => 'yes'
|
99 |
+
],
|
100 |
]
|
101 |
);
|
|
|
102 |
$skin->add_control(
|
103 |
'same_height',
|
104 |
[
|
110 |
'default' => 'auto',
|
111 |
]
|
112 |
);
|
|
|
113 |
|
114 |
+
|
115 |
+
|
116 |
+
/**
|
117 |
+
*
|
118 |
+
* Starting the slider part
|
119 |
+
*
|
120 |
+
**/
|
121 |
+
|
122 |
+
if ('2019-09-20' <= date("Y-m-d")) $skin->add_control(
|
123 |
+
'post_slider',
|
124 |
+
[
|
125 |
+
'label' => '<i class="fa fa-lock" aria-hidden="true"></i> '.__( 'Show in Slider', 'ele-custom-skin' ),
|
126 |
+
'type' => \Elementor\Controls_Manager::SWITCHER,
|
127 |
+
'label_off' => __( 'Off', 'ele-custom-skin' ),
|
128 |
+
'label_on' => __( 'On', 'ele-custom-skin' ),
|
129 |
+
'return_value' => 'yes',
|
130 |
+
'default' => '',
|
131 |
+
'frontend_available' => true,
|
132 |
+
'condition' => [
|
133 |
+
$skin->get_id().'_masonrys!' => 'yes',
|
134 |
+
],
|
135 |
+
]
|
136 |
+
);
|
137 |
+
|
138 |
+
|
139 |
$skin->add_control(
|
140 |
+
'slider_title',
|
141 |
+
[
|
142 |
+
'label' => __( 'Slider Options', 'ele-custom-skin' ),
|
143 |
+
'type' => \Elementor\Controls_Manager::HEADING,
|
144 |
+
'separator' => 'before',
|
145 |
+
'condition' => [
|
146 |
+
$skin->get_id().'_post_slider' => 'yes',
|
147 |
+
],
|
148 |
+
]
|
149 |
+
);
|
150 |
+
$slides_to_show = range( 1, 10 );
|
151 |
+
$slides_to_show = array_combine( $slides_to_show, $slides_to_show );
|
152 |
+
$skin->add_responsive_control(
|
153 |
+
'slides_to_show',
|
154 |
+
[
|
155 |
+
'label' => __( 'Slides to Show', 'ele-custom-skin' ),
|
156 |
+
'type' => \Elementor\Controls_Manager::SELECT,
|
157 |
+
'options' => [
|
158 |
+
'' => __( 'Default', 'ele-custom-skin' ),
|
159 |
+
] + $slides_to_show,
|
160 |
+
'condition' => [
|
161 |
+
$skin->get_id().'_post_slider' => 'yes',
|
162 |
+
],
|
163 |
+
'frontend_available' => true,
|
164 |
+
]
|
165 |
+
);
|
166 |
+
$skin->add_responsive_control(
|
167 |
+
'slides_to_scroll',
|
168 |
[
|
169 |
+
'label' => __( 'Slides to Scroll', 'ele-custom-skin' ),
|
170 |
+
'type' => \Elementor\Controls_Manager::SELECT,
|
171 |
+
'description' => __( 'Set how many slides are scrolled per swipe.', 'ele-custom-skin' ),
|
172 |
+
'options' => [
|
173 |
+
'' => __( 'Default', 'ele-custom-skin' ),
|
174 |
+
] + $slides_to_show,
|
175 |
+
'condition' => [
|
176 |
+
$skin->get_id().'_slides_to_show!' => '1',
|
177 |
+
$skin->get_id().'_post_slider' => 'yes',
|
178 |
+
],
|
179 |
+
'frontend_available' => true,
|
180 |
+
]
|
181 |
+
);
|
182 |
+
$skin->add_control(
|
183 |
+
'navigation',
|
184 |
+
[
|
185 |
+
'label' => __( 'Navigation', 'ele-custom-skin' ),
|
186 |
+
'type' => \Elementor\Controls_Manager::SELECT,
|
187 |
+
'default' => 'both',
|
188 |
+
'options' => [
|
189 |
+
'both' => __( 'Arrows and Dots', 'ele-custom-skin' ),
|
190 |
+
'arrows' => __( 'Arrows', 'ele-custom-skin' ),
|
191 |
+
'dots' => __( 'Dots', 'ele-custom-skin' ),
|
192 |
+
'none' => __( 'None', 'ele-custom-skin' ),
|
193 |
+
],
|
194 |
+
'condition' => [
|
195 |
+
$skin->get_id().'_post_slider' => 'yes',
|
196 |
+
],
|
197 |
+
'frontend_available' => true,
|
198 |
]
|
199 |
);
|
200 |
+
|
201 |
+
/*
|
202 |
+
|
203 |
+
end slider
|
204 |
+
|
205 |
+
*/
|
206 |
+
|
207 |
+
|
208 |
$skin->add_control(
|
209 |
'key_title',
|
210 |
[
|
211 |
'label' => __( 'Dynamic Everywhere', 'ele-custom-skin' ),
|
212 |
'type' => \Elementor\Controls_Manager::HEADING,
|
213 |
+
'separator' => 'before',
|
214 |
]
|
215 |
);
|
216 |
$skin->add_control(
|
234 |
]
|
235 |
);
|
236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
$skin->add_control(
|
238 |
'upgrade_note',
|
239 |
[
|
240 |
'label' => '<i class="fa fa-lock-open" aria-hidden="true"></i> <b>'.__( 'Unlock PRO features. ', 'ele-custom-skin' ).'</b>',
|
241 |
'type' => \Elementor\Controls_Manager::RAW_HTML,
|
242 |
+
'separator' => 'before',
|
243 |
'raw' => '<div style="padding-top:10px;line-height:1.6em;text-align:center;"><p>'.__( 'Get full features with <b><i>Ele Custom Skin PRO</i></b>, ', 'ele-custom-skin' ).'</p><p style="padding-top:10px;"><a class="elementor-button elementor-button-default elementor-button-go-pro" href="https://dudaster.com/ecs-pro/" target="_blank">'.__( 'Go Pro', 'ele-custom-skin' ).'</a></p></div>',
|
244 |
'content_classes' => 'your-class',
|
245 |
]
|
readme.txt
CHANGED
@@ -1,27 +1,25 @@
|
|
1 |
=== Elementor Custom Skin ===
|
2 |
Contributors: dudaster
|
3 |
-
Tags: page-builder, elementor, loop, archive list, post widget, skin, custom
|
4 |
Donate link: https://www.paypal.me/dudaster
|
5 |
Requires at least: 5.0
|
6 |
Tested up to: 5.2.3
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
-
Create new skins for Elementor PRO 2.x page builder. Design your own skins for Post and Post Archive Widgets using Elementor Loop Templates.
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
This plugin adds new skin to Elementor Page Builder Posts and Posts Archive widget.
|
16 |
|
17 |
-
You can design a loop item just like a single template and it would be used as a skin.
|
18 |
|
19 |
[youtube http://www.youtube.com/watch?v=DwLFdaZ69KU&t=94]
|
20 |
|
21 |
For a quick tutorial see Frequently Asked Questions!
|
22 |
|
23 |
-
Please let me know if a video tutorial is necessary, or if you already made one let me know so I can link to it.
|
24 |
-
|
25 |
For more details and demo check our official site https://dudaster.com/
|
26 |
|
27 |
Note: This plugin is an addon of Elementor Page Builder (https://wordpress.org/plugins/elementor/) and will only work with Elementor Page Builder installed.
|
@@ -61,6 +59,20 @@ Add to your template a Post or Post Archive widget and from Skins select Custom
|
|
61 |
|
62 |
== Changelog ==
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
= 1.2.5 =
|
65 |
* Fixing Elementor dependencies for multisite mode.
|
66 |
|
1 |
=== Elementor Custom Skin ===
|
2 |
Contributors: dudaster
|
3 |
+
Tags: page-builder, elementor, loop, archive list, post widget, skin, custom, post grid
|
4 |
Donate link: https://www.paypal.me/dudaster
|
5 |
Requires at least: 5.0
|
6 |
Tested up to: 5.2.3
|
7 |
+
Stable tag: 1.3.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
+
Create new skins for Elementor PRO 2.x page builder. Design your own skins for Post and Post Archive Widgets using Elementor Loop Templates. Free post grid for Elementor.
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
This plugin adds new skin to Elementor Page Builder Posts and Posts Archive widget.
|
16 |
|
17 |
+
You can design a loop item just like a single template and it would be used as a skin so you can be able to create a post grid the way you like.
|
18 |
|
19 |
[youtube http://www.youtube.com/watch?v=DwLFdaZ69KU&t=94]
|
20 |
|
21 |
For a quick tutorial see Frequently Asked Questions!
|
22 |
|
|
|
|
|
23 |
For more details and demo check our official site https://dudaster.com/
|
24 |
|
25 |
Note: This plugin is an addon of Elementor Page Builder (https://wordpress.org/plugins/elementor/) and will only work with Elementor Page Builder installed.
|
59 |
|
60 |
== Changelog ==
|
61 |
|
62 |
+
= 1.3.3 =
|
63 |
+
* Fixed issues missing Post Widget Panel
|
64 |
+
|
65 |
+
= 1.3.2 =
|
66 |
+
* Fixed that annoying Notice
|
67 |
+
|
68 |
+
= 1.3.1 =
|
69 |
+
* Fixed bugs
|
70 |
+
|
71 |
+
= 1.3.0 =
|
72 |
+
* Added a quick link button "Create a Loop Template".
|
73 |
+
* Tweak "No Template" default view.
|
74 |
+
* Fixed issue in Safari with template selection.
|
75 |
+
|
76 |
= 1.2.5 =
|
77 |
* Fixing Elementor dependencies for multisite mode.
|
78 |
|
skins/skin-custom.php
CHANGED
@@ -16,6 +16,7 @@ class Skin_Posts_ECS extends Skin_Base {
|
|
16 |
|
17 |
private $template_cache=[];
|
18 |
private $pid;
|
|
|
19 |
|
20 |
|
21 |
|
@@ -28,10 +29,17 @@ class Skin_Posts_ECS extends Skin_Base {
|
|
28 |
}
|
29 |
|
30 |
protected function _register_controls_actions() {
|
31 |
-
|
32 |
-
|
|
|
33 |
}
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
public function register_controls( Widget_Base $widget ) {
|
36 |
|
37 |
$this->parent = $widget;
|
@@ -40,6 +48,9 @@ class Skin_Posts_ECS extends Skin_Base {
|
|
40 |
'skin_template',
|
41 |
[
|
42 |
'label' => __( 'Select a default template', 'ele-custom-skin' ),
|
|
|
|
|
|
|
43 |
'type' => Controls_Manager::SELECT2,
|
44 |
'label_block' => true,
|
45 |
'default' => [],
|
@@ -83,8 +94,6 @@ class Skin_Posts_ECS extends Skin_Base {
|
|
83 |
$this->remove_control( 'show_excerpt' );
|
84 |
$this->remove_control( 'excerpt_length' );
|
85 |
|
86 |
-
|
87 |
-
|
88 |
}
|
89 |
|
90 |
private function get_post_id(){
|
@@ -102,7 +111,7 @@ class Skin_Posts_ECS extends Skin_Base {
|
|
102 |
$wpdb->term_relationships.object_id=$wpdb->posts.ID
|
103 |
WHERE $wpdb->posts.post_status='publish'"
|
104 |
);
|
105 |
-
$options = [ '' => '' ];
|
106 |
foreach ( $templates as $template ) {
|
107 |
$options[ $template->ID ] = $template->post_title;
|
108 |
}
|
@@ -157,8 +166,12 @@ class Skin_Posts_ECS extends Skin_Base {
|
|
157 |
}
|
158 |
|
159 |
protected function render_post_header() {
|
160 |
-
|
161 |
-
|
|
|
|
|
|
|
|
|
162 |
<?php
|
163 |
}
|
164 |
protected function render_post() {
|
@@ -173,12 +186,107 @@ class Skin_Posts_ECS extends Skin_Base {
|
|
173 |
else echo $this->get_template();
|
174 |
}
|
175 |
|
176 |
-
else
|
|
|
177 |
|
178 |
|
179 |
$this->render_post_footer();
|
180 |
|
181 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
|
183 |
}
|
184 |
|
@@ -193,6 +301,9 @@ class Skin_Archive_ECS extends Skin_Posts_ECS {
|
|
193 |
protected function _register_controls_actions() {
|
194 |
add_action( 'elementor/element/archive-posts/section_layout/before_section_end', [ $this, 'register_controls' ] );
|
195 |
add_action( 'elementor/element/archive-posts/section_layout/after_section_end', [ $this, 'register_style_sections' ] );
|
|
|
|
|
|
|
196 |
}
|
197 |
|
198 |
public function get_id() {
|
16 |
|
17 |
private $template_cache=[];
|
18 |
private $pid;
|
19 |
+
public $settings;
|
20 |
|
21 |
|
22 |
|
29 |
}
|
30 |
|
31 |
protected function _register_controls_actions() {
|
32 |
+
parent::_register_controls_actions();
|
33 |
+
add_action( 'elementor/element/posts/'.$this->get_id().'_section_design_layout/after_section_end', [ $this, 'register_navigation_design_controls' ] );
|
34 |
+
add_action( 'elementor/element/posts/section_pagination/after_section_end', [ $this, 'register_navigation_controls' ] );
|
35 |
}
|
36 |
+
public function register_navigation_controls() {
|
37 |
+
do_action( 'ECS_after_pagination_controls', $this );
|
38 |
+
}
|
39 |
+
public function register_navigation_design_controls() {
|
40 |
+
do_action( 'ECS_after_style_controls', $this );
|
41 |
+
}
|
42 |
+
|
43 |
public function register_controls( Widget_Base $widget ) {
|
44 |
|
45 |
$this->parent = $widget;
|
48 |
'skin_template',
|
49 |
[
|
50 |
'label' => __( 'Select a default template', 'ele-custom-skin' ),
|
51 |
+
'description' => '<div style="text-align:center;"><a target="_blank" style="text-align: center;font-style: normal;" href="' . esc_url( admin_url( '/edit.php?post_type=elementor_library&tabs_group=theme&elementor_library_type=loop' ) ) .
|
52 |
+
'" class="elementor-button elementor-button-default elementor-repeater-add">' .
|
53 |
+
__( 'Create/edit a Loop Template', 'ele-custom-skin' ) . '</a></div>',
|
54 |
'type' => Controls_Manager::SELECT2,
|
55 |
'label_block' => true,
|
56 |
'default' => [],
|
94 |
$this->remove_control( 'show_excerpt' );
|
95 |
$this->remove_control( 'excerpt_length' );
|
96 |
|
|
|
|
|
97 |
}
|
98 |
|
99 |
private function get_post_id(){
|
111 |
$wpdb->term_relationships.object_id=$wpdb->posts.ID
|
112 |
WHERE $wpdb->posts.post_status='publish'"
|
113 |
);
|
114 |
+
$options = [ ' ' => ' ' ];
|
115 |
foreach ( $templates as $template ) {
|
116 |
$options[ $template->ID ] = $template->post_title;
|
117 |
}
|
166 |
}
|
167 |
|
168 |
protected function render_post_header() {
|
169 |
+
$classes = 'elementor-post elementor-grid-item';
|
170 |
+
$parent_settings = $this->parent->get_settings();
|
171 |
+
$parent_settings[$this->get_id().'_post_slider'] = isset($parent_settings[$this->get_id().'_post_slider'])? $parent_settings[$this->get_id().'_post_slider'] : "";
|
172 |
+
if($parent_settings[$this->get_id().'_post_slider'] == "yes") $classes .= ' swiper-slide'
|
173 |
+
?>
|
174 |
+
<article id="post-<?php the_ID(); ?>" <?php post_class( [ $classes ] ); ?>>
|
175 |
<?php
|
176 |
}
|
177 |
protected function render_post() {
|
186 |
else echo $this->get_template();
|
187 |
}
|
188 |
|
189 |
+
else echo '<div style="display:table;border:1px solid #c6ced5; background:#dde1e5; width:100%; height:100%; min-height:200px;text-align:center; padding:20px;"><span style="vertical-align:middle;display: table-cell;color:#8995a0;">'.
|
190 |
+
__( "Please select a default template! ", 'ele-custom-skin').'</span></div>';
|
191 |
|
192 |
|
193 |
$this->render_post_footer();
|
194 |
|
195 |
}
|
196 |
+
|
197 |
+
|
198 |
+
protected function render_loop_header() {
|
199 |
+
$parent_settings = $this->parent->get_settings();
|
200 |
+
$parent_settings[$this->get_id().'_post_slider'] = isset($parent_settings[$this->get_id().'_post_slider'])? $parent_settings[$this->get_id().'_post_slider'] : "";
|
201 |
+
$this->parent->add_render_attribute( 'container', [
|
202 |
+
'class' => [
|
203 |
+
'elementor-posts-container',
|
204 |
+
'elementor-posts',
|
205 |
+
$parent_settings[$this->get_id().'_post_slider'] == "yes" ? 'swiper-wrapper' : 'elementor-grid',
|
206 |
+
$this->get_container_class(),
|
207 |
+
],
|
208 |
+
] );
|
209 |
+
if($parent_settings[$this->get_id().'_post_slider'] == "yes") {
|
210 |
+
echo '<div class="swiper-container">';
|
211 |
+
}
|
212 |
+
?>
|
213 |
+
<div <?php echo $this->parent->get_render_attribute_string( 'container' ); ?>>
|
214 |
+
<?php
|
215 |
+
}
|
216 |
+
|
217 |
+
protected function render_loop_footer() {
|
218 |
+
?>
|
219 |
+
</div>
|
220 |
+
<?php
|
221 |
+
|
222 |
+
$parent_settings = $this->parent->get_settings();
|
223 |
+
$parent_settings[$this->get_id().'_post_slider'] = isset($parent_settings[$this->get_id().'_post_slider'])? $parent_settings[$this->get_id().'_post_slider'] : "";
|
224 |
+
if($parent_settings[$this->get_id().'_post_slider'] == "yes") {
|
225 |
+
$this->slider_elements();
|
226 |
+
echo '</div>';
|
227 |
+
|
228 |
+
}
|
229 |
+
if ( '' === $parent_settings['pagination_type'] ) {
|
230 |
+
return;
|
231 |
+
}
|
232 |
+
|
233 |
+
$page_limit = $this->parent->get_query()->max_num_pages;
|
234 |
+
if ( '' !== $parent_settings['pagination_page_limit'] ) {
|
235 |
+
$page_limit = min( $parent_settings['pagination_page_limit'], $page_limit );
|
236 |
+
}
|
237 |
+
|
238 |
+
if ( 2 > $page_limit ) {
|
239 |
+
return;
|
240 |
+
}
|
241 |
+
|
242 |
+
$this->parent->add_render_attribute( 'pagination', 'class', 'elementor-pagination' );
|
243 |
+
|
244 |
+
$has_numbers = in_array( $parent_settings['pagination_type'], [ 'numbers', 'numbers_and_prev_next' ] );
|
245 |
+
$has_prev_next = in_array( $parent_settings['pagination_type'], [ 'prev_next', 'numbers_and_prev_next' ] );
|
246 |
+
|
247 |
+
$links = [];
|
248 |
+
|
249 |
+
if ( $has_numbers ) {
|
250 |
+
$paginate_args = [
|
251 |
+
'type' => 'array',
|
252 |
+
'current' => $this->parent->get_current_page(),
|
253 |
+
'total' => $page_limit,
|
254 |
+
'prev_next' => false,
|
255 |
+
'show_all' => 'yes' !== $parent_settings['pagination_numbers_shorten'],
|
256 |
+
'before_page_number' => '<span class="elementor-screen-only">' . __( 'Page', 'elementor-pro' ) . '</span>',
|
257 |
+
];
|
258 |
+
|
259 |
+
if ( is_singular() && ! is_front_page() ) {
|
260 |
+
global $wp_rewrite;
|
261 |
+
if ( $wp_rewrite->using_permalinks() ) {
|
262 |
+
$paginate_args['base'] = trailingslashit( get_permalink() ) . '%_%';
|
263 |
+
$paginate_args['format'] = user_trailingslashit( '%#%', 'single_paged' );
|
264 |
+
} else {
|
265 |
+
$paginate_args['format'] = '?page=%#%';
|
266 |
+
}
|
267 |
+
}
|
268 |
+
|
269 |
+
$links = paginate_links( $paginate_args );
|
270 |
+
}
|
271 |
+
|
272 |
+
if ( $has_prev_next ) {
|
273 |
+
$prev_next = $this->parent->get_posts_nav_link( $page_limit );
|
274 |
+
array_unshift( $links, $prev_next['prev'] );
|
275 |
+
$links[] = $prev_next['next'];
|
276 |
+
}
|
277 |
+
|
278 |
+
?>
|
279 |
+
<nav class="elementor-pagination" role="navigation" aria-label="<?php esc_attr_e( 'Pagination', 'elementor-pro' ); ?>">
|
280 |
+
<?php echo implode( PHP_EOL, $links ); ?>
|
281 |
+
</nav>
|
282 |
+
<?php
|
283 |
+
}
|
284 |
+
|
285 |
+
private function slider_elements(){
|
286 |
+
$this->settings = $this->parent->get_settings();
|
287 |
+
do_action( 'ECS_after_slider_elements', $this );
|
288 |
+
}
|
289 |
+
|
290 |
|
291 |
}
|
292 |
|
301 |
protected function _register_controls_actions() {
|
302 |
add_action( 'elementor/element/archive-posts/section_layout/before_section_end', [ $this, 'register_controls' ] );
|
303 |
add_action( 'elementor/element/archive-posts/section_layout/after_section_end', [ $this, 'register_style_sections' ] );
|
304 |
+
|
305 |
+
add_action( 'elementor/element/archive-posts/'.$this->get_id().'_section_design_layout/after_section_end', [ $this, 'register_navigation_design_controls' ] );
|
306 |
+
add_action( 'elementor/element/archive-posts/section_pagination/after_section_end', [ $this, 'register_navigation_controls' ] );
|
307 |
}
|
308 |
|
309 |
public function get_id() {
|