PluginProbe ʕ •ᴥ•ʔ
Premium Addons for Elementor – Powerful Elementor Templates & Widgets / 4.11.77
Premium Addons for Elementor – Powerful Elementor Templates & Widgets v4.11.77
4.11.79 4.11.78 4.11.77 4.11.76 4.11.75 3.20.5 4.11.69 3.20.6 4.11.7 3.20.7 4.11.70 3.20.8 4.11.71 3.20.9 4.11.72 3.21.1 4.11.73 3.21.2 4.11.74 3.21.3 4.11.8 3.21.4 4.11.9 3.21.5 4.2.0 3.21.6 4.2.1 3.3.0 4.2.2 3.3.1 4.2.3 3.3.2 4.2.4 3.3.3 4.2.5 3.3.4 4.2.6 3.3.5 4.2.7 3.3.6 4.2.8 3.3.7 4.2.9 3.3.8 4.3.0 3.3.9 4.3.1 3.4.0 4.3.2 3.4.1 4.3.3 3.4.2 4.3.4 3.4.3 4.3.5 3.4.4 4.3.6 3.4.5 4.3.7 3.4.6 4.3.8 3.4.7 4.3.9 3.4.8 4.4.0 3.4.9 4.4.1 3.5.0 4.4.2 3.5.1 4.4.3 3.5.2 4.4.4 3.5.3 4.4.5 3.5.4 4.4.6 3.5.5 4.4.7 3.5.6 4.4.8 3.5.7 4.4.9 3.5.8 4.5.0 3.5.9 4.5.1 3.6.0 4.5.2 3.6.1 4.5.3 3.6.2 4.5.4 3.6.3 4.5.5 3.6.4 4.5.6 3.6.5 4.5.7 3.6.6 4.5.8 3.6.7 4.5.9 3.6.8 4.6.0 3.6.9 4.6.1 3.7.0 4.7.0 3.7.1 4.7.1 3.7.2 4.7.2 3.7.3 4.7.3 3.7.4 4.7.4 3.7.5 4.7.5 3.7.6 4.7.6 3.7.7 4.7.7 3.7.8 4.7.8 3.7.9 4.7.9 3.8.0 4.8.0 3.8.1 4.8.1 3.8.2 4.8.10 3.8.3 4.8.11 3.8.4 4.8.2 3.8.5 4.8.3 3.8.6 4.8.4 3.8.7 4.8.5 3.8.8 4.8.6 3.8.9 4.8.7 3.9.0 4.8.8 3.9.1 4.8.9 3.9.2 4.9.0 3.9.3 4.9.0-beta1 3.9.4 4.9.0-beta2 3.9.5 4.9.1 3.9.6 4.9.10 3.9.7 4.9.11 3.9.8 4.9.12 3.9.9 4.9.13 4.0.1 4.9.14 4.0.3 4.9.15 4.0.4 4.9.16 4.0.5 4.9.17 4.0.6 4.9.18 4.0.7 4.9.19 4.0.8 4.9.2 4.0.9 4.9.20 4.1.0 4.9.21 4.1.1 4.9.22 4.1.2 4.9.23 4.1.3 4.9.24 trunk 4.1.4 4.9.25 1.0 4.1.5 4.9.26 1.01 4.1.6 4.9.27 1.02 4.1.7 4.9.28 1.03 4.1.8 4.9.29 1.04 4.1.9 4.9.3 1.05 4.10.0 4.9.30 1.06 4.10.1 4.9.31 1.07 4.10.10 4.9.32 1.08 4.10.11 4.9.33 1.09 4.10.12 4.9.34 2.0 4.10.13 4.9.35 2.0.1 4.10.14 4.9.36 2.0.2 4.10.15 4.9.37 2.0.3 4.10.16 4.9.38 2.0.4 4.10.17 4.9.39 2.0.5 4.10.18 4.9.4 2.0.6 4.10.19 4.9.40 2.0.7 4.10.2 4.9.41 2.0.8 4.10.20 4.9.42 2.0.9 4.10.21 4.9.43 2.1.0 4.10.22 4.9.45 2.1.1 4.10.23 4.9.46 2.1.2 4.10.24 4.9.47 2.1.3 4.10.25 4.9.48 2.1.4 4.10.26 4.9.49 2.1.5 4.10.27 4.9.5 2.1.5-beta1 4.10.28 4.9.50 2.1.6 4.10.29 4.9.51 2.1.7 4.10.3 4.9.52 2.1.8 4.10.30 4.9.53 2.1.9 4.10.31 4.9.54 2.2.0 4.10.32 4.9.55 2.2.1 4.10.33 4.9.56 2.2.2 4.10.34 4.9.57 2.2.3 4.10.35 4.9.6 2.2.4 4.10.36 4.9.7 2.2.5 4.10.37 4.9.8 2.2.6 4.10.38 4.9.9 2.2.7 4.10.39 2.2.8 4.10.4 2.2.9 4.10.40 2.3.0 4.10.41 2.3.1 4.10.42 2.3.2 4.10.43 2.3.3 4.10.44 2.3.4 4.10.45 2.3.5 4.10.46 2.3.6 4.10.47 2.3.7 4.10.48 2.3.8 4.10.49 2.3.9 4.10.5 2.4.0 4.10.50 2.4.1 4.10.51 2.5.0 4.10.52 2.5.1 4.10.53 2.5.2 4.10.54 2.5.3 4.10.55 2.5.4 4.10.56 2.5.5 4.10.57 2.5.6 4.10.58 2.5.7 4.10.59 2.5.8 4.10.6 2.5.9 4.10.60 2.6.0 4.10.61 2.6.1 4.10.62 2.6.2 4.10.63 2.6.3 4.10.64 2.6.4 4.10.65 2.6.5 4.10.66 2.6.6 4.10.67 2.6.7 4.10.68 2.6.8 4.10.69 2.6.9 4.10.7 2.7.0 4.10.70 2.7.1 4.10.71 2.7.2 4.10.72 2.7.3 4.10.73 2.7.4 4.10.74 2.7.5 4.10.75 2.7.6 4.10.76 2.7.7 4.10.77 2.7.8 4.10.78 2.7.9 4.10.79 2.8.0 4.10.8 2.8.1 4.10.80 2.8.2 4.10.81 2.8.3 4.10.82 2.8.4 4.10.83 2.8.5 4.10.84 2.8.6 4.10.85 2.8.7 4.10.86 2.8.8 4.10.87 2.8.9 4.10.88 2.9.0 4.10.89 2.9.1 4.10.9 2.9.2 4.10.90 2.9.3 4.11.0 2.9.4 4.11.1 2.9.5 4.11.10 2.9.6 4.11.11 2.9.7 4.11.12 2.9.8 4.11.13 2.9.9 4.11.14 3.0.0 4.11.15 3.0.1 4.11.16 3.0.2 4.11.17 3.0.3 4.11.18 3.0.4 4.11.19 3.0.5 4.11.2 3.0.6 4.11.20 3.0.7 4.11.21 3.0.8 4.11.22 3.0.9 4.11.23 3.1.0 4.11.24 3.1.1 4.11.25 3.1.2 4.11.26 3.1.3 4.11.27 3.1.4 4.11.28 3.1.5 4.11.29 3.1.6 4.11.3 3.1.7 4.11.30 3.1.8 4.11.31 3.1.9 4.11.32 3.10.0 4.11.33 3.10.1 4.11.34 3.10.2 4.11.35 3.10.3 4.11.36 3.10.4 4.11.37 3.10.5 4.11.38 3.10.6 4.11.39 3.10.7 4.11.4 3.10.8 4.11.40 3.10.9 4.11.41 3.11.0 4.11.42 3.11.1 4.11.43 3.11.2 4.11.44 3.11.3 4.11.45 3.11.4 4.11.46 3.11.5 4.11.47 3.11.6 4.11.48 3.11.7 4.11.49 3.11.8 4.11.5 3.11.9 4.11.50 3.12.0 4.11.51 3.12.1 4.11.52 3.12.2 4.11.53 3.12.3 4.11.54 3.2.0 4.11.55 3.2.1 4.11.56 3.2.2 4.11.57 3.2.3 4.11.58 3.2.4 4.11.59 3.2.5 4.11.6 3.2.6 4.11.60 3.2.7 4.11.61 3.2.8 4.11.62 3.2.9 4.11.63 3.20.0 4.11.64 3.20.1 4.11.65 3.20.2 4.11.66 3.20.3 4.11.67 3.20.4 4.11.68
premium-addons-for-elementor / widgets / premium-blog.php
premium-addons-for-elementor / widgets Last commit date
dep 1 month ago premium-banner.php 3 weeks ago premium-blog.php 3 weeks ago premium-button.php 3 weeks ago premium-carousel.php 3 weeks ago premium-contactform.php 3 weeks ago premium-countdown.php 3 weeks ago premium-counter.php 3 weeks ago premium-dual-header.php 3 weeks ago premium-fancytext.php 3 weeks ago premium-grid.php 3 weeks ago premium-icon-list.php 3 weeks ago premium-image-button.php 3 weeks ago premium-image-scroll.php 3 weeks ago premium-image-separator.php 3 weeks ago premium-lottie.php 3 weeks ago premium-maps.php 3 weeks ago premium-media-wheel.php 3 weeks ago premium-mobile-menu.php 3 weeks ago premium-modalbox.php 3 weeks ago premium-nav-menu.php 3 weeks ago premium-notifications.php 3 weeks ago premium-person.php 3 weeks ago premium-pinterest-feed.php 3 weeks ago premium-post-ticker.php 3 weeks ago premium-pricing-table.php 3 weeks ago premium-progressbar.php 3 weeks ago premium-search-form.php 3 weeks ago premium-svg-drawer.php 3 weeks ago premium-tcloud.php 3 weeks ago premium-testimonials.php 3 weeks ago premium-textual-showcase.php 3 weeks ago premium-tiktok-feed.php 3 weeks ago premium-title.php 3 weeks ago premium-videobox.php 3 weeks ago premium-vscroll.php 3 weeks ago premium-weather.php 3 weeks ago premium-world-clock.php 3 weeks ago
premium-blog.php
3721 lines
1 <?php
2 /**
3 * Premium Blog.
4 */
5
6 namespace PremiumAddons\Widgets;
7
8 // Elementor Classes.
9 use Elementor\Plugin;
10 use Elementor\Widget_Base;
11 use Elementor\Controls_Manager;
12 use Elementor\Group_Control_Image_Size;
13 use Elementor\Repeater;
14 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
15 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
16 use Elementor\Group_Control_Border;
17 use Elementor\Group_Control_Typography;
18 use Elementor\Group_Control_Css_Filter;
19 use Elementor\Group_Control_Box_Shadow;
20
21 // PremiumAddons Classes.
22 use PremiumAddons\Includes\Premium_Template_Tags as Blog_Helper;
23 use PremiumAddons\Includes\Helper_Functions;
24 use PremiumAddons\Includes\Controls\Premium_Background;
25 use PremiumAddons\Includes\Controls\Premium_Post_Filter;
26 use PremiumAddons\Includes\Controls\Premium_Tax_Filter;
27
28 if ( ! defined( 'ABSPATH' ) ) {
29 exit; // If this file is called directly, abort.
30 }
31
32 /**
33 * Class Premium_Blog
34 */
35 class Premium_Blog extends Widget_Base {
36
37 /**
38 * Retrieve Widget Name.
39 *
40 * @since 1.0.0
41 * @access public
42 */
43 public function get_name() {
44 return 'premium-addon-blog';
45 }
46
47 /**
48 * Retrieve Widget Title.
49 *
50 * @since 1.0.0
51 * @access public
52 */
53 public function get_title() {
54 return __( 'Blog', 'premium-addons-for-elementor' );
55 }
56
57 /**
58 * Widget preview refresh button.
59 *
60 * @since 1.0.0
61 * @access public
62 */
63 public function is_reload_preview_required() {
64 return true;
65 }
66
67 /**
68 * Retrieve Widget Dependent CSS.
69 *
70 * @since 1.0.0
71 * @access public
72 *
73 * @return array CSS style handles.
74 */
75 public function get_style_depends() {
76 return array(
77 'font-awesome-5-all',
78 'pa-slick',
79 'premium-addons',
80 );
81 }
82
83 /**
84 * Retrieve Widget Dependent JS.
85 *
86 * @since 1.0.0
87 * @access public
88 *
89 * @return array JS script handles.
90 */
91 public function get_script_depends() {
92
93 $is_edit = Helper_Functions::is_edit_mode();
94
95 $scripts = array( 'imagesloaded' );
96
97 if ( $is_edit ) {
98
99 $scripts = array_merge( $scripts, array( 'isotope-js', 'pa-slick', 'pa-tweenmax', 'pa-draggable' ) );
100
101 } else {
102 $settings = $this->get_settings_for_display();
103
104 if ( 'masonry' === $settings['premium_blog_layout'] ) {
105 $scripts[] = 'isotope-js';
106 } elseif ( 'marquee' === $settings['premium_blog_layout'] ) {
107
108 if ( 'yes' === $settings['marquee_draggable'] ) {
109 $scripts[] = 'pa-draggable';
110 }
111 $scripts[] = 'pa-tweenmax';
112 }
113
114 if ( 'yes' === $settings['premium_blog_carousel'] ) {
115 $scripts[] = 'pa-slick';
116 }
117 }
118
119 $scripts[] = 'premium-addons';
120
121 return $scripts;
122 }
123
124 /**
125 * Retrieve Widget Icon.
126 *
127 * @since 1.0.0
128 * @access public
129 *
130 * @return string widget icon.
131 */
132 public function get_icon() {
133 return 'pa-blog';
134 }
135
136 /**
137 * Retrieve Widget Keywords.
138 *
139 * @since 1.0.0
140 * @access public
141 *
142 * @return string Widget keywords.
143 */
144 public function get_keywords() {
145 return array( 'pa', 'premium', 'premium blog', 'posts', 'grid', 'item', 'loop', 'query', 'portfolio', 'cpt', 'custom' );
146 }
147
148 /**
149 * Retrieve Widget Categories.
150 *
151 * @since 1.5.1
152 * @access public
153 *
154 * @return array Widget categories.
155 */
156 public function get_categories() {
157 return array( 'premium-elements' );
158 }
159
160 /**
161 * Retrieve Widget Support URL.
162 *
163 * @access public
164 *
165 * @return string support URL.
166 */
167 public function get_custom_help_url() {
168 return 'https://premiumaddons.com/support/';
169 }
170
171 public function has_widget_inner_wrapper(): bool {
172 return ! Helper_Functions::check_elementor_experiment( 'e_optimized_markup' );
173 }
174
175 /**
176 * Register Blog controls.
177 *
178 * @since 1.0.0
179 * @access protected
180 */
181 protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
182
183 $this->start_controls_section(
184 'general_settings_section',
185 array(
186 'label' => __( 'General', 'premium-addons-for-elementor' ),
187 )
188 );
189
190 $this->add_control(
191 'premium_blog_skin',
192 array(
193 'label' => __( 'Skin', 'premium-addons-for-elementor' ),
194 'type' => Controls_Manager::SELECT,
195 'options' => array(
196 'classic' => __( 'Classic', 'premium-addons-for-elementor' ),
197 'modern' => __( 'Modern', 'premium-addons-for-elementor' ),
198 'cards' => __( 'Cards', 'premium-addons-for-elementor' ),
199 'side' => __( 'On Side', 'premium-addons-for-elementor' ),
200 'banner' => __( 'Banner', 'premium-addons-for-elementor' ),
201 ),
202 'default' => 'classic',
203 'label_block' => true,
204 )
205 );
206
207 $this->add_control(
208 'banner_skin_notice',
209 array(
210 'raw' => __( 'If content height is larger than image height, then you may need to increase image height from Featured Image tab', 'premium-addons-for-elementor' ),
211 'type' => Controls_Manager::RAW_HTML,
212 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
213 'condition' => array(
214 'premium_blog_skin' => 'banner',
215 ),
216 )
217 );
218
219 $this->add_responsive_control(
220 'content_offset',
221 array(
222 'label' => __( 'Content Offset', 'premium-addons-for-elementor' ),
223 'type' => Controls_Manager::SLIDER,
224 'range' => array(
225 'px' => array(
226 'min' => -100,
227 'max' => 100,
228 ),
229 ),
230 'condition' => array(
231 'premium_blog_skin' => 'modern',
232 ),
233 'selectors' => array(
234 '{{WRAPPER}} .premium-blog-skin-modern .premium-blog-content-wrapper' => 'top: {{SIZE}}{{UNIT}}',
235 ),
236 )
237 );
238
239 $this->add_control(
240 'premium_blog_grid',
241 array(
242 'label' => __( 'Grid', 'premium-addons-for-elementor' ),
243 'type' => Controls_Manager::SWITCHER,
244 'default' => 'yes',
245 'frontend_available' => true,
246 )
247 );
248
249 $this->add_control(
250 'premium_blog_layout',
251 array(
252 'label' => __( 'Layout', 'premium-addons-for-elementor' ),
253 'type' => Controls_Manager::SELECT,
254 'options' => array(
255 'even' => __( 'Even', 'premium-addons-for-elementor' ),
256 'masonry' => __( 'Masonry', 'premium-addons-for-elementor' ),
257 'marquee' => __( 'Marquee', 'premium-addons-for-elementor' ),
258 ),
259 'default' => 'even',
260 'condition' => array(
261 'premium_blog_grid' => 'yes',
262 ),
263 'frontend_available' => true,
264 )
265 );
266
267 $this->add_responsive_control(
268 'marquee_post_width',
269 array(
270 'label' => __( 'Post Width', 'premium-addons-for-elementor' ),
271 'type' => Controls_Manager::SLIDER,
272 'render_type' => 'template',
273 'range' => array(
274 'px' => array(
275 'min' => 100,
276 'max' => 800,
277 ),
278 ),
279 'label_block' => true,
280 'condition' => array(
281 'premium_blog_grid' => 'yes',
282 'premium_blog_layout' => 'marquee',
283 ),
284 'selectors' => array(
285 '{{WRAPPER}} .premium-blog-post-outer-container' => 'width: {{SIZE}}{{UNIT}}',
286 ),
287 )
288 );
289
290 $this->add_control(
291 'force_height',
292 array(
293 'label' => __( 'Equal Height', 'premium-addons-for-elementor' ),
294 'type' => Controls_Manager::SWITCHER,
295 'return_value' => 'true',
296 'condition' => array(
297 'premium_blog_grid' => 'yes',
298 'premium_blog_layout!' => 'masonry',
299 ),
300 'frontend_available' => true,
301 )
302 );
303
304 $this->add_control(
305 'force_height_notice',
306 array(
307 'raw' => __( 'Equal Height option uses JS to force all content boxes to take the same height, so you will need to make sure all featured images are the same height. You can set that from Featured Image tab.', 'premium-addons-for-elementor' ),
308 'type' => Controls_Manager::RAW_HTML,
309 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
310 'condition' => array(
311 'premium_blog_grid' => 'yes',
312 'premium_blog_layout' => 'even',
313 'force_height' => 'true',
314 ),
315 )
316 );
317
318 $this->add_responsive_control(
319 'premium_blog_columns_number',
320 array(
321 'label' => __( 'Number of Columns', 'premium-addons-for-elementor' ),
322 'type' => Controls_Manager::SELECT,
323 'options' => array(
324 '100%' => __( '1 Column', 'premium-addons-for-elementor' ),
325 '50%' => __( '2 Columns', 'premium-addons-for-elementor' ),
326 '33.33%' => __( '3 Columns', 'premium-addons-for-elementor' ),
327 '25%' => __( '4 Columns', 'premium-addons-for-elementor' ),
328 '20%' => __( '5 Columns', 'premium-addons-for-elementor' ),
329 '16.66%' => __( '6 Columns', 'premium-addons-for-elementor' ),
330 ),
331 'default' => '50%',
332 'tablet_default' => '50%',
333 'mobile_default' => '100%',
334 'render_type' => 'template',
335 'label_block' => true,
336 'condition' => array(
337 'premium_blog_grid' => 'yes',
338 'premium_blog_layout!' => 'marquee',
339 ),
340 'selectors' => array(
341 '{{WRAPPER}} .premium-blog-post-outer-container' => 'width: {{VALUE}}',
342 ),
343 'frontend_available' => true,
344 )
345 );
346
347 $this->add_control(
348 'premium_blog_number_of_posts',
349 array(
350 'label' => __( 'Posts Per Page', 'premium-addons-for-elementor' ),
351 'description' => __( 'Set the number of posts per page', 'premium-addons-for-elementor' ),
352 'type' => Controls_Manager::NUMBER,
353 'min' => 1,
354 'default' => 4,
355 )
356 );
357
358 $this->end_controls_section();
359
360 $this->start_controls_section(
361 'section_query_options',
362 array(
363 'label' => __( 'Query', 'premium-addons-for-elementor' ),
364 )
365 );
366
367 $post_types = Blog_Helper::get_posts_types();
368
369 $post_types['main'] = __( 'Main Query', 'premium-addons-for-elementor' );
370
371 $this->add_control(
372 'post_type_filter',
373 array(
374 'label' => __( 'Source', 'premium-addons-for-elementor' ),
375 'type' => Controls_Manager::SELECT,
376 'label_block' => true,
377 'options' => $post_types,
378 'default' => 'post',
379 'separator' => 'after',
380 )
381 );
382
383 foreach ( $post_types as $key => $type ) {
384
385 // Get all the taxonomies associated with the selected post type.
386 $taxonomy = Blog_Helper::get_taxnomies( $key );
387
388 if ( ! empty( $taxonomy ) ) {
389
390 // Batch-fetch terms for all taxonomies of this post type in one query.
391 $all_terms = get_terms(
392 array(
393 'taxonomy' => array_keys( $taxonomy ),
394 'hide_empty' => false,
395 )
396 );
397 $terms_by_tax = array();
398 if ( ! is_wp_error( $all_terms ) ) {
399 foreach ( $all_terms as $t ) {
400 $terms_by_tax[ $t->taxonomy ][] = $t;
401 }
402 }
403
404 // Get all taxonomy values under the taxonomy.
405 foreach ( $taxonomy as $index => $tax ) {
406
407 $terms = isset( $terms_by_tax[ $index ] ) ? $terms_by_tax[ $index ] : array();
408
409 $related_tax = array();
410
411 if ( ! empty( $terms ) ) {
412
413 foreach ( $terms as $t_index => $t_obj ) {
414
415 $related_tax[ $t_obj->slug ] = $t_obj->name;
416 }
417
418 // Add filter rule for the each taxonomy.
419 $this->add_control(
420 $index . '_' . $key . '_filter_rule',
421 array(
422 /* translators: %s Taxonomy Label */
423 'label' => sprintf( __( '%s Filter Rule', 'premium-addons-for-elementor' ), $tax->label ),
424 'type' => Controls_Manager::SELECT,
425 'default' => 'IN',
426 'label_block' => true,
427 'options' => array(
428 /* translators: %s: Taxonomy Label */
429 'IN' => sprintf( __( 'Match %s', 'premium-addons-for-elementor' ), $tax->label ),
430 /* translators: %s: Taxonomy Label */
431 'NOT IN' => sprintf( __( 'Exclude %s', 'premium-addons-for-elementor' ), $tax->label ),
432 ),
433 'condition' => array(
434 'post_type_filter' => $key,
435 ),
436 )
437 );
438
439 // Add select control for each taxonomy.
440 $this->add_control(
441 'tax_' . $index . '_' . $key . '_filter',
442 array(
443 /* translators: %s Taxonomy Label */
444 'label' => sprintf( __( '%s Filter', 'premium-addons-for-elementor' ), $tax->label ),
445 'type' => Controls_Manager::SELECT2,
446 'default' => '',
447 'multiple' => true,
448 'label_block' => true,
449 'options' => $related_tax,
450 'condition' => array(
451 'post_type_filter' => $key,
452 ),
453 'separator' => 'after',
454 )
455 );
456
457 }
458 }
459 }
460 }
461
462 $this->add_control(
463 'author_filter_rule',
464 array(
465 'label' => __( 'Filter By Author Rule', 'premium-addons-for-elementor' ),
466 'type' => Controls_Manager::SELECT,
467 'default' => 'author__in',
468 'separator' => 'before',
469 'label_block' => true,
470 'options' => array(
471 'author__in' => __( 'Match Authors', 'premium-addons-for-elementor' ),
472 'author__not_in' => __( 'Exclude Authors', 'premium-addons-for-elementor' ),
473 ),
474 'condition' => array(
475 'post_type_filter!' => 'main',
476 ),
477 )
478 );
479
480 $this->add_control(
481 'premium_blog_users',
482 array(
483 'label' => __( 'Authors', 'premium-addons-for-elementor' ),
484 'type' => Controls_Manager::SELECT2,
485 'label_block' => true,
486 'multiple' => true,
487 'options' => Blog_Helper::get_authors(),
488 'condition' => array(
489 'post_type_filter!' => 'main',
490 ),
491 )
492 );
493
494 $this->add_control(
495 'posts_filter_rule',
496 array(
497 'label' => __( 'Filter By Post Rule', 'premium-addons-for-elementor' ),
498 'type' => Controls_Manager::SELECT,
499 'default' => 'post__not_in',
500 'separator' => 'before',
501 'label_block' => true,
502 'options' => array(
503 'post__in' => __( 'Match Post', 'premium-addons-for-elementor' ),
504 'post__not_in' => __( 'Exclude Post', 'premium-addons-for-elementor' ),
505 ),
506 'condition' => array(
507 'post_type_filter!' => 'main',
508 ),
509 )
510 );
511
512 $this->add_control(
513 'premium_blog_posts_exclude',
514 array(
515 'label' => __( 'Posts', 'premium-addons-for-elementor' ),
516 'type' => Premium_Post_Filter::TYPE,
517 'label_block' => true,
518 'multiple' => true,
519 'source' => 'post',
520 'condition' => array(
521 'post_type_filter' => 'post',
522 ),
523 )
524 );
525
526 $this->add_control(
527 'custom_posts_filter',
528 array(
529 'label' => __( 'Posts', 'premium-addons-for-elementor' ),
530 'type' => Premium_Post_Filter::TYPE,
531 'render_type' => 'template',
532 'label_block' => true,
533 'multiple' => true,
534 'frontend_available' => true,
535 'condition' => array(
536 'post_type_filter!' => array( 'post', 'main' ),
537 ),
538
539 )
540 );
541
542 $this->add_control(
543 'ignore_sticky_posts',
544 array(
545 'label' => __( 'Ignore Sticky Posts', 'premium-addons-for-elementor' ),
546 'type' => Controls_Manager::SWITCHER,
547 'label_on' => __( 'Yes', 'premium-addons-for-elementor' ),
548 'label_off' => __( 'No', 'premium-addons-for-elementor' ),
549 'default' => 'yes',
550 'condition' => array(
551 'post_type_filter!' => 'main',
552 ),
553 )
554 );
555
556 $this->add_control(
557 'premium_blog_offset',
558 array(
559 'label' => __( 'Offset', 'premium-addons-for-elementor' ),
560 'description' => __( 'This option is used to exclude number of initial posts from being display.', 'premium-addons-for-elementor' ),
561 'type' => Controls_Manager::NUMBER,
562 'default' => '0',
563 'min' => '0',
564 'condition' => array(
565 'post_type_filter!' => 'main',
566 ),
567 )
568 );
569
570 $this->add_control(
571 'query_exclude_current',
572 array(
573 'label' => __( 'Exclude Current Post', 'premium-addons-for-elementor' ),
574 'type' => Controls_Manager::SWITCHER,
575 'description' => __( 'This option will remove the current post from the query.', 'premium-addons-for-elementor' ),
576 'label_on' => __( 'Yes', 'premium-addons-for-elementor' ),
577 'label_off' => __( 'No', 'premium-addons-for-elementor' ),
578 'condition' => array(
579 'post_type_filter!' => 'main',
580 ),
581 )
582 );
583
584 $this->add_control(
585 'premium_blog_order_by',
586 array(
587 'label' => __( 'Order By', 'premium-addons-for-elementor' ),
588 'type' => Controls_Manager::SELECT,
589 'separator' => 'before',
590 'label_block' => true,
591 'options' => array(
592 'none' => __( 'None', 'premium-addons-for-elementor' ),
593 'ID' => __( 'ID', 'premium-addons-for-elementor' ),
594 'author' => __( 'Author', 'premium-addons-for-elementor' ),
595 'title' => __( 'Title', 'premium-addons-for-elementor' ),
596 'name' => __( 'Name', 'premium-addons-for-elementor' ),
597 'date' => __( 'Date', 'premium-addons-for-elementor' ),
598 'modified' => __( 'Last Modified', 'premium-addons-for-elementor' ),
599 'rand' => __( 'Random', 'premium-addons-for-elementor' ),
600 'menu_order' => __( 'Menu Order', 'premium-addons-for-elementor' ),
601 'comment_count' => __( 'Number of Comments', 'premium-addons-for-elementor' ),
602 'meta_value' => __( 'Meta Value', 'premium-addons-for-elementor' ),
603 ),
604 'default' => 'date',
605 'condition' => array(
606 'post_type_filter!' => 'main',
607 ),
608 )
609 );
610
611 $this->add_control(
612 'premium_blog_meta_key',
613 array(
614 'label' => __( 'Meta Value', 'premium-addons-for-elementor' ),
615 'type' => Controls_Manager::TEXT,
616 'label_block' => true,
617 'condition' => array(
618 'post_type_filter!' => 'main',
619 'premium_blog_order_by' => 'meta_value',
620 ),
621 'ai' => array(
622 'active' => false,
623 ),
624 )
625 );
626
627 $this->add_control(
628 'premium_blog_order',
629 array(
630 'label' => __( 'Order', 'premium-addons-for-elementor' ),
631 'type' => Controls_Manager::SELECT,
632 'label_block' => true,
633 'options' => array(
634 'DESC' => __( 'Descending', 'premium-addons-for-elementor' ),
635 'ASC' => __( 'Ascending', 'premium-addons-for-elementor' ),
636 ),
637 'default' => 'DESC',
638 'condition' => array(
639 'post_type_filter!' => 'main',
640 ),
641 )
642 );
643
644 $this->add_control(
645 'empty_query_text',
646 array(
647 'label' => __( 'Empty Query Text', 'premium-addons-for-elementor' ),
648 'type' => Controls_Manager::TEXT,
649 'label_block' => true,
650 )
651 );
652
653 $this->end_controls_section();
654
655 $this->start_controls_section(
656 'premium_blog_general_settings',
657 array(
658 'label' => __( 'Featured Image', 'premium-addons-for-elementor' ),
659 )
660 );
661
662 $this->add_control(
663 'show_featured_image',
664 array(
665 'label' => __( 'Show Featured Image', 'premium-addons-for-elementor' ),
666 'type' => Controls_Manager::SWITCHER,
667 'default' => 'yes',
668 'condition' => array(
669 'premium_blog_skin!' => 'banner',
670 ),
671 )
672 );
673
674 $featured_image_conditions = array(
675 'show_featured_image' => 'yes',
676 );
677
678 $this->add_responsive_control(
679 'premium_blog_thumb_min_height',
680 array(
681 'label' => __( 'Height', 'premium-addons-for-elementor' ),
682 'type' => Controls_Manager::SLIDER,
683 'size_units' => array( 'px', 'em', 'custom' ),
684 'range' => array(
685 'px' => array(
686 'min' => 0,
687 'max' => 600,
688 ),
689 'em' => array(
690 'min' => 1,
691 'max' => 60,
692 ),
693 ),
694 'condition' => array_merge( $featured_image_conditions ),
695 'selectors' => array(
696 '{{WRAPPER}} .premium-blog-thumbnail-container img' => 'height: {{SIZE}}{{UNIT}};',
697 ),
698 )
699 );
700
701 $this->add_group_control(
702 Group_Control_Image_Size::get_type(),
703 array(
704 'name' => 'featured_image',
705 'default' => 'full',
706 'condition' => $featured_image_conditions,
707 )
708 );
709
710 $this->add_control(
711 'premium_blog_hover_color_effect',
712 array(
713 'label' => __( 'Overlay Effect', 'premium-addons-for-elementor' ),
714 'type' => Controls_Manager::SELECT,
715 'description' => __( 'Choose an overlay color effect', 'premium-addons-for-elementor' ),
716 'options' => array(
717 'none' => __( 'None', 'premium-addons-for-elementor' ),
718 'framed' => __( 'Framed', 'premium-addons-for-elementor' ),
719 'diagonal' => __( 'Diagonal', 'premium-addons-for-elementor' ),
720 'bordered' => __( 'Bordered', 'premium-addons-for-elementor' ),
721 'squares' => __( 'Squares', 'premium-addons-for-elementor' ),
722 ),
723 'default' => 'framed',
724 'label_block' => true,
725 'condition' => array_merge(
726 $featured_image_conditions,
727 array(
728 'premium_blog_skin' => array( 'modern', 'cards' ),
729 )
730 ),
731 )
732 );
733
734 $this->add_control(
735 'premium_blog_hover_image_effect',
736 array(
737 'label' => __( 'Hover Effect', 'premium-addons-for-elementor' ),
738 'type' => Controls_Manager::SELECT,
739 'description' => __( 'Choose a hover effect for the image', 'premium-addons-for-elementor' ),
740 'options' => array(
741 'none' => __( 'None', 'premium-addons-for-elementor' ),
742 'zoomin' => __( 'Zoom In', 'premium-addons-for-elementor' ),
743 'zoomout' => __( 'Zoom Out', 'premium-addons-for-elementor' ),
744 'scale' => __( 'Scale', 'premium-addons-for-elementor' ),
745 'gray' => __( 'Grayscale', 'premium-addons-for-elementor' ),
746 'blur' => __( 'Blur', 'premium-addons-for-elementor' ),
747 'bright' => __( 'Bright', 'premium-addons-for-elementor' ),
748 'sepia' => __( 'Sepia', 'premium-addons-for-elementor' ),
749 'trans' => __( 'Translate', 'premium-addons-for-elementor' ),
750 ),
751 'default' => 'zoomin',
752 'label_block' => true,
753 'condition' => $featured_image_conditions,
754 )
755 );
756
757 $this->add_responsive_control(
758 'thumb_width',
759 array(
760 'label' => __( 'Width (%)', 'premium-addons-for-elementor' ),
761 'type' => Controls_Manager::SLIDER,
762 'default' => array(
763 'size' => '25',
764 ),
765 'condition' => array_merge(
766 $featured_image_conditions,
767 array(
768 'premium_blog_skin' => 'side',
769 )
770 ),
771 'selectors' => array(
772 '{{WRAPPER}} .premium-blog-thumb-effect-wrapper' => 'flex-basis: {{SIZE}}%',
773 ),
774 )
775 );
776
777 $this->add_responsive_control(
778 'premium_blog_thumbnail_fit',
779 array(
780 'label' => __( 'Thumbnail Fit', 'premium-addons-for-elementor' ),
781 'type' => Controls_Manager::SELECT,
782 'options' => array(
783 'cover' => __( 'Cover', 'premium-addons-for-elementor' ),
784 'fill' => __( 'Fill', 'premium-addons-for-elementor' ),
785 'contain' => __( 'Contain', 'premium-addons-for-elementor' ),
786 ),
787 'default' => 'cover',
788 'selectors' => array(
789 '{{WRAPPER}} .premium-blog-thumbnail-container img' => 'object-fit: {{VALUE}}',
790 ),
791 'condition' => array_merge( $featured_image_conditions ),
792 )
793 );
794
795 $this->add_control(
796 'shape_divider',
797 array(
798 'label' => __( 'Shape Divider', 'premium-addons-for-elementor' ),
799 'type' => Controls_Manager::SELECT,
800 'options' => array(
801 'none' => __( 'None', 'premium-addons-for-elementor' ),
802 'arrow' => __( 'Arrow', 'premium-addons-for-elementor' ),
803 'book' => __( 'Book', 'premium-addons-for-elementor' ),
804 'cloud' => __( 'Clouds', 'premium-addons-for-elementor' ),
805 'curve' => __( 'Curve', 'premium-addons-for-elementor' ),
806 'curve-asymmetric' => __( 'Curve Asymmetric', 'premium-addons-for-elementor' ),
807 'drops' => __( 'Drop', 'premium-addons-for-elementor' ),
808 'fan' => __( 'Fan', 'premium-addons-for-elementor' ),
809 'mountain' => __( 'Mountains', 'premium-addons-for-elementor' ),
810 'pyramids' => __( 'Pyramids', 'premium-addons-for-elementor' ),
811 'split' => __( 'Split', 'premium-addons-for-elementor' ),
812 'triangle' => __( 'Triangle', 'premium-addons-for-elementor' ),
813 'tri_asymmetric' => __( 'Asymmetric Triangle', 'premium-addons-for-elementor' ),
814 'tilt' => __( 'Tilt', 'premium-addons-for-elementor' ),
815 'tilt-opacity' => __( 'Tilt Opacity', 'premium-addons-for-elementor' ),
816 'waves' => __( 'Wave', 'premium-addons-for-elementor' ),
817 'waves-brush' => __( 'Waves Brush', 'premium-addons-for-elementor' ),
818 'waves-pattern' => __( 'Waves Pattern', 'premium-addons-for-elementor' ),
819 'zigzag' => __( 'Zigzag', 'premium-addons-for-elementor' ),
820 ),
821 'default' => 'none',
822 'label_block' => true,
823 'condition' => array(
824 'show_featured_image' => 'yes',
825 ),
826 )
827 );
828
829 $this->end_controls_section();
830
831 $this->start_controls_section(
832 'premium_blog_content_settings',
833 array(
834 'label' => __( 'Display Options', 'premium-addons-for-elementor' ),
835 )
836 );
837
838 $this->add_control(
839 'premium_blog_title_tag',
840 array(
841 'label' => __( 'Title HTML Tag', 'premium-addons-for-elementor' ),
842 'description' => __( 'Select a heading tag for the post title.', 'premium-addons-for-elementor' ),
843 'type' => Controls_Manager::SELECT,
844 'options' => array(
845 'h1' => 'H1',
846 'h2' => 'H2',
847 'h3' => 'H3',
848 'h4' => 'H4',
849 'h5' => 'H5',
850 'h6' => 'H6',
851 'div' => 'div',
852 'span' => 'span',
853 'p' => 'p',
854 ),
855 'default' => 'h2',
856 'label_block' => true,
857 )
858 );
859
860 $this->add_control(
861 'premium_blog_author_img_switcher',
862 array(
863 'label' => __( 'Show Author Image', 'premium-addons-for-elementor' ),
864 'type' => Controls_Manager::SWITCHER,
865 'default' => 'yes',
866 'condition' => array(
867 'premium_blog_skin' => 'cards',
868 ),
869 )
870 );
871
872 $this->add_responsive_control(
873 'premium_blog_posts_columns_spacing',
874 array(
875 'label' => __( 'Rows Spacing', 'premium-addons-for-elementor' ),
876 'type' => Controls_Manager::SLIDER,
877 'size_units' => array( 'px', '%', 'em' ),
878 'range' => array(
879 'px' => array(
880 'min' => 1,
881 'max' => 200,
882 ),
883 ),
884 'default' => array(
885 'size' => 5,
886 'unit' => 'px',
887 ),
888 'render_type' => 'template',
889 'selectors' => array(
890 '{{WRAPPER}} .premium-blog-post-outer-container' => 'margin-bottom: {{SIZE}}{{UNIT}}',
891 ),
892 'condition' => array(
893 'premium_blog_layout!' => 'marquee',
894 ),
895 )
896 );
897
898 $this->add_responsive_control(
899 'premium_blog_posts_spacing',
900 array(
901 'label' => __( 'Columns Spacing', 'premium-addons-for-elementor' ),
902 'type' => Controls_Manager::SLIDER,
903 'default' => array(
904 'size' => 5,
905 ),
906 'range' => array(
907 'px' => array(
908 'min' => 0,
909 'max' => 50,
910 ),
911 ),
912 'selectors' => array(
913 '{{WRAPPER}} .premium-blog-wrap:not(.premium-blog-marquee) .premium-blog-post-outer-container' => 'padding-inline: calc( {{SIZE}}{{UNIT}}/2 );',
914 '{{WRAPPER}} .premium-blog-wrap:not(.premium-blog-marquee)' => 'margin-inline: calc( -{{SIZE}}{{UNIT}}/2 );',
915 '{{WRAPPER}} .premium-marquee-wrapper' => '--pa-marquee-spacing: {{SIZE}}{{UNIT}}',
916 ),
917 'render_type' => 'template',
918 'condition' => array(
919 'premium_blog_grid' => 'yes',
920 ),
921 )
922 );
923
924 $this->add_responsive_control(
925 'premium_flip_text_align',
926 array(
927 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
928 'type' => Controls_Manager::CHOOSE,
929 'options' => array(
930 'left' => array(
931 'title' => __( 'Start', 'premium-addons-for-elementor' ),
932 'icon' => is_rtl() ? 'eicon-text-align-right' : 'eicon-text-align-left',
933 ),
934 'center' => array(
935 'title' => __( 'Center', 'premium-addons-for-elementor' ),
936 'icon' => 'eicon-text-align-center',
937 ),
938 'right' => array(
939 'title' => __( 'End', 'premium-addons-for-elementor' ),
940 'icon' => is_rtl() ? 'eicon-text-align-left' : 'eicon-text-align-right',
941 ),
942 'justify' => array(
943 'title' => __( 'Justify', 'premium-addons-for-elementor' ),
944 'icon' => 'eicon-text-align-justify',
945 ),
946 ),
947 'toggle' => false,
948 'default' => 'left',
949 'prefix_class' => 'premium-blog-align-',
950 'selectors_dictionary' => array(
951 'left' => 'start',
952 'right' => 'end',
953 ),
954 'selectors' => array(
955 '{{WRAPPER}} .premium-blog-content-wrapper' => 'text-align: {{VALUE}};',
956 '{{WRAPPER}} .post-categories , {{WRAPPER}} .premium-blog-post-tags-container ' => 'justify-content: {{VALUE}};',
957 ),
958 )
959 );
960
961 $this->add_responsive_control(
962 'content_vertical_alignment',
963 array(
964 'label' => __( 'Vertical Alignment', 'premium-addons-for-elementor' ),
965 'type' => Controls_Manager::CHOOSE,
966 'options' => array(
967 'flex-start' => array(
968 'title' => __( 'Top', 'premium-addons-for-elementor' ),
969 'icon' => 'eicon-arrow-up',
970 ),
971 'center' => array(
972 'title' => __( 'Center', 'premium-addons-for-elementor' ),
973 'icon' => 'eicon-text-align-justify',
974 ),
975 'flex-end' => array(
976 'title' => __( 'Bottom', 'premium-addons-for-elementor' ),
977 'icon' => 'eicon-arrow-down',
978 ),
979 ),
980 'default' => 'flex-end',
981 'toggle' => false,
982 'condition' => array(
983 'premium_blog_skin' => 'banner',
984 ),
985 'selectors' => array(
986 '{{WRAPPER}} .premium-blog-content-wrapper' => 'justify-content: {{VALUE}};',
987 ),
988 )
989 );
990
991 $this->add_control(
992 'scroll_to_offset',
993 array(
994 'label' => __( 'Scroll After Pagination/Filter', 'premium-addons-for-elementor' ),
995 'type' => Controls_Manager::SWITCHER,
996 'description' => __( 'Enable this option to scroll to top offset of the widget after click pagination or filter tabs.', 'premium-addons-for-elementor' ),
997 'default' => 'yes',
998 'conditions' => array(
999 'relation' => 'or',
1000 'terms' => array(
1001 array(
1002 'name' => 'premium_blog_cat_tabs',
1003 'value' => 'yes',
1004 ),
1005 array(
1006 'name' => 'premium_blog_paging',
1007 'value' => 'yes',
1008 ),
1009 ),
1010 ),
1011 'frontend_available' => true,
1012 )
1013 );
1014
1015 $this->end_controls_section();
1016
1017 $this->start_controls_section(
1018 'premium_blog_posts_options',
1019 array(
1020 'label' => __( 'Post Options', 'premium-addons-for-elementor' ),
1021 )
1022 );
1023
1024 $this->add_control(
1025 'premium_blog_excerpt',
1026 array(
1027 'label' => __( 'Show Post Content', 'premium-addons-for-elementor' ),
1028 'type' => Controls_Manager::SWITCHER,
1029 'default' => 'yes',
1030 )
1031 );
1032
1033 $this->add_control(
1034 'content_source',
1035 array(
1036 'label' => __( 'Get Content From', 'premium-addons-for-elementor' ),
1037 'type' => Controls_Manager::SELECT,
1038 'options' => array(
1039 'excerpt' => __( 'Post Excerpt', 'premium-addons-for-elementor' ),
1040 'full' => __( 'Post Full Content', 'premium-addons-for-elementor' ),
1041 ),
1042 'default' => 'excerpt',
1043 'label_block' => true,
1044 'condition' => array(
1045 'premium_blog_excerpt' => 'yes',
1046 ),
1047 )
1048 );
1049
1050 $this->add_control(
1051 'premium_blog_excerpt_length',
1052 array(
1053 'label' => __( 'Excerpt Length', 'premium-addons-for-elementor' ),
1054 'type' => Controls_Manager::NUMBER,
1055 'default' => 22,
1056 'condition' => array(
1057 'premium_blog_excerpt' => 'yes',
1058 'content_source' => 'excerpt',
1059 ),
1060 )
1061 );
1062
1063 $this->add_control(
1064 'excerpt_length_apply',
1065 array(
1066 'label' => __( 'Apply On Posts With Excerpt Set', 'premium-addons-for-elementor' ),
1067 'description' => __( 'Enable this option if you want the excerpt length to be also applied on posts with the Excerpt field set.', 'premium-addons-for-elementor' ),
1068 'type' => Controls_Manager::SWITCHER,
1069 'condition' => array(
1070 'premium_blog_excerpt' => 'yes',
1071 'content_source' => 'excerpt',
1072 ),
1073 )
1074 );
1075
1076 $this->add_control(
1077 'premium_blog_excerpt_type',
1078 array(
1079 'label' => __( 'Excerpt Type', 'premium-addons-for-elementor' ),
1080 'type' => Controls_Manager::SELECT,
1081 'options' => array(
1082 'dots' => __( 'Dots', 'premium-addons-for-elementor' ),
1083 'link' => __( 'Read More', 'premium-addons-for-elementor' ),
1084 ),
1085 'default' => 'dots',
1086 'label_block' => true,
1087 'condition' => array(
1088 'premium_blog_excerpt' => 'yes',
1089 ),
1090 )
1091 );
1092
1093 $this->add_control(
1094 'read_more_full_width',
1095 array(
1096 'label' => __( 'Full Width', 'premium-addons-for-elementor' ),
1097 'type' => Controls_Manager::SWITCHER,
1098 'prefix_class' => 'premium-blog-cta-full-',
1099 'condition' => array(
1100 'premium_blog_excerpt' => 'yes',
1101 'premium_blog_excerpt_type' => 'link',
1102 ),
1103 )
1104 );
1105
1106 $this->add_control(
1107 'premium_blog_excerpt_text',
1108 array(
1109 'label' => __( 'Read More Text', 'premium-addons-for-elementor' ),
1110 'type' => Controls_Manager::TEXT,
1111 'default' => __( 'Read More »', 'premium-addons-for-elementor' ),
1112 'condition' => array(
1113 'premium_blog_excerpt' => 'yes',
1114 'premium_blog_excerpt_type' => 'link',
1115 ),
1116 )
1117 );
1118
1119 $this->add_control(
1120 'premium_blog_author_meta',
1121 array(
1122 'label' => __( 'Author Meta', 'premium-addons-for-elementor' ),
1123 'type' => Controls_Manager::SWITCHER,
1124 'default' => 'yes',
1125 )
1126 );
1127
1128 $this->add_control(
1129 'premium_blog_date_meta',
1130 array(
1131 'label' => __( 'Date Meta', 'premium-addons-for-elementor' ),
1132 'type' => Controls_Manager::SWITCHER,
1133 'default' => 'yes',
1134 )
1135 );
1136
1137 $this->add_control(
1138 'premium_blog_categories_meta',
1139 array(
1140 'label' => __( 'Categories Meta', 'premium-addons-for-elementor' ),
1141 'type' => Controls_Manager::SWITCHER,
1142 'description' => __( 'Display or hide categories meta', 'premium-addons-for-elementor' ),
1143 'default' => 'yes',
1144 )
1145 );
1146
1147 $this->add_control(
1148 'premium_blog_comments_meta',
1149 array(
1150 'label' => __( 'Comments Meta', 'premium-addons-for-elementor' ),
1151 'description' => __( 'Display or hide comments meta', 'premium-addons-for-elementor' ),
1152 'type' => Controls_Manager::SWITCHER,
1153 'default' => 'yes',
1154 )
1155 );
1156
1157 $this->add_control(
1158 'premium_blog_tags_meta',
1159 array(
1160 'label' => __( 'Tags Meta', 'premium-addons-for-elementor' ),
1161 'type' => Controls_Manager::SWITCHER,
1162 'description' => __( 'Display or hide post tags', 'premium-addons-for-elementor' ),
1163 )
1164 );
1165
1166 $this->end_controls_section();
1167
1168 $this->start_controls_section(
1169 'premium_blog_advanced_settings',
1170 array(
1171 'label' => __( 'Advanced Settings', 'premium-addons-for-elementor' ),
1172 )
1173 );
1174
1175 $this->add_control(
1176 'premium_blog_infinite_scroll',
1177 array(
1178 'label' => __( 'Load More Posts On Scroll', 'premium-addons-for-elementor' ),
1179 'type' => Controls_Manager::SWITCHER,
1180 'condition' => array(
1181 'premium_blog_carousel!' => 'yes',
1182 'premium_blog_paging!' => 'yes',
1183 'premium_blog_layout!' => 'marquee',
1184 ),
1185 'frontend_available' => true,
1186 )
1187 );
1188
1189 $this->add_control(
1190 'premium_blog_cat_tabs',
1191 array(
1192 'label' => __( 'Filter Tabs', 'premium-addons-for-elementor' ),
1193 'type' => Controls_Manager::SWITCHER,
1194 'condition' => array(
1195 'premium_blog_carousel!' => 'yes',
1196 'premium_blog_layout!' => 'marquee',
1197 ),
1198 )
1199 );
1200
1201 $this->add_control(
1202 'premium_blog_article_tag_switcher',
1203 array(
1204 'label' => __( 'Change Post Html Tag To Article', 'premium-addons-for-elementor' ),
1205 'type' => Controls_Manager::SWITCHER,
1206 )
1207 );
1208
1209 $this->add_control(
1210 'filter_tabs_type',
1211 array(
1212 'label' => __( 'Get Tabs From', 'premium-addons-for-elementor' ),
1213 'type' => Premium_Tax_Filter::TYPE,
1214 'default' => 'category',
1215 'condition' => array(
1216 'premium_blog_cat_tabs' => 'yes',
1217 'premium_blog_carousel!' => 'yes',
1218 'premium_blog_layout!' => 'marquee',
1219 ),
1220 )
1221 );
1222
1223 $this->add_control(
1224 'filter_tabs_notice',
1225 array(
1226 'raw' => __( 'Please make sure to select the categories/tags you need to show from Query tab.', 'premium-addons-for-elementor' ),
1227 'type' => Controls_Manager::RAW_HTML,
1228 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
1229 'condition' => array(
1230 'premium_blog_cat_tabs' => 'yes',
1231 'premium_blog_carousel!' => 'yes',
1232 'premium_blog_layout!' => 'marquee',
1233 ),
1234 )
1235 );
1236
1237 $this->add_control(
1238 'premium_blog_tab_label',
1239 array(
1240 'label' => __( 'First Tab Label', 'premium-addons-for-elementor' ),
1241 'type' => Controls_Manager::TEXT,
1242 'default' => __( 'All', 'premium-addons-for-elementor' ),
1243 'condition' => array(
1244 'premium_blog_cat_tabs' => 'yes',
1245 'premium_blog_carousel!' => 'yes',
1246 'premium_blog_layout!' => 'marquee',
1247 ),
1248 )
1249 );
1250
1251 $this->add_responsive_control(
1252 'premium_blog_filter_align',
1253 array(
1254 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
1255 'type' => Controls_Manager::CHOOSE,
1256 'options' => array(
1257 'flex-start' => array(
1258 'title' => __( 'Start', 'premium-addons-for-elementor' ),
1259 'icon' => is_rtl() ? 'eicon-text-align-right' : 'eicon-text-align-left',
1260 ),
1261 'center' => array(
1262 'title' => __( 'Center', 'premium-addons-for-elementor' ),
1263 'icon' => 'eicon-text-align-center',
1264 ),
1265 'flex-end' => array(
1266 'title' => __( 'End', 'premium-addons-for-elementor' ),
1267 'icon' => is_rtl() ? 'eicon-text-align-left' : 'eicon-text-align-right',
1268 ),
1269 ),
1270 'default' => 'center',
1271 'toggle' => false,
1272 'condition' => array(
1273 'premium_blog_cat_tabs' => 'yes',
1274 'premium_blog_carousel!' => 'yes',
1275 'premium_blog_layout!' => 'marquee',
1276 ),
1277 'selectors' => array(
1278 '{{WRAPPER}} .premium-blog-filter' => 'justify-content: {{VALUE}};',
1279 ),
1280 )
1281 );
1282
1283 $this->add_control(
1284 'filter_flag',
1285 array(
1286 'label' => __( 'URL Flag', 'premium-addons-for-elementor' ),
1287 'type' => Controls_Manager::TEXT,
1288 'description' => __( 'This is used to activate specific filter tab using links on other pages. For example: your-domain.com/?cat=2', 'premium-addons-for-elementor' ),
1289 'default' => 'cat',
1290 'label_block' => true,
1291 'frontend_available' => true,
1292 'condition' => array(
1293 'premium_blog_cat_tabs' => 'yes',
1294 'premium_blog_carousel!' => 'yes',
1295 'premium_blog_layout!' => 'marquee',
1296 ),
1297 'ai' => array(
1298 'active' => false,
1299 ),
1300 )
1301 );
1302
1303 $this->add_control(
1304 'premium_blog_new_tab',
1305 array(
1306 'label' => __( 'Links in New Tab', 'premium-addons-for-elementor' ),
1307 'type' => Controls_Manager::SWITCHER,
1308 'description' => __( 'Enable links to be opened in a new tab', 'premium-addons-for-elementor' ),
1309 'default' => 'yes',
1310 )
1311 );
1312
1313 $this->end_controls_section();
1314
1315 $this->start_controls_section(
1316 'premium_blog_carousel_settings',
1317 array(
1318 'label' => __( 'Carousel', 'premium-addons-for-elementor' ),
1319 'condition' => array(
1320 'premium_blog_infinite_scroll!' => 'yes',
1321 'premium_blog_paging!' => 'yes',
1322 'premium_blog_layout!' => 'marquee',
1323 ),
1324 )
1325 );
1326
1327 $this->add_control(
1328 'premium_blog_carousel',
1329 array(
1330 'label' => __( 'Enable Carousel', 'premium-addons-for-elementor' ),
1331 'type' => Controls_Manager::SWITCHER,
1332 'prefix_class' => 'premium-blog__carousel-',
1333 'render_type' => 'template',
1334 'frontend_available' => true,
1335 )
1336 );
1337
1338 $this->add_control(
1339 'overflow_slides',
1340 array(
1341 'label' => __( 'Overflow Slides', 'premium-addons-for-elementor' ),
1342 'render_type' => 'template',
1343 'type' => Controls_Manager::SWITCHER,
1344 'selectors' => array(
1345 '{{WRAPPER}} .slick-list' => 'overflow: visible;',
1346 'body' => 'overflow-x: hidden;',
1347 ),
1348 'condition' => array(
1349 'premium_blog_carousel' => 'yes',
1350 ),
1351 'frontend_available' => true,
1352 )
1353 );
1354
1355 $this->add_control(
1356 'premium_blog_carousel_fade',
1357 array(
1358 'label' => __( 'Fade', 'premium-addons-for-elementor' ),
1359 'type' => Controls_Manager::SWITCHER,
1360 'condition' => array(
1361 'premium_blog_carousel' => 'yes',
1362 'premium_blog_columns_number' => '100%',
1363 'overflow_slides!' => 'yes',
1364 ),
1365 'frontend_available' => true,
1366 )
1367 );
1368
1369 $this->add_control(
1370 'premium_blog_carousel_play',
1371 array(
1372 'label' => __( 'Autoplay Slides', 'premium-addons-for-elementor' ),
1373 'type' => Controls_Manager::SWITCHER,
1374 'condition' => array(
1375 'premium_blog_carousel' => 'yes',
1376 ),
1377 'frontend_available' => true,
1378 )
1379 );
1380
1381 $this->add_control(
1382 'slides_to_scroll',
1383 array(
1384 'label' => __( 'Slides To Scroll', 'premium-addons-for-elementor' ),
1385 'type' => Controls_Manager::NUMBER,
1386 'condition' => array(
1387 'premium_blog_carousel' => 'yes',
1388 ),
1389 'frontend_available' => true,
1390 )
1391 );
1392
1393 $this->add_control(
1394 'premium_blog_carousel_autoplay_speed',
1395 array(
1396 'label' => __( 'Autoplay Speed', 'premium-addons-for-elementor' ),
1397 'description' => __( 'Autoplay Speed means at which time the next slide should come. Set a value in milliseconds (ms)', 'premium-addons-for-elementor' ),
1398 'type' => Controls_Manager::NUMBER,
1399 'default' => 5000,
1400 'condition' => array(
1401 'premium_blog_carousel' => 'yes',
1402 'premium_blog_carousel_play' => 'yes',
1403 ),
1404 'frontend_available' => true,
1405 )
1406 );
1407
1408 $this->add_control(
1409 'carousel_speed',
1410 array(
1411 'label' => __( 'Transition Speed (ms)', 'premium-addons-for-elementor' ),
1412 'description' => __( 'Set the speed of the carousel animation in milliseconds (ms)', 'premium-addons-for-elementor' ),
1413 'type' => Controls_Manager::NUMBER,
1414 'default' => 300,
1415 'render_type' => 'template',
1416 'selectors' => array(
1417 '{{WRAPPER}} .premium-blog-wrap .slick-slide' => 'transition: all {{VALUE}}ms !important',
1418 ),
1419 'condition' => array(
1420 'premium_blog_carousel' => 'yes',
1421 ),
1422 'frontend_available' => true,
1423 )
1424 );
1425
1426 $this->add_control(
1427 'premium_blog_carousel_center',
1428 array(
1429 'label' => __( 'Center Mode', 'premium-addons-for-elementor' ),
1430 'type' => Controls_Manager::SWITCHER,
1431 'condition' => array(
1432 'premium_blog_carousel' => 'yes',
1433 'overflow_slides!' => 'yes',
1434 ),
1435 'frontend_available' => true,
1436 )
1437 );
1438
1439 $this->add_control(
1440 'premium_blog_carousel_spacing',
1441 array(
1442 'label' => __( 'Slides\' Spacing', 'premium-addons-for-elementor' ),
1443 'description' => __( 'Set a spacing value in pixels (px)', 'premium-addons-for-elementor' ),
1444 'type' => Controls_Manager::NUMBER,
1445 'default' => '15',
1446 'condition' => array(
1447 'premium_blog_carousel' => 'yes',
1448 'overflow_slides!' => 'yes',
1449 ),
1450 'frontend_available' => true,
1451 )
1452 );
1453
1454 $this->add_control(
1455 'premium_blog_carousel_dots',
1456 array(
1457 'label' => __( 'Navigation Dots', 'premium-addons-for-elementor' ),
1458 'type' => Controls_Manager::SWITCHER,
1459 'condition' => array(
1460 'premium_blog_carousel' => 'yes',
1461 ),
1462 'frontend_available' => true,
1463 )
1464 );
1465
1466 $this->add_control(
1467 'premium_blog_carousel_arrows',
1468 array(
1469 'label' => __( 'Navigation Arrows', 'premium-addons-for-elementor' ),
1470 'type' => Controls_Manager::SWITCHER,
1471 'default' => 'yes',
1472 'condition' => array(
1473 'premium_blog_carousel' => 'yes',
1474 ),
1475 'frontend_available' => true,
1476 )
1477 );
1478
1479 $this->add_control(
1480 'arrows_position',
1481 array(
1482 'label' => __( 'Position', 'premium-addons-for-elementor' ),
1483 'type' => Controls_Manager::CHOOSE,
1484 'options' => array(
1485 'above' => array(
1486 'title' => __( 'Above Slide', 'premium-addons-for-elementor' ),
1487 'icon' => 'eicon-v-align-top',
1488 ),
1489 'default' => array(
1490 'title' => __( 'Center', 'premium-addons-for-elementor' ),
1491 'icon' => 'eicon-h-align-center',
1492 ),
1493 'below' => array(
1494 'title' => __( 'Below Slides', 'premium-addons-for-elementor' ),
1495 'icon' => 'eicon-v-align-bottom',
1496 ),
1497 ),
1498 'default' => 'default',
1499 'toggle' => false,
1500 'condition' => array(
1501 'premium_blog_carousel' => 'yes',
1502 'premium_blog_carousel_arrows' => 'yes',
1503 ),
1504 'frontend_available' => true,
1505 )
1506 );
1507
1508 $this->add_control(
1509 'arrows_alignment',
1510 array(
1511 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
1512 'type' => Controls_Manager::CHOOSE,
1513 'options' => array(
1514 'start' => array(
1515 'title' => __( 'Start', 'premium-addons-for-elementor' ),
1516 'icon' => 'eicon-h-align-left',
1517 ),
1518 'center' => array(
1519 'title' => __( 'Center', 'premium-addons-for-elementor' ),
1520 'icon' => 'eicon-v-align-middle',
1521 ),
1522 'end' => array(
1523 'title' => __( 'End', 'premium-addons-for-elementor' ),
1524 'icon' => 'eicon-h-align-right',
1525 ),
1526 ),
1527 'default' => 'start',
1528 'toggle' => false,
1529 'condition' => array(
1530 'premium_blog_carousel' => 'yes',
1531 'premium_blog_carousel_arrows' => 'yes',
1532 'arrows_position!' => 'default',
1533 ),
1534 'selectors' => array(
1535 '{{WRAPPER}} .premium-carousel-arrows-wrapper' => 'justify-content: {{VALUE}}',
1536 ),
1537 )
1538 );
1539
1540 $this->add_responsive_control(
1541 'arrows_gap',
1542 array(
1543 'label' => __( 'Spacing', 'premium-addons-for-elementor' ),
1544 'type' => Controls_Manager::SLIDER,
1545 'size_units' => array( 'px', 'em', '%', 'custom' ),
1546 'selectors' => array(
1547 '{{WRAPPER}} .premium-carousel-arrows-wrapper' => 'gap: {{SIZE}}{{UNIT}}',
1548 ),
1549 'condition' => array(
1550 'premium_blog_carousel' => 'yes',
1551 'premium_blog_carousel_arrows' => 'yes',
1552 'arrows_position!' => 'default',
1553 ),
1554 )
1555 );
1556
1557 $this->add_responsive_control(
1558 'arrows_margin',
1559 array(
1560 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1561 'type' => Controls_Manager::DIMENSIONS,
1562 'size_units' => array( 'px', 'em', '%', 'custom' ),
1563 'selectors' => array(
1564 '{{WRAPPER}} .premium-carousel-arrows-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1565 ),
1566 'condition' => array(
1567 'premium_blog_carousel' => 'yes',
1568 'premium_blog_carousel_arrows' => 'yes',
1569 'arrows_position!' => 'default',
1570 ),
1571 )
1572 );
1573
1574 $this->add_responsive_control(
1575 'premium_blog_carousel_arrows_pos',
1576 array(
1577 'label' => __( 'Arrows Position', 'premium-addons-for-elementor' ),
1578 'type' => Controls_Manager::SLIDER,
1579 'size_units' => array( 'px', 'em' ),
1580 'range' => array(
1581 'px' => array(
1582 'min' => -100,
1583 'max' => 100,
1584 ),
1585 'em' => array(
1586 'min' => -10,
1587 'max' => 10,
1588 ),
1589 ),
1590 'condition' => array(
1591 'premium_blog_carousel' => 'yes',
1592 'premium_blog_carousel_arrows' => 'yes',
1593 'arrows_position' => 'default',
1594 ),
1595 'selectors' => array(
1596 '{{WRAPPER}}.premium-blog__carousel-yes a.carousel-arrow.carousel-next' => 'right: {{SIZE}}{{UNIT}};',
1597 '{{WRAPPER}}.premium-blog__carousel-yes a.carousel-arrow.carousel-prev' => 'left: {{SIZE}}{{UNIT}};',
1598 ),
1599 )
1600 );
1601
1602 $this->end_controls_section();
1603
1604 $this->start_controls_section(
1605 'premium_blog_pagination_section',
1606 array(
1607 'label' => __( 'Pagination', 'premium-addons-for-elementor' ),
1608 'condition' => array(
1609 'premium_blog_carousel!' => 'yes',
1610 'premium_blog_layout!' => 'marquee',
1611 'premium_blog_infinite_scroll!' => 'yes',
1612 ),
1613 )
1614 );
1615
1616 $this->add_control(
1617 'premium_blog_paging',
1618 array(
1619 'label' => __( 'Enable Pagination', 'premium-addons-for-elementor' ),
1620 'type' => Controls_Manager::SWITCHER,
1621 'description' => __( 'Pagination is the process of dividing the posts into discrete pages', 'premium-addons-for-elementor' ),
1622 )
1623 );
1624
1625 $this->add_control(
1626 'max_pages',
1627 array(
1628 'label' => __( 'Page Limit', 'premium-addons-for-elementor' ),
1629 'type' => Controls_Manager::NUMBER,
1630 'default' => 5,
1631 'condition' => array(
1632 'premium_blog_paging' => 'yes',
1633 ),
1634 )
1635 );
1636
1637 $this->add_control(
1638 'pagination_strings',
1639 array(
1640 'label' => __( 'Enable Pagination Next/Prev Strings', 'premium-addons-for-elementor' ),
1641 'type' => Controls_Manager::SWITCHER,
1642 'default' => 'yes',
1643 'condition' => array(
1644 'premium_blog_paging' => 'yes',
1645 ),
1646 )
1647 );
1648
1649 $this->add_control(
1650 'premium_blog_prev_text',
1651 array(
1652 'label' => __( 'Previous Page String', 'premium-addons-for-elementor' ),
1653 'type' => Controls_Manager::TEXT,
1654 'default' => __( 'Previous', 'premium-addons-for-elementor' ),
1655 'condition' => array(
1656 'premium_blog_paging' => 'yes',
1657 'pagination_strings' => 'yes',
1658 ),
1659 )
1660 );
1661
1662 $this->add_control(
1663 'premium_blog_next_text',
1664 array(
1665 'label' => __( 'Next Page String', 'premium-addons-for-elementor' ),
1666 'type' => Controls_Manager::TEXT,
1667 'default' => __( 'Next', 'premium-addons-for-elementor' ),
1668 'condition' => array(
1669 'premium_blog_paging' => 'yes',
1670 'pagination_strings' => 'yes',
1671 ),
1672 )
1673 );
1674
1675 $this->add_responsive_control(
1676 'premium_blog_pagination_align',
1677 array(
1678 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
1679 'type' => Controls_Manager::CHOOSE,
1680 'options' => array(
1681 'left' => array(
1682 'title' => __( 'Start', 'premium-addons-for-elementor' ),
1683 'icon' => is_rtl() ? 'eicon-text-align-right' : 'eicon-text-align-left',
1684 ),
1685 'center' => array(
1686 'title' => __( 'Center', 'premium-addons-for-elementor' ),
1687 'icon' => 'eicon-text-align-center',
1688 ),
1689 'right' => array(
1690 'title' => __( 'End', 'premium-addons-for-elementor' ),
1691 'icon' => is_rtl() ? 'eicon-text-align-left' : 'eicon-text-align-right',
1692 ),
1693 ),
1694 'default' => 'right',
1695 'toggle' => false,
1696 'condition' => array(
1697 'premium_blog_paging' => 'yes',
1698 ),
1699 'selectors_dictionary' => array(
1700 'left' => 'start',
1701 'right' => 'end',
1702 ),
1703 'selectors' => array(
1704 '{{WRAPPER}} .premium-blog-pagination-container' => 'text-align: {{VALUE}}',
1705 ),
1706 )
1707 );
1708
1709 $this->end_controls_section();
1710
1711 $this->start_controls_section(
1712 'marquee_section',
1713 array(
1714 'label' => __( 'Marquee Settings', 'premium-addons-for-elementor' ),
1715 'condition' => array(
1716 'premium_blog_layout' => 'marquee',
1717 ),
1718 )
1719 );
1720
1721 $this->add_control(
1722 'marquee_direction',
1723 array(
1724 'label' => __( 'Animation Direction', 'premium-addons-for-elementor' ),
1725 'type' => Controls_Manager::SELECT,
1726 'default' => 'normal',
1727 'options' => array(
1728 'normal' => __( 'Normal', 'premium-addons-for-elementor' ),
1729 'reverse' => __( 'Reverse', 'premium-addons-for-elementor' ),
1730 ),
1731 'render_type' => 'template',
1732 'frontend_available' => true,
1733 )
1734 );
1735
1736 $this->add_control(
1737 'marquee_speed',
1738 array(
1739 'label' => __( 'Speed', 'premium-addons-for-elementor' ),
1740 'type' => Controls_Manager::NUMBER,
1741 'description' => __( 'The smaller the value, the faster the animation.', 'premium-addons-for-elementor' ),
1742 'default' => 50,
1743 'render_type' => 'template',
1744 'frontend_available' => true,
1745 )
1746 );
1747
1748 $this->add_control(
1749 'marquee_draggable',
1750 array(
1751 'label' => __( 'Make it Draggable', 'premium-addons-for-elementor' ),
1752 'type' => Controls_Manager::SWITCHER,
1753 'default' => 'yes',
1754 'frontend_available' => true,
1755 )
1756 );
1757
1758 $this->add_control(
1759 'marquee_draggable_notice',
1760 array(
1761 'raw' => __( 'Draggable option works on the frontend only.', 'premium-addons-for-elementor' ),
1762 'type' => Controls_Manager::RAW_HTML,
1763 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
1764 'condition' => array(
1765 'marquee_draggable' => 'yes',
1766 ),
1767 )
1768 );
1769
1770 $this->add_control(
1771 'fading_color',
1772 array(
1773 'label' => __( 'Fading Color', 'premium-addons-for-elementor' ),
1774 'type' => Controls_Manager::COLOR,
1775 'selectors' => array(
1776 '{{WRAPPER}} .premium-blog-marquee:after' => 'background:linear-gradient(to right, {{VALUE}}, #F291D800 10%, #F291D800 90%, {{VALUE}}) !important',
1777 ),
1778 )
1779 );
1780
1781 $this->end_controls_section();
1782
1783 $this->start_controls_section(
1784 'section_pa_docs',
1785 array(
1786 'label' => __( 'Help & Docs', 'premium-addons-for-elementor' ),
1787 )
1788 );
1789
1790 $docs = array(
1791 'https://premiumaddons.com/docs/elementor-blog-widget-tutorial/' => __( 'Getting started »', 'premium-addons-for-elementor' ),
1792 // 'https://premiumaddons.com/docs/link-filter-tabs-elementor-blog-widget/' => __( 'How to link filter tabs in Blog widget »', 'premium-addons-for-elementor' ),
1793 );
1794
1795 $doc_index = 1;
1796 foreach ( $docs as $url => $title ) {
1797
1798 $doc_url = Helper_Functions::get_campaign_link( $url, 'blog-widget', 'wp-editor', 'get-support' );
1799
1800 $this->add_control(
1801 'doc_' . $doc_index,
1802 array(
1803 'type' => Controls_Manager::RAW_HTML,
1804 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc_url, $title ),
1805 'content_classes' => 'editor-pa-doc',
1806 )
1807 );
1808
1809 ++$doc_index;
1810
1811 }
1812
1813 Helper_Functions::register_element_feedback_controls( $this );
1814
1815 $this->end_controls_section();
1816
1817 Helper_Functions::register_papro_promotion_controls( $this, 'blog' );
1818
1819 $this->start_controls_section(
1820 'premium_blog_filter_style',
1821 array(
1822 'label' => __( 'Filter', 'premium-addons-for-elementor' ),
1823 'tab' => Controls_Manager::TAB_STYLE,
1824 'condition' => array(
1825 'premium_blog_cat_tabs' => 'yes',
1826 'premium_blog_carousel!' => 'yes',
1827 'premium_blog_layout!' => 'marquee',
1828 ),
1829 )
1830 );
1831
1832 $this->add_group_control(
1833 Group_Control_Typography::get_type(),
1834 array(
1835 'name' => 'premium_blog_filter_typo',
1836 'global' => array(
1837 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1838 ),
1839 'selector' => '{{WRAPPER}} .premium-blog-filters-container li a.category',
1840 )
1841 );
1842
1843 $this->start_controls_tabs( 'tabs_filter' );
1844
1845 $this->start_controls_tab(
1846 'tab_filter_normal',
1847 array(
1848 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
1849 )
1850 );
1851
1852 $this->add_control(
1853 'premium_blog_filter_color',
1854 array(
1855 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1856 'type' => Controls_Manager::COLOR,
1857 'global' => array(
1858 'default' => Global_Colors::COLOR_SECONDARY,
1859 ),
1860 'selectors' => array(
1861 '{{WRAPPER}} .premium-blog-filters-container li a.category' => 'color: {{VALUE}};',
1862 ),
1863 )
1864 );
1865
1866 $this->add_control(
1867 'premium_blog_background_color',
1868 array(
1869 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1870 'type' => Controls_Manager::COLOR,
1871 'global' => array(
1872 'default' => Global_Colors::COLOR_PRIMARY,
1873 ),
1874 'selectors' => array(
1875 '{{WRAPPER}} .premium-blog-filters-container li a.category' => 'background-color: {{VALUE}};',
1876 ),
1877 )
1878 );
1879
1880 $this->add_group_control(
1881 Group_Control_Border::get_type(),
1882 array(
1883 'name' => 'premium_blog_filter_border',
1884 'selector' => '{{WRAPPER}} .premium-blog-filters-container li a.category',
1885 )
1886 );
1887
1888 $this->add_control(
1889 'premium_blog_filter_border_radius',
1890 array(
1891 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1892 'type' => Controls_Manager::SLIDER,
1893 'size_units' => array( 'px', 'em', '%' ),
1894 'selectors' => array(
1895 '{{WRAPPER}} .premium-blog-filters-container li a.category' => 'border-radius: {{SIZE}}{{UNIT}};',
1896 ),
1897 'separator' => 'after',
1898 )
1899 );
1900
1901 $this->end_controls_tab();
1902
1903 $this->start_controls_tab(
1904 'tab_filter_active',
1905 array(
1906 'label' => __( 'Active', 'premium-addons-for-elementor' ),
1907 )
1908 );
1909
1910 $this->add_control(
1911 'premium_blog_filter_active_color',
1912 array(
1913 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1914 'type' => Controls_Manager::COLOR,
1915 'global' => array(
1916 'default' => Global_Colors::COLOR_PRIMARY,
1917 ),
1918 'selectors' => array(
1919 '{{WRAPPER}} .premium-blog-filters-container li a.active' => 'color: {{VALUE}};',
1920 ),
1921 )
1922 );
1923
1924 $this->add_control(
1925 'premium_blog_background_active_color',
1926 array(
1927 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1928 'type' => Controls_Manager::COLOR,
1929 'global' => array(
1930 'default' => Global_Colors::COLOR_SECONDARY,
1931 ),
1932 'selectors' => array(
1933 '{{WRAPPER}} .premium-blog-filters-container li a.active' => 'background-color: {{VALUE}};',
1934 ),
1935 )
1936 );
1937
1938 $this->add_group_control(
1939 Group_Control_Border::get_type(),
1940 array(
1941 'name' => 'filter_active_border',
1942 'selector' => '{{WRAPPER}} .premium-blog-filters-container li a.active',
1943 )
1944 );
1945
1946 $this->add_control(
1947 'filter_active_border_radius',
1948 array(
1949 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1950 'type' => Controls_Manager::SLIDER,
1951 'size_units' => array( 'px', 'em', '%' ),
1952 'selectors' => array(
1953 '{{WRAPPER}} .premium-blog-filters-container li a.active' => 'border-radius: {{SIZE}}{{UNIT}}',
1954 ),
1955 'separator' => 'after',
1956 )
1957 );
1958
1959 $this->end_controls_tab();
1960
1961 $this->end_controls_tabs();
1962
1963 $this->add_group_control(
1964 Group_Control_Box_Shadow::get_type(),
1965 array(
1966 'name' => 'premium_blog_filter_shadow',
1967 'selector' => '{{WRAPPER}} .premium-blog-filters-container li a.category',
1968 )
1969 );
1970
1971 $this->add_responsive_control(
1972 'premium_blog_filter_margin',
1973 array(
1974 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1975 'type' => Controls_Manager::DIMENSIONS,
1976 'size_units' => array( 'px', 'em', '%' ),
1977 'selectors' => array(
1978 '{{WRAPPER}} .premium-blog-filters-container li a.category' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1979 ),
1980 )
1981 );
1982
1983 $this->add_responsive_control(
1984 'premium_blog_filter_padding',
1985 array(
1986 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
1987 'type' => Controls_Manager::DIMENSIONS,
1988 'size_units' => array( 'px', 'em', '%' ),
1989 'selectors' => array(
1990 '{{WRAPPER}} .premium-blog-filters-container li a.category' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1991 ),
1992 )
1993 );
1994
1995 $this->end_controls_section();
1996
1997 $this->start_controls_section(
1998 'premium_blog_image_style_section',
1999 array(
2000 'label' => __( 'Image', 'premium-addons-for-elementor' ),
2001 'tab' => Controls_Manager::TAB_STYLE,
2002 'condition' => $featured_image_conditions,
2003 )
2004 );
2005
2006 $this->add_control(
2007 'premium_blog_plus_color',
2008 array(
2009 'label' => __( 'Plus Sign Color', 'premium-addons-for-elementor' ),
2010 'type' => Controls_Manager::COLOR,
2011 'selectors' => array(
2012 '{{WRAPPER}} .premium-blog-thumbnail-container:before, {{WRAPPER}} .premium-blog-thumbnail-container:after' => 'background-color: {{VALUE}} !important',
2013 ),
2014 'condition' => array(
2015 'premium_blog_skin' => array( 'modern', 'cards' ),
2016 ),
2017 )
2018 );
2019
2020 $this->add_control(
2021 'premium_blog_overlay_color',
2022 array(
2023 'label' => __( 'Overlay Color', 'premium-addons-for-elementor' ),
2024 'type' => Controls_Manager::COLOR,
2025 'selectors' => array(
2026 '{{WRAPPER}} .premium-blog-framed-effect, {{WRAPPER}} .premium-blog-bordered-effect, {{WRAPPER}} .premium-blog-squares-effect:before, {{WRAPPER}} .premium-blog-squares-effect:after, {{WRAPPER}} .premium-blog-squares-square-container:before, {{WRAPPER}} .premium-blog-squares-square-container:after, {{WRAPPER}} .premium-blog-thumbnail-overlay' => 'background-color: {{VALUE}};',
2027 ),
2028 )
2029 );
2030
2031 $this->add_control(
2032 'premium_blog_border_effect_color',
2033 array(
2034 'label' => __( 'Border Color', 'premium-addons-for-elementor' ),
2035 'type' => Controls_Manager::COLOR,
2036 'global' => array(
2037 'default' => Global_Colors::COLOR_SECONDARY,
2038 ),
2039 'condition' => array(
2040 'premium_blog_hover_color_effect' => 'bordered',
2041 ),
2042 'selectors' => array(
2043 '{{WRAPPER}} .premium-blog-post-link:before, {{WRAPPER}} .premium-blog-post-link:after' => 'border-color: {{VALUE}};',
2044 ),
2045 )
2046 );
2047
2048 $this->add_group_control(
2049 Group_Control_Css_Filter::get_type(),
2050 array(
2051 'name' => 'css_filters',
2052 'selector' => '{{WRAPPER}} .premium-blog-thumbnail-container img',
2053 )
2054 );
2055
2056 $this->add_group_control(
2057 Group_Control_Css_Filter::get_type(),
2058 array(
2059 'name' => 'hover_css_filters',
2060 'label' => __( 'Hover CSS Filters', 'premium-addons-for-elementor' ),
2061 'selector' => '{{WRAPPER}} .premium-blog-post-container:hover .premium-blog-thumbnail-container img',
2062 )
2063 );
2064
2065 $this->add_control(
2066 'divider_heading',
2067 array(
2068 'label' => __( 'Shape Divider', 'premium-addons-for-elementor' ),
2069 'type' => Controls_Manager::HEADING,
2070 'separator' => 'before',
2071 'condition' => array(
2072 'show_featured_image' => 'yes',
2073 'shape_divider!' => 'none',
2074 ),
2075 )
2076 );
2077
2078 $this->add_control(
2079 'divider_fill_color',
2080 array(
2081 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2082 'type' => Controls_Manager::COLOR,
2083 'selectors' => array(
2084 '{{WRAPPER}} .premium-blog-masked .premium-blog-thumbnail-container svg' => 'fill: {{VALUE}}',
2085 ),
2086 'condition' => array(
2087 'show_featured_image' => 'yes',
2088 'shape_divider!' => 'none',
2089 ),
2090 )
2091 );
2092
2093 $this->add_responsive_control(
2094 'divider_width',
2095 array(
2096 'label' => __( 'Width', 'premium-addons-for-elementor' ),
2097 'type' => Controls_Manager::SLIDER,
2098 'size_units' => array( 'px', 'em', '%' ),
2099 'range' => array(
2100 'px' => array(
2101 'min' => 0,
2102 'max' => 1000,
2103 ),
2104 ),
2105 'selectors' => array(
2106 '{{WRAPPER}} .premium-blog-masked .premium-blog-thumbnail-container svg' => 'width: {{SIZE}}{{UNIT}}',
2107 ),
2108 'condition' => array(
2109 'show_featured_image' => 'yes',
2110 'shape_divider!' => 'none',
2111 ),
2112 )
2113 );
2114
2115 $this->add_responsive_control(
2116 'divider_height',
2117 array(
2118 'label' => __( 'Height', 'premium-addons-for-elementor' ),
2119 'type' => Controls_Manager::SLIDER,
2120 'size_units' => array( 'px', 'em', '%' ),
2121 'range' => array(
2122 'px' => array(
2123 'min' => 0,
2124 'max' => 300,
2125 ),
2126 ),
2127 'selectors' => array(
2128 '{{WRAPPER}} .premium-blog-masked .premium-blog-thumbnail-container svg' => 'height: {{SIZE}}{{UNIT}}',
2129 ),
2130 'condition' => array(
2131 'show_featured_image' => 'yes',
2132 'shape_divider!' => 'none',
2133 ),
2134 )
2135 );
2136
2137 $is_rtl = is_rtl() ? 'right' : 'left';
2138
2139 $this->add_responsive_control(
2140 'divider_horizontal',
2141 array(
2142 'label' => __( 'Horizontal Postion', 'premium-addons-for-elementor' ),
2143 'type' => Controls_Manager::SLIDER,
2144 'size_units' => array( 'px', 'em', '%' ),
2145 'range' => array(
2146 'px' => array(
2147 'min' => 0,
2148 'max' => 300,
2149 ),
2150 ),
2151 'selectors' => array(
2152 '{{WRAPPER}} .premium-blog-masked .premium-blog-thumbnail-container svg' => $is_rtl . ': {{SIZE}}{{UNIT}}',
2153 ),
2154 'condition' => array(
2155 'show_featured_image' => 'yes',
2156 'shape_divider!' => 'none',
2157 ),
2158 )
2159 );
2160
2161 $this->add_responsive_control(
2162 'divider_vertical',
2163 array(
2164 'label' => __( 'Vertical Postion', 'premium-addons-for-elementor' ),
2165 'type' => Controls_Manager::SLIDER,
2166 'size_units' => array( 'px', 'em', '%' ),
2167 'range' => array(
2168 'px' => array(
2169 'min' => -50,
2170 'max' => 300,
2171 ),
2172 ),
2173 'selectors' => array(
2174 '{{WRAPPER}} .premium-blog-masked .premium-blog-thumbnail-container svg' => 'bottom: {{SIZE}}{{UNIT}}',
2175 ),
2176 'condition' => array(
2177 'show_featured_image' => 'yes',
2178 'shape_divider!' => 'none',
2179 ),
2180 )
2181 );
2182
2183 $this->end_controls_section();
2184
2185 $this->start_controls_section(
2186 'author_image_style_section',
2187 array(
2188 'label' => __( 'Author Image', 'premium-addons-for-elementor' ),
2189 'tab' => Controls_Manager::TAB_STYLE,
2190 'condition' => array(
2191 'premium_blog_skin' => 'cards',
2192 'premium_blog_author_img_switcher' => 'yes',
2193 ),
2194 )
2195 );
2196
2197 $this->add_control(
2198 'author_img_size',
2199 array(
2200 'label' => __( 'Author Image Size', 'premium-addons-for-elementor' ),
2201 'type' => Controls_Manager::SLIDER,
2202 'selectors' => array(
2203 '{{WRAPPER}} .premium-blog-author-thumbnail img' => 'width: {{SIZE}}px',
2204 ),
2205 ),
2206 );
2207
2208 $this->add_responsive_control(
2209 'author_img_position',
2210 array(
2211 'label' => __( 'Author Image Position', 'premium-addons-for-elementor' ),
2212 'type' => Controls_Manager::SLIDER,
2213 'range' => array(
2214 'px' => array(
2215 'min' => -100,
2216 'max' => 100,
2217 ),
2218 ),
2219 'selectors' => array(
2220 '{{WRAPPER}} .premium-blog-author-thumbnail' => 'top: {{SIZE}}px',
2221 ),
2222 ),
2223 );
2224
2225 $this->add_group_control(
2226 Group_Control_Border::get_type(),
2227 array(
2228 'name' => 'author_image_border',
2229 'selector' => '{{WRAPPER}} .premium-blog-author-thumbnail img',
2230 )
2231 );
2232
2233 $this->add_control(
2234 'author_image_border_radius',
2235 array(
2236 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2237 'type' => Controls_Manager::SLIDER,
2238 'size_units' => array( 'px', 'em', '%' ),
2239 'selectors' => array(
2240 '{{WRAPPER}} .premium-blog-author-thumbnail img' => 'border-radius: {{SIZE}}{{UNIT}};',
2241 ),
2242 )
2243 );
2244
2245 $this->end_controls_section();
2246
2247 $this->start_controls_section(
2248 'premium_blog_title_style_section',
2249 array(
2250 'label' => __( 'Title', 'premium-addons-for-elementor' ),
2251 'tab' => Controls_Manager::TAB_STYLE,
2252 )
2253 );
2254
2255 $this->add_group_control(
2256 Group_Control_Typography::get_type(),
2257 array(
2258 'name' => 'premium_blog_title_typo',
2259 'global' => array(
2260 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
2261 ),
2262 'selector' => '{{WRAPPER}} .premium-blog-entry-title, {{WRAPPER}} .premium-blog-entry-title a',
2263 )
2264 );
2265
2266 $this->add_control(
2267 'premium_blog_title_color',
2268 array(
2269 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2270 'type' => Controls_Manager::COLOR,
2271 'global' => array(
2272 'default' => Global_Colors::COLOR_SECONDARY,
2273 ),
2274 'selectors' => array(
2275 '{{WRAPPER}} .premium-blog-entry-title a' => 'color: {{VALUE}};',
2276 ),
2277 )
2278 );
2279
2280 $this->add_control(
2281 'premium_blog_title_hover_color',
2282 array(
2283 'label' => __( 'Hover Color', 'premium-addons-for-elementor' ),
2284 'type' => Controls_Manager::COLOR,
2285 'global' => array(
2286 'default' => Global_Colors::COLOR_PRIMARY,
2287 ),
2288 'selectors' => array(
2289 '{{WRAPPER}} .premium-blog-entry-title:hover a' => 'color: {{VALUE}};',
2290 ),
2291 )
2292 );
2293
2294 $this->add_responsive_control(
2295 'title_spacing',
2296 array(
2297 'label' => __( 'Bottom Spacing', 'premium-addons-for-elementor' ),
2298 'type' => Controls_Manager::SLIDER,
2299 'size_units' => array( 'px', 'em', '%' ),
2300 'selectors' => array(
2301 '{{WRAPPER}} .premium-blog-entry-title' => 'margin-bottom: {{SIZE}}{{UNIT}}',
2302 ),
2303 )
2304 );
2305
2306 $this->end_controls_section();
2307
2308 $this->start_controls_section(
2309 'post_categories_style_section',
2310 array(
2311 'label' => __( 'Categories', 'premium-addons-for-elementor' ),
2312 'tab' => Controls_Manager::TAB_STYLE,
2313 'condition' => array(
2314 'premium_blog_skin' => array( 'side', 'banner' ),
2315 'premium_blog_categories_meta' => 'yes',
2316 ),
2317 )
2318 );
2319
2320 $this->add_group_control(
2321 Group_Control_Typography::get_type(),
2322 array(
2323 'name' => 'category_typography',
2324 'global' => array(
2325 'default' => Global_Typography::TYPOGRAPHY_SECONDARY,
2326 ),
2327 'selector' => '{{WRAPPER}} .premium-blog-cats-container a',
2328 )
2329 );
2330
2331 $repeater = new REPEATER();
2332
2333 $repeater->add_control(
2334 'category_color',
2335 array(
2336 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2337 'type' => Controls_Manager::COLOR,
2338 'selectors' => array(
2339 '{{WRAPPER}} {{CURRENT_ITEM}}' => 'color: {{VALUE}}',
2340 ),
2341 )
2342 );
2343
2344 $repeater->add_control(
2345 'category_hover_color',
2346 array(
2347 'label' => __( 'Hover Color', 'premium-addons-for-elementor' ),
2348 'type' => Controls_Manager::COLOR,
2349 'selectors' => array(
2350 '{{WRAPPER}} {{CURRENT_ITEM}}:hover' => 'color: {{VALUE}}',
2351 ),
2352 )
2353 );
2354
2355 $repeater->add_control(
2356 'category_background_color',
2357 array(
2358 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2359 'type' => Controls_Manager::COLOR,
2360 'selectors' => array(
2361 '{{WRAPPER}} {{CURRENT_ITEM}}' => 'background-color: {{VALUE}}',
2362 ),
2363 )
2364 );
2365
2366 $repeater->add_control(
2367 'category_hover_background_color',
2368 array(
2369 'label' => __( 'Hover Background Color', 'premium-addons-for-elementor' ),
2370 'type' => Controls_Manager::COLOR,
2371 'selectors' => array(
2372 '{{WRAPPER}} {{CURRENT_ITEM}}:hover' => 'background-color: {{VALUE}}',
2373 ),
2374 )
2375 );
2376
2377 $repeater->add_group_control(
2378 Group_Control_Border::get_type(),
2379 array(
2380 'name' => 'category_border',
2381 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}',
2382 )
2383 );
2384
2385 $repeater->add_control(
2386 'category_border_radius',
2387 array(
2388 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2389 'type' => Controls_Manager::SLIDER,
2390 'size_units' => array( 'px', 'em', '%' ),
2391 'selectors' => array(
2392 '{{WRAPPER}} {{CURRENT_ITEM}}' => 'border-radius: {{SIZE}}{{UNIT}};',
2393 ),
2394 )
2395 );
2396
2397 $this->add_control(
2398 'categories_repeater',
2399 array(
2400 'label' => __( 'Categories', 'premium-addons-for-elementor' ),
2401 'type' => Controls_Manager::REPEATER,
2402 'fields' => $repeater->get_controls(),
2403 'default' => array(
2404 array(
2405 'category_background_color' => '',
2406 ),
2407 ),
2408 'render_type' => 'ui',
2409 'condition' => array(
2410 'premium_blog_skin' => array( 'side', 'banner' ),
2411 'premium_blog_categories_meta' => 'yes',
2412 ),
2413 )
2414 );
2415
2416 $this->add_responsive_control(
2417 'categories_margin',
2418 array(
2419 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
2420 'type' => Controls_Manager::DIMENSIONS,
2421 'size_units' => array( 'px', 'em', '%' ),
2422 'selectors' => array(
2423 '{{WRAPPER}} .premium-blog-cats-container a' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2424 ),
2425 )
2426 );
2427
2428 $this->add_responsive_control(
2429 'categories_padding',
2430 array(
2431 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2432 'type' => Controls_Manager::DIMENSIONS,
2433 'size_units' => array( 'px', 'em', '%' ),
2434 'selectors' => array(
2435 '{{WRAPPER}} .premium-blog-cats-container a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2436 ),
2437 )
2438 );
2439
2440 $this->end_controls_section();
2441
2442 $this->start_controls_section(
2443 'premium_blog_meta_style_section',
2444 array(
2445 'label' => __( 'Metadata', 'premium-addons-for-elementor' ),
2446 'tab' => Controls_Manager::TAB_STYLE,
2447 )
2448 );
2449
2450 $this->add_group_control(
2451 Group_Control_Typography::get_type(),
2452 array(
2453 'name' => 'premium_blog_meta_typo',
2454 'global' => array(
2455 'default' => Global_Typography::TYPOGRAPHY_SECONDARY,
2456 ),
2457 'selector' => '{{WRAPPER}} .premium-blog-meta-data',
2458 )
2459 );
2460
2461 $this->add_control(
2462 'premium_blog_meta_color',
2463 array(
2464 'label' => __( 'Metadata Color', 'premium-addons-for-elementor' ),
2465 'type' => Controls_Manager::COLOR,
2466 'selectors' => array(
2467 '{{WRAPPER}} .premium-blog-meta-data > *' => 'color: {{VALUE}}',
2468 ),
2469 )
2470 );
2471
2472 $this->add_control(
2473 'premium_blog_meta_hover_color',
2474 array(
2475 'label' => __( 'Links Hover Color', 'premium-addons-for-elementor' ),
2476 'type' => Controls_Manager::COLOR,
2477 'selectors' => array(
2478 '{{WRAPPER}} .premium-blog-meta-data:not(.premium-blog-post-time):hover > *' => 'color: {{VALUE}}',
2479 ),
2480 )
2481 );
2482
2483 $this->add_control(
2484 'separator_color',
2485 array(
2486 'label' => __( 'Separator Color', 'premium-addons-for-elementor' ),
2487 'type' => Controls_Manager::COLOR,
2488 'separator' => 'before',
2489 'selectors' => array(
2490 '{{WRAPPER}} .premium-blog-meta-separator' => 'color: {{VALUE}}',
2491 ),
2492 )
2493 );
2494
2495 $this->end_controls_section();
2496
2497 $this->start_controls_section(
2498 'premium_blog_content_style_section',
2499 array(
2500 'label' => __( 'Content Box', 'premium-addons-for-elementor' ),
2501 'tab' => Controls_Manager::TAB_STYLE,
2502 )
2503 );
2504
2505 $this->add_group_control(
2506 Group_Control_Typography::get_type(),
2507 array(
2508 'name' => 'premium_blog_content_typo',
2509 'selector' => '{{WRAPPER}} .premium-blog-post-content',
2510 'condition' => array(
2511 'content_source' => 'excerpt',
2512 ),
2513 )
2514 );
2515
2516 $this->add_control(
2517 'premium_blog_post_content_color',
2518 array(
2519 'label' => __( 'Text Color', 'premium-addons-for-elementor' ),
2520 'type' => Controls_Manager::COLOR,
2521 'global' => array(
2522 'default' => Global_Colors::COLOR_TEXT,
2523 ),
2524 'selectors' => array(
2525 '{{WRAPPER}} .premium-blog-post-content' => 'color: {{VALUE}};',
2526 ),
2527 'condition' => array(
2528 'content_source' => 'excerpt',
2529 ),
2530 )
2531 );
2532
2533 $this->add_responsive_control(
2534 'excerpt_text_margin',
2535 array(
2536 'label' => __( 'Text Margin', 'premium-addons-for-elementor' ),
2537 'type' => Controls_Manager::DIMENSIONS,
2538 'size_units' => array( 'px', 'em', '%' ),
2539 'selectors' => array(
2540 '{{WRAPPER}} .premium-blog-post-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2541 ),
2542 'condition' => array(
2543 'content_source' => 'excerpt',
2544 ),
2545 )
2546 );
2547
2548 $this->add_control(
2549 'premium_blog_content_background_color',
2550 array(
2551 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2552 'type' => Controls_Manager::COLOR,
2553 'separator' => 'before',
2554 'selectors' => array(
2555 '{{WRAPPER}} .premium-blog-content-wrapper' => 'background-color: {{VALUE}};',
2556 ),
2557 'condition' => array(
2558 'premium_blog_skin!' => 'banner',
2559 ),
2560 )
2561 );
2562
2563 $this->add_group_control(
2564 Premium_Background::get_type(),
2565 array(
2566 'name' => 'premium_blog_content_background_color',
2567 'types' => array( 'classic', 'gradient' ),
2568 'selector' => '{{WRAPPER}} .premium-blog-content-wrapper',
2569 'condition' => array(
2570 'premium_blog_skin' => 'banner',
2571 ),
2572 )
2573 );
2574
2575 $this->add_group_control(
2576 Group_Control_Box_Shadow::get_type(),
2577 array(
2578 'name' => 'premium_blog_box_shadow',
2579 'selector' => '{{WRAPPER}} .premium-blog-content-wrapper',
2580 )
2581 );
2582
2583 $this->add_responsive_control(
2584 'prmeium_blog_content_margin',
2585 array(
2586 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
2587 'type' => Controls_Manager::DIMENSIONS,
2588 'size_units' => array( 'px', 'em', '%' ),
2589 'selectors' => array(
2590 '{{WRAPPER}} .premium-blog-content-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2591 ),
2592 )
2593 );
2594
2595 $this->add_responsive_control(
2596 'prmeium_blog_content_padding',
2597 array(
2598 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2599 'type' => Controls_Manager::DIMENSIONS,
2600 'size_units' => array( 'px', 'em', '%' ),
2601 'selectors' => array(
2602 '{{WRAPPER}} .premium-blog-content-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2603 ),
2604 )
2605 );
2606
2607 $this->end_controls_section();
2608
2609 $this->start_controls_section(
2610 'premium_blog_read_more_style',
2611 array(
2612 'label' => __( 'Button', 'premium-addons-for-elementor' ),
2613 'tab' => Controls_Manager::TAB_STYLE,
2614 'condition' => array(
2615 'premium_blog_excerpt' => 'yes',
2616 'premium_blog_excerpt_type' => 'link',
2617 ),
2618 )
2619 );
2620
2621 $this->add_group_control(
2622 Group_Control_Typography::get_type(),
2623 array(
2624 'name' => 'premium_blog_read_more_typo',
2625 'selector' => '{{WRAPPER}} .premium-blog-excerpt-link',
2626 )
2627 );
2628
2629 $this->add_responsive_control(
2630 'read_more_spacing',
2631 array(
2632 'label' => __( 'Spacing', 'premium-addons-for-elementor' ),
2633 'type' => Controls_Manager::SLIDER,
2634 'selectors' => array(
2635 '{{WRAPPER}} .premium-blog-excerpt-link' => 'margin-top: {{SIZE}}px',
2636 ),
2637 )
2638 );
2639
2640 $this->start_controls_tabs( 'read_more_style_tabs' );
2641
2642 $this->start_controls_tab(
2643 'read_more_tab_normal',
2644 array(
2645 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
2646
2647 )
2648 );
2649
2650 $this->add_control(
2651 'premium_blog_read_more_color',
2652 array(
2653 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2654 'type' => Controls_Manager::COLOR,
2655 'selectors' => array(
2656 '{{WRAPPER}} .premium-blog-excerpt-link' => 'color: {{VALUE}};',
2657 ),
2658 )
2659 );
2660
2661 $this->add_control(
2662 'read_more_background_color',
2663 array(
2664 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2665 'type' => Controls_Manager::COLOR,
2666 'selectors' => array(
2667 '{{WRAPPER}} .premium-blog-excerpt-link' => 'background-color: {{VALUE}};',
2668 ),
2669 )
2670 );
2671
2672 $this->add_group_control(
2673 Group_Control_Border::get_type(),
2674 array(
2675 'name' => 'read_more_border',
2676 'selector' => '{{WRAPPER}} .premium-blog-excerpt-link',
2677 )
2678 );
2679
2680 $this->add_control(
2681 'read_more_border_radius',
2682 array(
2683 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2684 'type' => Controls_Manager::SLIDER,
2685 'size_units' => array( 'px', 'em', '%' ),
2686 'selectors' => array(
2687 '{{WRAPPER}} .premium-blog-excerpt-link' => 'border-radius: {{SIZE}}{{UNIT}};',
2688 ),
2689 )
2690 );
2691
2692 $this->end_controls_tab();
2693
2694 $this->start_controls_tab(
2695 'read_more_tab_hover',
2696 array(
2697 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
2698 )
2699 );
2700
2701 $this->add_control(
2702 'premium_blog_read_more_hover_color',
2703 array(
2704 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2705 'type' => Controls_Manager::COLOR,
2706 'selectors' => array(
2707 '{{WRAPPER}} .premium-blog-excerpt-link:hover' => 'color: {{VALUE}};',
2708 ),
2709 )
2710 );
2711
2712 $this->add_control(
2713 'read_more_hover_background_color',
2714 array(
2715 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2716 'type' => Controls_Manager::COLOR,
2717 'selectors' => array(
2718 '{{WRAPPER}} .premium-blog-excerpt-link:hover' => 'background-color: {{VALUE}};',
2719 ),
2720 )
2721 );
2722
2723 $this->add_group_control(
2724 Group_Control_Border::get_type(),
2725 array(
2726 'name' => 'read_more_hover_border',
2727 'selector' => '{{WRAPPER}} .premium-blog-excerpt-link:hover',
2728 )
2729 );
2730
2731 $this->add_control(
2732 'read_more_hover_border_radius',
2733 array(
2734 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2735 'type' => Controls_Manager::SLIDER,
2736 'size_units' => array( 'px', 'em', '%' ),
2737 'selectors' => array(
2738 '{{WRAPPER}} .premium-blog-excerpt-link:hover' => 'border-radius: {{SIZE}}{{UNIT}};',
2739 ),
2740 )
2741 );
2742
2743 $this->end_controls_tab();
2744
2745 $this->end_controls_tabs();
2746
2747 $this->add_responsive_control(
2748 'read_more_padding',
2749 array(
2750 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2751 'type' => Controls_Manager::DIMENSIONS,
2752 'size_units' => array( 'px', 'em', '%' ),
2753 'separator' => 'before',
2754 'selectors' => array(
2755 '{{WRAPPER}} .premium-blog-excerpt-link' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2756 ),
2757 )
2758 );
2759
2760 $this->end_controls_section();
2761
2762 $this->start_controls_section(
2763 'premium_blog_tags_style_section',
2764 array(
2765 'label' => __( 'Tags', 'premium-addons-for-elementor' ),
2766 'tab' => Controls_Manager::TAB_STYLE,
2767 'condition' => array(
2768 'premium_blog_tags_meta' => 'yes',
2769 ),
2770 )
2771 );
2772
2773 $this->add_group_control(
2774 Group_Control_Typography::get_type(),
2775 array(
2776 'name' => 'premium_blog_tags_typo',
2777 'global' => array(
2778 'default' => Global_Typography::TYPOGRAPHY_SECONDARY,
2779 ),
2780 'selector' => '{{WRAPPER}} .premium-blog-post-tags-container',
2781 )
2782 );
2783
2784 $this->add_control(
2785 'premium_blog_tags_color',
2786 array(
2787 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2788 'type' => Controls_Manager::COLOR,
2789 'global' => array(
2790 'default' => Global_Colors::COLOR_SECONDARY,
2791 ),
2792 'selectors' => array(
2793 '{{WRAPPER}} .premium-blog-post-tags-container' => 'color: {{VALUE}}',
2794 ),
2795 )
2796 );
2797
2798 $this->add_control(
2799 'premium_blog_tags_hoer_color',
2800 array(
2801 'label' => __( 'Hover Color', 'premium-addons-for-elementor' ),
2802 'type' => Controls_Manager::COLOR,
2803 'selectors' => array(
2804 '{{WRAPPER}} .premium-blog-post-tags-container a:hover' => 'color: {{VALUE}}',
2805 ),
2806 )
2807 );
2808
2809 $this->end_controls_section();
2810
2811 $this->start_controls_section(
2812 'premium_blog_box_style_section',
2813 array(
2814 'label' => __( 'Box', 'premium-addons-for-elementor' ),
2815 'tab' => Controls_Manager::TAB_STYLE,
2816 )
2817 );
2818
2819 $this->add_control(
2820 'premium_blog_box_background_color',
2821 array(
2822 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2823 'type' => Controls_Manager::COLOR,
2824 'default' => '#f5f5f5',
2825 'selectors' => array(
2826 '{{WRAPPER}} .premium-blog-post-container' => 'background-color: {{VALUE}};',
2827 ),
2828 )
2829 );
2830
2831 $this->add_group_control(
2832 Group_Control_Border::get_type(),
2833 array(
2834 'name' => 'box_border',
2835 'selector' => '{{WRAPPER}} .premium-blog-post-container',
2836 )
2837 );
2838
2839 $this->add_control(
2840 'box_border_radius',
2841 array(
2842 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2843 'type' => Controls_Manager::SLIDER,
2844 'size_units' => array( 'px', 'em', '%' ),
2845 'selectors' => array(
2846 '{{WRAPPER}} .premium-blog-post-container' => 'border-radius: {{SIZE}}{{UNIT}};',
2847 ),
2848 'condition' => array(
2849 'box_adv_radius!' => 'yes',
2850 ),
2851 )
2852 );
2853
2854 $this->add_control(
2855 'box_adv_radius',
2856 array(
2857 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ),
2858 'type' => Controls_Manager::SWITCHER,
2859 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>' . __( '. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=S0BJazLHV-M" target="_blank">tutorial</a>',
2860 )
2861 );
2862
2863 $this->add_control(
2864 'box_adv_radius_value',
2865 array(
2866 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2867 'type' => Controls_Manager::TEXT,
2868 'dynamic' => array( 'active' => true ),
2869 'selectors' => array(
2870 '{{WRAPPER}} .premium-blog-post-container' => 'border-radius: {{VALUE}};',
2871 ),
2872 'condition' => array(
2873 'box_adv_radius' => 'yes',
2874 ),
2875 'ai' => array(
2876 'active' => false,
2877 ),
2878 )
2879 );
2880
2881 $this->add_group_control(
2882 Group_Control_Box_Shadow::get_type(),
2883 array(
2884 'name' => 'outer_box_shadow',
2885 'selector' => '{{WRAPPER}} .premium-blog-post-container',
2886 )
2887 );
2888
2889 $this->add_responsive_control(
2890 'prmeium_blog_box_padding',
2891 array(
2892 'label' => __( 'Spacing', 'premium-addons-for-elementor' ),
2893 'type' => Controls_Manager::DIMENSIONS,
2894 'size_units' => array( 'px', 'em', '%' ),
2895 'selectors' => array(
2896 '{{WRAPPER}} .premium-blog-post-outer-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2897 ),
2898 )
2899 );
2900
2901 $this->add_responsive_control(
2902 'prmeium_blog_inner_box_padding',
2903 array(
2904 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2905 'type' => Controls_Manager::DIMENSIONS,
2906 'size_units' => array( 'px', 'em', '%' ),
2907 'selectors' => array(
2908 '{{WRAPPER}} .premium-blog-post-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2909 ),
2910 )
2911 );
2912
2913 $this->end_controls_section();
2914
2915 $this->start_controls_section(
2916 'premium_blog_pagination_Style',
2917 array(
2918 'label' => __( 'Pagination', 'premium-addons-for-elementor' ),
2919 'tab' => Controls_Manager::TAB_STYLE,
2920 'condition' => array(
2921 'premium_blog_paging' => 'yes',
2922 ),
2923 )
2924 );
2925
2926 $this->add_group_control(
2927 Group_Control_Typography::get_type(),
2928 array(
2929 'name' => 'premium_blog_pagination_typo',
2930 'selector' => '{{WRAPPER}} .premium-blog-pagination-container > .page-numbers',
2931 )
2932 );
2933
2934 $this->start_controls_tabs( 'premium_blog_pagination_colors' );
2935
2936 $this->start_controls_tab(
2937 'premium_blog_pagination_nomral',
2938 array(
2939 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
2940
2941 )
2942 );
2943
2944 $this->add_control(
2945 'prmeium_blog_pagination_color',
2946 array(
2947 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2948 'type' => Controls_Manager::COLOR,
2949 'global' => array(
2950 'default' => Global_Colors::COLOR_SECONDARY,
2951 ),
2952 'selectors' => array(
2953 '{{WRAPPER}} .premium-blog-pagination-container .page-numbers' => 'color: {{VALUE}};',
2954 ),
2955 )
2956 );
2957
2958 $this->add_control(
2959 'prmeium_blog_pagination_back_color',
2960 array(
2961 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2962 'type' => Controls_Manager::COLOR,
2963 'global' => array(
2964 'default' => Global_Colors::COLOR_PRIMARY,
2965 ),
2966 'selectors' => array(
2967 '{{WRAPPER}} .premium-blog-pagination-container .page-numbers' => 'background-color: {{VALUE}};',
2968 ),
2969 )
2970 );
2971
2972 $this->add_group_control(
2973 Group_Control_Border::get_type(),
2974 array(
2975 'name' => 'navigation_border',
2976 'separator' => 'before',
2977 'selector' => '{{WRAPPER}} .premium-blog-pagination-container .page-numbers',
2978 )
2979 );
2980
2981 $this->add_control(
2982 'navigation_border_radius',
2983 array(
2984 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2985 'type' => Controls_Manager::SLIDER,
2986 'size_units' => array( 'px', '%', 'em' ),
2987 'selectors' => array(
2988 '{{WRAPPER}} .premium-blog-pagination-container .page-numbers' => 'border-radius: {{SIZE}}{{UNIT}};',
2989 ),
2990 'condition' => array(
2991 'navigation_adv_radius!' => 'yes',
2992 ),
2993 )
2994 );
2995
2996 $this->add_control(
2997 'navigation_adv_radius',
2998 array(
2999 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ),
3000 'type' => Controls_Manager::SWITCHER,
3001 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>' . __( '. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=S0BJazLHV-M" target="_blank">tutorial</a>',
3002 )
3003 );
3004
3005 $this->add_control(
3006 'navigation_adv_radius_value',
3007 array(
3008 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
3009 'type' => Controls_Manager::TEXT,
3010 'dynamic' => array( 'active' => true ),
3011 'selectors' => array(
3012 '{{WRAPPER}} .premium-blog-pagination-container .page-numbers' => 'border-radius: {{VALUE}};',
3013 ),
3014 'condition' => array(
3015 'navigation_adv_radius' => 'yes',
3016 ),
3017 'ai' => array(
3018 'active' => false,
3019 ),
3020 )
3021 );
3022
3023 $this->end_controls_tab();
3024
3025 $this->start_controls_tab(
3026 'premium_blog_pagination_hover',
3027 array(
3028 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
3029
3030 )
3031 );
3032
3033 $this->add_control(
3034 'prmeium_blog_pagination_hover_color',
3035 array(
3036 'label' => __( 'Color', 'premium-addons-for-elementor' ),
3037 'type' => Controls_Manager::COLOR,
3038 'global' => array(
3039 'default' => Global_Colors::COLOR_PRIMARY,
3040 ),
3041 'selectors' => array(
3042 '{{WRAPPER}} .premium-blog-pagination-container .page-numbers:hover' => 'color: {{VALUE}};',
3043 ),
3044 )
3045 );
3046
3047 $this->add_control(
3048 'prmeium_blog_pagination_back_hover_color',
3049 array(
3050 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
3051 'type' => Controls_Manager::COLOR,
3052 'global' => array(
3053 'default' => Global_Colors::COLOR_SECONDARY,
3054 ),
3055 'selectors' => array(
3056 '{{WRAPPER}} .premium-blog-pagination-container .page-numbers:hover' => 'background-color: {{VALUE}};',
3057 ),
3058 )
3059 );
3060
3061 $this->add_group_control(
3062 Group_Control_Border::get_type(),
3063 array(
3064 'name' => 'hover_navigation_border',
3065 'separator' => 'before',
3066 'selector' => '{{WRAPPER}} .premium-blog-pagination-container .page-numbers:hover',
3067 )
3068 );
3069
3070 $this->add_control(
3071 'hover_navigation_border_radius',
3072 array(
3073 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
3074 'type' => Controls_Manager::SLIDER,
3075 'size_units' => array( 'px', '%', 'em' ),
3076 'selectors' => array(
3077 '{{WRAPPER}} .premium-blog-pagination-container .page-numbers:hover' => 'border-radius: {{SIZE}}{{UNIT}};',
3078 ),
3079 'condition' => array(
3080 'hover_navigation_adv_radius!' => 'yes',
3081 ),
3082 )
3083 );
3084
3085 $this->add_control(
3086 'hover_navigation_adv_radius',
3087 array(
3088 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ),
3089 'type' => Controls_Manager::SWITCHER,
3090 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>' . __( '. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=S0BJazLHV-M" target="_blank">tutorial</a>',
3091 )
3092 );
3093
3094 $this->add_control(
3095 'hover_navigation_adv_radius_value',
3096 array(
3097 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
3098 'type' => Controls_Manager::TEXT,
3099 'dynamic' => array( 'active' => true ),
3100 'selectors' => array(
3101 '{{WRAPPER}} .premium-blog-pagination-container .page-numbers:hover' => 'border-radius: {{VALUE}};',
3102 ),
3103 'condition' => array(
3104 'hover_navigation_adv_radius' => 'yes',
3105 ),
3106 'ai' => array(
3107 'active' => false,
3108 ),
3109 )
3110 );
3111
3112 $this->end_controls_tab();
3113
3114 $this->start_controls_tab(
3115 'premium_blog_pagination_active',
3116 array(
3117 'label' => __( 'Active', 'premium-addons-for-elementor' ),
3118
3119 )
3120 );
3121
3122 $this->add_control(
3123 'prmeium_blog_pagination_active_color',
3124 array(
3125 'label' => __( 'Color', 'premium-addons-for-elementor' ),
3126 'type' => Controls_Manager::COLOR,
3127 'global' => array(
3128 'default' => Global_Colors::COLOR_PRIMARY,
3129 ),
3130 'selectors' => array(
3131 '{{WRAPPER}} .premium-blog-pagination-container span.current' => 'color: {{VALUE}};',
3132 ),
3133 )
3134 );
3135
3136 $this->add_control(
3137 'prmeium_blog_pagination_back_active_color',
3138 array(
3139 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
3140 'type' => Controls_Manager::COLOR,
3141 'global' => array(
3142 'default' => Global_Colors::COLOR_SECONDARY,
3143 ),
3144 'selectors' => array(
3145 '{{WRAPPER}} .premium-blog-pagination-container span.current' => 'background-color: {{VALUE}};',
3146 ),
3147 )
3148 );
3149
3150 $this->add_group_control(
3151 Group_Control_Border::get_type(),
3152 array(
3153 'name' => 'active_navigation_border',
3154 'separator' => 'before',
3155 'selector' => '{{WRAPPER}} .premium-blog-pagination-container span.current',
3156 )
3157 );
3158
3159 $this->add_control(
3160 'active_navigation_border_radius',
3161 array(
3162 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
3163 'type' => Controls_Manager::SLIDER,
3164 'size_units' => array( 'px', '%', 'em' ),
3165 'selectors' => array(
3166 '{{WRAPPER}} .premium-blog-pagination-container span.current' => 'border-radius: {{SIZE}}{{UNIT}};',
3167 ),
3168 'condition' => array(
3169 'active_navigation_adv_radius!' => 'yes',
3170 ),
3171 )
3172 );
3173
3174 $this->add_control(
3175 'active_navigation_adv_radius',
3176 array(
3177 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ),
3178 'type' => Controls_Manager::SWITCHER,
3179 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>' . __( '. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=S0BJazLHV-M" target="_blank">tutorial</a>',
3180 )
3181 );
3182
3183 $this->add_control(
3184 'active_navigation_adv_radius_value',
3185 array(
3186 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
3187 'type' => Controls_Manager::TEXT,
3188 'dynamic' => array( 'active' => true ),
3189 'selectors' => array(
3190 '{{WRAPPER}} .premium-blog-pagination-container span.current' => 'border-radius: {{VALUE}};',
3191 ),
3192 'condition' => array(
3193 'active_navigation_adv_radius' => 'yes',
3194 ),
3195 'ai' => array(
3196 'active' => false,
3197 ),
3198 )
3199 );
3200
3201 $this->end_controls_tab();
3202
3203 $this->end_controls_tabs();
3204
3205 $this->add_responsive_control(
3206 'prmeium_blog_pagination_margin',
3207 array(
3208 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
3209 'type' => Controls_Manager::DIMENSIONS,
3210 'size_units' => array( 'px', 'em', '%' ),
3211 'separator' => 'before',
3212 'selectors' => array(
3213 '{{WRAPPER}} .premium-blog-pagination-container .page-numbers' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3214 ),
3215 )
3216 );
3217
3218 $this->add_responsive_control(
3219 'prmeium_blog_pagination_padding',
3220 array(
3221 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
3222 'type' => Controls_Manager::DIMENSIONS,
3223 'size_units' => array( 'px', 'em', '%' ),
3224 'selectors' => array(
3225 '{{WRAPPER}} .premium-blog-pagination-container .page-numbers' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3226 ),
3227 )
3228 );
3229
3230 $this->add_control(
3231 'pagination_overlay_color',
3232 array(
3233 'label' => __( 'Overlay Color', 'premium-addons-for-elementor' ),
3234 'type' => Controls_Manager::COLOR,
3235 'separator' => 'before',
3236 'selectors' => array(
3237 '{{WRAPPER}} .premium-loading-feed' => 'background-color: {{VALUE}}',
3238 ),
3239 )
3240 );
3241
3242 $this->add_control(
3243 'spinner_color',
3244 array(
3245 'label' => __( 'Spinner Color', 'premium-addons-for-elementor' ),
3246 'type' => Controls_Manager::COLOR,
3247 'selectors' => array(
3248 '{{WRAPPER}} .premium-loader' => 'border-color: {{VALUE}}',
3249 ),
3250 )
3251 );
3252
3253 $this->add_control(
3254 'spinner_fill_color',
3255 array(
3256 'label' => __( 'Fill Color', 'premium-addons-for-elementor' ),
3257 'type' => Controls_Manager::COLOR,
3258 'selectors' => array(
3259 '{{WRAPPER}} .premium-loader' => 'border-top-color: {{VALUE}}',
3260 ),
3261 )
3262 );
3263
3264 $this->end_controls_section();
3265
3266 $this->start_controls_section(
3267 'carousel_dots_style',
3268 array(
3269 'label' => __( 'Carousel Dots', 'premium-addons-for-elementor' ),
3270 'tab' => Controls_Manager::TAB_STYLE,
3271 'condition' => array(
3272 'premium_blog_carousel' => 'yes',
3273 'premium_blog_carousel_dots' => 'yes',
3274 'premium_blog_layout!' => 'marquee',
3275 ),
3276 )
3277 );
3278
3279 $this->add_control(
3280 'carousel_dot_navigation_color',
3281 array(
3282 'label' => __( 'Color', 'premium-addons-for-elementor' ),
3283 'type' => Controls_Manager::COLOR,
3284 'global' => array(
3285 'default' => Global_Colors::COLOR_SECONDARY,
3286 ),
3287 'selectors' => array(
3288 '{{WRAPPER}} ul.slick-dots li' => 'color: {{VALUE}}',
3289 ),
3290 )
3291 );
3292
3293 $this->add_control(
3294 'carousel_dot_navigation_active_color',
3295 array(
3296 'label' => __( 'Active Color', 'premium-addons-for-elementor' ),
3297 'type' => Controls_Manager::COLOR,
3298 'global' => array(
3299 'default' => Global_Colors::COLOR_PRIMARY,
3300 ),
3301 'selectors' => array(
3302 '{{WRAPPER}} ul.slick-dots li.slick-active' => 'color: {{VALUE}}',
3303 ),
3304 )
3305 );
3306
3307 $this->end_controls_section();
3308
3309 $this->start_controls_section(
3310 'carousel_arrows_style',
3311 array(
3312 'label' => __( 'Carousel Arrows', 'premium-addons-for-elementor' ),
3313 'tab' => Controls_Manager::TAB_STYLE,
3314 'condition' => array(
3315 'premium_blog_carousel' => 'yes',
3316 'premium_blog_carousel_arrows' => 'yes',
3317 'premium_blog_layout!' => 'marquee',
3318 ),
3319 )
3320 );
3321
3322 $this->add_control(
3323 'arrow_color',
3324 array(
3325 'label' => __( 'Color', 'premium-addons-for-elementor' ),
3326 'type' => Controls_Manager::COLOR,
3327 'global' => array(
3328 'default' => Global_Colors::COLOR_PRIMARY,
3329 ),
3330 'selectors' => array(
3331 '{{WRAPPER}}.premium-blog__carousel-yes .slick-arrow' => 'color: {{VALUE}};',
3332 ),
3333 )
3334 );
3335
3336 $this->add_control(
3337 'disabled_arrow_color',
3338 array(
3339 'label' => __( 'Disabled Color', 'premium-addons-for-elementor' ),
3340 'type' => Controls_Manager::COLOR,
3341 'selectors' => array(
3342 '{{WRAPPER}}.premium-blog__carousel-yes .slick-arrow.slick-disabled' => 'color: {{VALUE}};',
3343 '{{WRAPPER}}.premium-blog__carousel-yes .slick-arrow.slick-disabled svg' => 'fill: {{VALUE}};',
3344 ),
3345 'condition' => array(
3346 'overflow_slides' => 'yes',
3347 ),
3348 )
3349 );
3350
3351 $this->add_responsive_control(
3352 'premium_blog_carousel_arrow_size',
3353 array(
3354 'label' => __( 'Size', 'premium-addons-for-elementor' ),
3355 'type' => Controls_Manager::SLIDER,
3356 'size_units' => array( 'px', '%', 'em' ),
3357 'selectors' => array(
3358 '{{WRAPPER}}.premium-blog__carousel-yes .slick-arrow i' => 'font-size: {{SIZE}}{{UNIT}};',
3359 ),
3360 )
3361 );
3362
3363 $this->add_control(
3364 'premium_blog_carousel_arrow_background',
3365 array(
3366 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
3367 'type' => Controls_Manager::COLOR,
3368 'global' => array(
3369 'default' => Global_Colors::COLOR_SECONDARY,
3370 ),
3371 'selectors' => array(
3372 '{{WRAPPER}}.premium-blog__carousel-yes .slick-arrow' => 'background-color: {{VALUE}};',
3373 ),
3374 )
3375 );
3376
3377 $this->add_control(
3378 'disabled_arrow_background',
3379 array(
3380 'label' => __( 'Disabled Background Color', 'premium-addons-for-elementor' ),
3381 'type' => Controls_Manager::COLOR,
3382 'selectors' => array(
3383 '{{WRAPPER}}.premium-blog__carousel-yes .slick-arrow.slick-disabled' => 'background-color: {{VALUE}};',
3384 ),
3385 'condition' => array(
3386 'overflow_slides' => 'yes',
3387 ),
3388 )
3389 );
3390
3391 $this->add_control(
3392 'premium_blog_carousel_border_radius',
3393 array(
3394 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
3395 'type' => Controls_Manager::SLIDER,
3396 'size_units' => array( 'px', '%', 'em' ),
3397 'selectors' => array(
3398 '{{WRAPPER}}.premium-blog__carousel-yes .slick-arrow' => 'border-radius: {{SIZE}}{{UNIT}};',
3399 ),
3400 )
3401 );
3402
3403 $this->add_control(
3404 'premium_blog_carousel_arrow_padding',
3405 array(
3406 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
3407 'type' => Controls_Manager::SLIDER,
3408 'size_units' => array( 'px', '%', 'em' ),
3409 'selectors' => array(
3410 '{{WRAPPER}}.premium-blog__carousel-yes .slick-arrow' => 'padding: {{SIZE}}{{UNIT}};',
3411 ),
3412 )
3413 );
3414
3415 $this->end_controls_section();
3416 }
3417
3418
3419 /**
3420 * Get Filter Array.
3421 *
3422 * Returns an array of filters
3423 *
3424 * @since 3.20.8
3425 * @access protected
3426 *
3427 * @param string $filter filter rule.
3428 *
3429 * @return array
3430 */
3431 public function get_filter_array( $filter ) {
3432
3433 $settings = $this->get_settings();
3434
3435 $current_language = apply_filters( 'wpml_current_language', '-' );
3436
3437 $post_type = $settings['post_type_filter'];
3438
3439 if ( 'tag' === $filter ) {
3440 $filter = 'post_tag';
3441 }
3442
3443 $filter_rule = isset( $settings[ $filter . '_' . $post_type . '_filter_rule' ] ) ? $settings[ $filter . '_' . $post_type . '_filter_rule' ] : '';
3444
3445 // Fix: Make sure there is a value set for the current tax control.
3446 if ( empty( $filter_rule ) ) {
3447 return;
3448 }
3449
3450 $filters = $settings[ 'tax_' . $filter . '_' . $post_type . '_filter' ];
3451
3452 // Get the categories based on filter source.
3453 $taxs = get_terms( $filter );
3454
3455 $tabs_array = array();
3456
3457 if ( is_wp_error( $taxs ) ) {
3458 return array();
3459 }
3460
3461 if ( empty( $filters ) || '' === $filters ) {
3462
3463 $tabs_array = $taxs;
3464
3465 } else {
3466
3467 foreach ( $taxs as $key => $value ) {
3468
3469 $slug = str_replace( '-' . $current_language, '', $value->slug );
3470
3471 $if_empty = empty( array_intersect( array( $slug, $value->slug ), $filters ) );
3472
3473 if ( 'IN' === $filter_rule ) {
3474
3475 if ( ! $if_empty ) {
3476
3477 $tabs_array[] = $value;
3478 }
3479 } elseif ( $if_empty ) {
3480
3481 $tabs_array[] = $value;
3482 }
3483 }
3484 }
3485
3486 return $tabs_array;
3487 }
3488
3489 /**
3490 * Get Filter Tabs Markup
3491 *
3492 * @since 3.11.2
3493 * @access protected
3494 */
3495 protected function get_filter_tabs_markup( $filters ) {
3496
3497 $settings = $this->get_settings();
3498
3499 if ( empty( $filters ) ) {
3500 return;
3501 }
3502
3503 ?>
3504 <div class="premium-blog-filter">
3505 <ul class="premium-blog-filters-container">
3506 <?php if ( ! empty( $settings['premium_blog_tab_label'] ) ) : ?>
3507 <li>
3508 <a href="javascript:;" class="category active" data-filter="*">
3509 <?php echo esc_html( $settings['premium_blog_tab_label'] ); ?>
3510 </a>
3511 </li>
3512 <?php endif; ?>
3513 <?php
3514 foreach ( $filters as $index => $filter ) {
3515 $key = 'blog_category_' . $index;
3516
3517 $this->add_render_attribute( $key, 'class', 'category' );
3518
3519 if ( empty( $settings['premium_blog_tab_label'] ) && 0 === $index ) {
3520 $this->add_render_attribute( $key, 'class', 'active' );
3521 }
3522 ?>
3523 <li>
3524 <a href="javascript:;" <?php $this->print_render_attribute_string( $key ); ?> data-filter="<?php echo esc_attr( $filter->slug ); ?>">
3525 <?php echo wp_kses_post( $filter->name ); ?>
3526 </a>
3527 </li>
3528 <?php } ?>
3529 </ul>
3530 </div>
3531 <?php
3532 }
3533
3534 /**
3535 * Render Blog output on the frontend.
3536 *
3537 * Written in PHP and used to generate the final HTML.
3538 *
3539 * @since 0.0.1
3540 * @access protected
3541 */
3542 protected function render() {
3543
3544 $settings = $this->get_settings();
3545
3546 $settings['widget_type'] = 'premium-addon-blog';
3547 $settings['widget_id'] = $this->get_id();
3548 $settings['active_cat'] = '';
3549
3550 $blog_helper = Blog_Helper::getInstance();
3551
3552 if ( 'yes' === $settings['premium_blog_cat_tabs'] && 'yes' !== $settings['premium_blog_carousel'] && 'marquee' !== $settings['premium_blog_layout'] ) {
3553
3554 $filter_rule = $settings['filter_tabs_type'];
3555
3556 $filters = $this->get_filter_array( $filter_rule );
3557
3558 if ( ! empty( $filters ) && empty( $settings['premium_blog_tab_label'] ) ) {
3559 $settings['active_cat'] = $filters[0]->slug;
3560 }
3561 }
3562
3563 $blog_helper->set_widget_settings( $settings, $settings['active_cat'] );
3564
3565 $query = $blog_helper->get_query_posts();
3566
3567 if ( ! $query->have_posts() ) {
3568
3569 $query_notice = $settings['empty_query_text'];
3570
3571 Helper_Functions::render_empty_query_message( $query_notice );
3572 return;
3573 }
3574
3575 if ( 'yes' === $settings['premium_blog_paging'] ) {
3576
3577 $total_pages = $query->max_num_pages;
3578
3579 if ( ! empty( $settings['max_pages'] ) ) {
3580 $total_pages = min( $settings['max_pages'], $total_pages );
3581 }
3582 }
3583
3584 $masked = 'none' !== $settings['shape_divider'] ? 'premium-blog-masked' : '';
3585
3586 $this->add_render_attribute( 'blog', 'class', array( 'premium-blog-wrap', $masked ) );
3587
3588 if ( 'yes' === $settings['premium_blog_grid'] ) {
3589
3590 $this->add_render_attribute( 'blog', 'class', 'premium-blog-' . $settings['premium_blog_layout'] );
3591
3592 } else {
3593
3594 $this->add_render_attribute( 'blog', 'class', 'premium-blog-list' );
3595
3596 }
3597
3598 $carousel = 'yes' === $settings['premium_blog_carousel'];
3599 if ( $carousel || ( 'yes' === $settings['premium_blog_grid'] && 'marquee' === $settings['premium_blog_layout'] ) ) {
3600 $this->add_render_attribute( 'blog', 'class', 'premium-carousel-hidden' );
3601
3602 }
3603
3604 if ( $carousel ) {
3605 $arrows = 'yes' === $settings['premium_blog_carousel_arrows'];
3606 $arrows_custom_pos = $arrows && 'default' !== $settings['arrows_position'];
3607
3608 if ( $arrows && $arrows_custom_pos ) {
3609 $this->add_render_attribute( 'blog', 'class', 'pa-has-custom-pos' );
3610 }
3611 }
3612
3613 // Add page ID to be used later to get posts by AJAX.
3614 $page_id = '';
3615 if ( null !== Plugin::$instance->documents->get_current() ) {
3616 $page_id = Plugin::$instance->documents->get_current()->get_main_id();
3617 }
3618 $this->add_render_attribute( 'blog', 'data-page', $page_id );
3619
3620 if ( 'yes' === $settings['premium_blog_paging'] && $total_pages > 1 ) {
3621
3622 $this->add_render_attribute( 'blog', 'data-pagination', 'true' );
3623
3624 }
3625
3626 ?>
3627
3628 <?php if ( 'yes' === $settings['premium_blog_cat_tabs'] && 'yes' !== $settings['premium_blog_carousel'] && 'marquee' !== $settings['premium_blog_layout'] ) : ?>
3629 <?php $this->get_filter_tabs_markup( $filters ); ?>
3630 <?php endif; ?>
3631
3632
3633 <?php if ( $carousel && $arrows && 'above' === $settings['arrows_position'] ) { ?>
3634 <div class="premium-carousel-arrows-wrapper"></div>
3635 <?php } ?>
3636 <div <?php $this->print_render_attribute_string( 'blog' ); ?>>
3637 <?php if ( 'yes' === $settings['premium_blog_grid'] && 'marquee' === $settings['premium_blog_layout'] ) : ?>
3638 <div class="premium-marquee-wrapper">
3639 <?php endif; ?>
3640 <?php
3641 $id = $this->get_id();
3642 $blog_helper->render_posts();
3643 ?>
3644 <?php if ( 'yes' === $settings['premium_blog_grid'] && 'marquee' === $settings['premium_blog_layout'] ) : ?>
3645 </div>
3646 <?php endif; ?>
3647 </div>
3648
3649 <?php if ( 'yes' === $settings['premium_blog_paging'] && 'marquee' !== $settings['premium_blog_layout'] && $total_pages > 1 ) : ?>
3650 <div class="premium-blog-footer">
3651 <?php $blog_helper->render_pagination(); ?>
3652 </div>
3653 <?php endif; ?>
3654
3655 <?php if ( $carousel && $arrows && 'below' === $settings['arrows_position'] ) { ?>
3656 <div class="premium-carousel-arrows-wrapper"></div>
3657 <?php } ?>
3658
3659 <?php
3660 if ( Plugin::instance()->editor->is_edit_mode() ) {
3661
3662 if ( 'yes' === $settings['premium_blog_grid'] ) {
3663 if ( 'masonry' === $settings['premium_blog_layout'] && 'yes' !== $settings['premium_blog_carousel'] ) {
3664 $this->render_editor_script();
3665 }
3666 }
3667 }
3668 }
3669
3670 /**
3671 * Render Editor Masonry Script.
3672 *
3673 * @since 3.12.3
3674 * @access protected
3675 */
3676 protected function render_editor_script() {
3677
3678 ?>
3679 <script type="text/javascript">
3680 jQuery( document ).ready( function( $ ) {
3681
3682 $( '.premium-blog-wrap' ).each( function() {
3683
3684 var $node_id = '<?php echo esc_attr( $this->get_id() ); ?>',
3685 scope = $( '[data-id="' + $node_id + '"]' ),
3686 selector = $(this);
3687
3688
3689 if ( selector.closest( scope ).length < 1 ) {
3690 return;
3691 }
3692
3693
3694 var masonryArgs = {
3695 itemSelector : '.premium-blog-post-outer-container',
3696 percentPosition : true,
3697 layoutMode : 'masonry',
3698 };
3699
3700 var $isotopeObj = {};
3701
3702 selector.imagesLoaded( function() {
3703
3704 $isotopeObj = selector.isotope( masonryArgs );
3705
3706 $isotopeObj.imagesLoaded().progress(function() {
3707 $isotopeObj.isotope("layout");
3708 });
3709
3710 selector.find('.premium-blog-post-outer-container').resize( function() {
3711 $isotopeObj.isotope( 'layout' );
3712 });
3713 });
3714
3715 });
3716 });
3717 </script>
3718 <?php
3719 }
3720 }
3721