dep
5 years ago
premium-banner.php
5 years ago
premium-blog.php
5 years ago
premium-button.php
5 years ago
premium-carousel.php
5 years ago
premium-contactform.php
5 years ago
premium-countdown.php
5 years ago
premium-counter.php
5 years ago
premium-dual-header.php
5 years ago
premium-fancytext.php
5 years ago
premium-grid.php
5 years ago
premium-icon-list.php
5 years ago
premium-image-button.php
5 years ago
premium-image-scroll.php
5 years ago
premium-image-separator.php
5 years ago
premium-lottie.php
5 years ago
premium-maps.php
5 years ago
premium-modalbox.php
5 years ago
premium-person.php
5 years ago
premium-pricing-table.php
5 years ago
premium-progressbar.php
5 years ago
premium-testimonials.php
5 years ago
premium-title.php
5 years ago
premium-videobox.php
5 years ago
premium-vscroll.php
5 years ago
premium-blog.php
2648 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Premium Banner. |
| 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\Scheme_Color; |
| 15 | use Elementor\Scheme_Typography; |
| 16 | use Elementor\Group_Control_Background; |
| 17 | use Elementor\Group_Control_Border; |
| 18 | use Elementor\Group_Control_Typography; |
| 19 | use Elementor\Group_Control_Css_Filter; |
| 20 | use Elementor\Group_Control_Box_Shadow; |
| 21 | |
| 22 | // PremiumAddons Classes. |
| 23 | use PremiumAddons\Includes\Premium_Template_Tags as Blog_Helper; |
| 24 | use PremiumAddons\Includes\Helper_Functions; |
| 25 | |
| 26 | if ( ! defined( 'ABSPATH' ) ) exit; // If this file is called directly, abort. |
| 27 | |
| 28 | /** |
| 29 | * Class Premium_Blog |
| 30 | */ |
| 31 | class Premium_Blog extends Widget_Base { |
| 32 | |
| 33 | public function get_name() { |
| 34 | return 'premium-addon-blog'; |
| 35 | } |
| 36 | |
| 37 | public function get_title() { |
| 38 | return sprintf( '%1$s %2$s', Helper_Functions::get_prefix(), __('Blog', 'premium-addons-for-elementor') ); |
| 39 | } |
| 40 | |
| 41 | public function is_reload_preview_required() { |
| 42 | return true; |
| 43 | } |
| 44 | |
| 45 | public function get_style_depends() { |
| 46 | return [ |
| 47 | 'font-awesome-5-all', |
| 48 | 'premium-addons' |
| 49 | ]; |
| 50 | } |
| 51 | |
| 52 | public function get_script_depends() { |
| 53 | return [ |
| 54 | 'isotope-js', |
| 55 | 'jquery-slick', |
| 56 | 'premium-addons' |
| 57 | ]; |
| 58 | } |
| 59 | |
| 60 | public function get_icon() { |
| 61 | return 'pa-blog'; |
| 62 | } |
| 63 | |
| 64 | public function get_keywords() { |
| 65 | return [ 'posts', 'grid', 'item', 'loop', 'query', 'portfolio', 'cpt', 'custom' ]; |
| 66 | } |
| 67 | |
| 68 | public function get_categories() { |
| 69 | return [ 'premium-elements' ]; |
| 70 | } |
| 71 | |
| 72 | |
| 73 | public function get_custom_help_url() { |
| 74 | return 'https://premiumaddons.com/support/'; |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Register Blog controls. |
| 79 | * |
| 80 | * @since 1.0.0 |
| 81 | * @access protected |
| 82 | */ |
| 83 | protected function _register_controls() { |
| 84 | |
| 85 | $this->start_controls_section('general_settings_section', |
| 86 | [ |
| 87 | 'label' => __('General', 'premium-addons-for-elementor'), |
| 88 | ] |
| 89 | ); |
| 90 | |
| 91 | $this->add_control('premium_blog_skin', |
| 92 | [ |
| 93 | 'label' => __('Skin', 'premium-addons-for-elementor'), |
| 94 | 'type' => Controls_Manager::SELECT, |
| 95 | 'options' => [ |
| 96 | 'classic' => __('Classic', 'premium-addons-for-elementor'), |
| 97 | 'modern' => __('Modern', 'premium-addons-for-elementor'), |
| 98 | 'cards' => __('Cards', 'premium-addons-for-elementor'), |
| 99 | 'side' => __('On Side', 'premium-addons-for-elementor'), |
| 100 | 'banner' => __('Banner', 'premium-addons-for-elementor'), |
| 101 | ], |
| 102 | 'default' => 'classic', |
| 103 | 'label_block' => true |
| 104 | ] |
| 105 | ); |
| 106 | |
| 107 | $this->add_control('banner_skin_notice', |
| 108 | [ |
| 109 | 'raw' => __('If content height is larger than image height, then you may need to increase image height from Featured Image tab', 'premium-addons-for-elemeentor'), |
| 110 | 'type' => Controls_Manager::RAW_HTML, |
| 111 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 112 | 'condition' => [ |
| 113 | 'premium_blog_skin' => 'banner' |
| 114 | ] |
| 115 | ] |
| 116 | ); |
| 117 | |
| 118 | $this->add_responsive_control('content_offset', |
| 119 | [ |
| 120 | 'label' => __('Content Offset', 'premium-addons-for-elementor'), |
| 121 | 'type' => Controls_Manager::SLIDER, |
| 122 | 'range' => [ |
| 123 | 'px' => [ |
| 124 | 'min' => -100, |
| 125 | 'max' => 100, |
| 126 | ], |
| 127 | ], |
| 128 | 'condition' => [ |
| 129 | 'premium_blog_skin' => 'modern', |
| 130 | ], |
| 131 | 'selectors' => [ |
| 132 | '{{WRAPPER}} .premium-blog-skin-modern .premium-blog-content-wrapper' => 'top: {{SIZE}}{{UNIT}}' |
| 133 | ] |
| 134 | ] |
| 135 | ); |
| 136 | |
| 137 | $this->add_control('premium_blog_grid', |
| 138 | [ |
| 139 | 'label' => __('Grid', 'premium-addons-for-elementor'), |
| 140 | 'type' => Controls_Manager::SWITCHER, |
| 141 | 'default' => 'yes', |
| 142 | ] |
| 143 | ); |
| 144 | |
| 145 | $this->add_control('premium_blog_layout', |
| 146 | [ |
| 147 | 'label' => __('Layout', 'premium-addons-for-elementor'), |
| 148 | 'type' => Controls_Manager::SELECT, |
| 149 | 'options' => [ |
| 150 | 'even' => __('Even', 'premium-addons-for-elementor'), |
| 151 | 'masonry' => __('Masonry', 'premium-addons-for-elementor'), |
| 152 | ], |
| 153 | 'default' => 'even', |
| 154 | 'condition' => [ |
| 155 | 'premium_blog_grid' => 'yes' |
| 156 | ] |
| 157 | ] |
| 158 | ); |
| 159 | |
| 160 | $this->add_control('force_height', |
| 161 | [ |
| 162 | 'label' => __('Equal Height', 'premium-addons-for-elementor'), |
| 163 | 'type' => Controls_Manager::SWITCHER, |
| 164 | 'return_value' => 'true', |
| 165 | 'condition' => [ |
| 166 | 'premium_blog_grid' => 'yes', |
| 167 | 'premium_blog_layout' => 'even' |
| 168 | ] |
| 169 | ] |
| 170 | ); |
| 171 | |
| 172 | $this->add_control('force_height_notice', |
| 173 | [ |
| 174 | 'raw' => __('Equal Height option uses JS to force all content boxes to take the equal 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-elemeentor'), |
| 175 | 'type' => Controls_Manager::RAW_HTML, |
| 176 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 177 | 'condition' => [ |
| 178 | 'premium_blog_grid' => 'yes', |
| 179 | 'premium_blog_layout' => 'even', |
| 180 | 'force_height' => 'true' |
| 181 | ] |
| 182 | ] |
| 183 | ); |
| 184 | |
| 185 | $this->add_responsive_control('premium_blog_columns_number', |
| 186 | [ |
| 187 | 'label' => __('Number of Columns', 'premium-addons-for-elementor'), |
| 188 | 'type' => Controls_Manager::SELECT, |
| 189 | 'options' => [ |
| 190 | '50%' => __('2 Columns', 'premium-addons-for-elementor'), |
| 191 | '33.33%'=> __('3 Columns', 'premium-addons-for-elementor'), |
| 192 | '25%' => __('4 Columns', 'premium-addons-for-elementor'), |
| 193 | '20%' => __( '5 Columns', 'premium-addons-for-elementor' ), |
| 194 | '16.66%' => __( '6 Columns', 'premium-addons-for-elementor' ), |
| 195 | ], |
| 196 | 'default' => '50%', |
| 197 | 'tablet_default'=> '50%', |
| 198 | 'mobile_default'=> '100%', |
| 199 | 'render_type' => 'template', |
| 200 | 'label_block' => true, |
| 201 | 'condition' => [ |
| 202 | 'premium_blog_grid' => 'yes', |
| 203 | ], |
| 204 | 'selectors' => [ |
| 205 | '{{WRAPPER}} .premium-blog-post-outer-container' => 'width: {{VALUE}}' |
| 206 | ], |
| 207 | ] |
| 208 | ); |
| 209 | |
| 210 | $this->add_control('premium_blog_number_of_posts', |
| 211 | [ |
| 212 | 'label' => __('Posts Per Page', 'premium-addons-for-elementor'), |
| 213 | 'description' => __('Set the number of per page','premium-addons-for-elementor'), |
| 214 | 'type' => Controls_Manager::NUMBER, |
| 215 | 'min' => 1, |
| 216 | 'default' => 4, |
| 217 | ] |
| 218 | ); |
| 219 | |
| 220 | $this->end_controls_section(); |
| 221 | |
| 222 | $this->start_controls_section('section_query_options', |
| 223 | [ |
| 224 | 'label' => __('Query', 'premium-addons-for-elementor'), |
| 225 | ] |
| 226 | ); |
| 227 | |
| 228 | $post_types = Blog_Helper::get_posts_types(); |
| 229 | |
| 230 | $this->add_control('post_type_filter', |
| 231 | [ |
| 232 | 'label' => __( 'Source', 'premium-addons-for-elementor' ), |
| 233 | 'type' => Controls_Manager::SELECT, |
| 234 | 'label_block' => true, |
| 235 | 'options' => $post_types, |
| 236 | 'default' => 'post', |
| 237 | 'separator' => 'after', |
| 238 | ] |
| 239 | ); |
| 240 | |
| 241 | foreach ( $post_types as $key => $type ) { |
| 242 | |
| 243 | // Get all the taxanomies associated with the selected post type. |
| 244 | $taxonomy = Blog_Helper::get_taxnomies( $key ); |
| 245 | |
| 246 | if ( ! empty( $taxonomy ) ) { |
| 247 | |
| 248 | // Get all taxonomy values under the taxonomy. |
| 249 | foreach ( $taxonomy as $index => $tax ) { |
| 250 | |
| 251 | $terms = get_terms( $index ); |
| 252 | |
| 253 | $related_tax = array(); |
| 254 | |
| 255 | if ( ! empty( $terms ) ) { |
| 256 | |
| 257 | foreach ( $terms as $t_index => $t_obj ) { |
| 258 | |
| 259 | $related_tax[ $t_obj->slug ] = $t_obj->name; |
| 260 | } |
| 261 | |
| 262 | // Add filter rule for the each taxonomy |
| 263 | $this->add_control( $index . '_' . $key . '_filter_rule', |
| 264 | [ |
| 265 | 'label' => sprintf( __( '%s Filter Rule', 'premium-addons-for-elementor' ), $tax->label ), |
| 266 | 'type' => Controls_Manager::SELECT, |
| 267 | 'default' => 'IN', |
| 268 | 'label_block' => true, |
| 269 | 'options' => array( |
| 270 | 'IN' => sprintf( __( 'Match %s', 'premium-addons-for-elementor' ), $tax->label ), |
| 271 | 'NOT IN' => sprintf( __( 'Exclude %s', 'premium-addons-for-elementor' ), $tax->label ), |
| 272 | ), |
| 273 | 'condition' => [ |
| 274 | 'post_type_filter' => $key, |
| 275 | ] |
| 276 | ] |
| 277 | ); |
| 278 | |
| 279 | // Add select control for each taxonomy. |
| 280 | $this->add_control( 'tax_' . $index . '_' . $key . '_filter', |
| 281 | [ |
| 282 | 'label' => sprintf( __( '%s Filter', 'premium-addons-for-elementor' ), $tax->label ), |
| 283 | 'type' => Controls_Manager::SELECT2, |
| 284 | 'default' => '', |
| 285 | 'multiple' => true, |
| 286 | 'label_block' => true, |
| 287 | 'options' => $related_tax, |
| 288 | 'condition' => array( |
| 289 | 'post_type_filter' => $key, |
| 290 | ), |
| 291 | 'separator' => 'after', |
| 292 | ] |
| 293 | ); |
| 294 | |
| 295 | } |
| 296 | } |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | $this->add_control('author_filter_rule', |
| 301 | [ |
| 302 | 'label' => __( 'Filter By Author Rule', 'premium-addons-for-elementor' ), |
| 303 | 'type' => Controls_Manager::SELECT, |
| 304 | 'default' => 'author__in', |
| 305 | 'separator' => 'before', |
| 306 | 'label_block' => true, |
| 307 | 'options' => [ |
| 308 | 'author__in' => __( 'Match Authors', 'premium-addons-for-elementor' ), |
| 309 | 'author__not_in' => __( 'Exclude Authors', 'premium-addons-for-elementor' ), |
| 310 | ] |
| 311 | ] |
| 312 | ); |
| 313 | |
| 314 | $this->add_control('premium_blog_users', |
| 315 | [ |
| 316 | 'label' => __( 'Authors', 'premium-addons-for-elementor' ), |
| 317 | 'type' => Controls_Manager::SELECT2, |
| 318 | 'label_block' => true, |
| 319 | 'multiple' => true, |
| 320 | 'options' => Blog_Helper::get_authors(), |
| 321 | ] |
| 322 | ); |
| 323 | |
| 324 | $this->add_control('posts_filter_rule', |
| 325 | [ |
| 326 | 'label' => __( 'Filter By Post Rule', 'premium-addons-for-elementor' ), |
| 327 | 'type' => Controls_Manager::SELECT, |
| 328 | 'default' => 'post__not_in', |
| 329 | 'separator' => 'before', |
| 330 | 'label_block' => true, |
| 331 | 'options' => [ |
| 332 | 'post__in' => __( 'Match Post', 'premium-addons-for-elementor' ), |
| 333 | 'post__not_in' => __( 'Exclude Post', 'premium-addons-for-elementor' ), |
| 334 | ] |
| 335 | ] |
| 336 | ); |
| 337 | |
| 338 | $this->add_control('premium_blog_posts_exclude', |
| 339 | [ |
| 340 | 'label' => __( 'Posts', 'premium-addons-for-elementor' ), |
| 341 | 'type' => Controls_Manager::SELECT2, |
| 342 | 'label_block' => true, |
| 343 | 'multiple' => true, |
| 344 | 'options' => Blog_Helper::get_posts_list(), |
| 345 | ] |
| 346 | ); |
| 347 | |
| 348 | $this->add_control('ignore_sticky_posts', |
| 349 | [ |
| 350 | 'label' => __( 'Ignore Sticky Posts', 'premium-addons-for-elementor' ), |
| 351 | 'type' => Controls_Manager::SWITCHER, |
| 352 | 'label_on' => __( 'Yes', 'premium-addons-for-elementor' ), |
| 353 | 'label_off' => __( 'No', 'premium-addons-for-elementor' ), |
| 354 | 'default' => 'yes', |
| 355 | ] |
| 356 | ); |
| 357 | |
| 358 | $this->add_control('premium_blog_offset', |
| 359 | [ |
| 360 | 'label' => __( 'Offset', 'premium-addons-for-elementor' ), |
| 361 | 'description' => __('This option is used to exclude number of initial posts from being display.','premium-addons-for-elementor'), |
| 362 | 'type' => Controls_Manager::NUMBER, |
| 363 | 'default' => '0', |
| 364 | 'min' => '0', |
| 365 | ] |
| 366 | ); |
| 367 | |
| 368 | $this->add_control('query_exclude_current', |
| 369 | [ |
| 370 | 'label' => __( 'Exclude Current Post', 'premium-addons-for-elementor' ), |
| 371 | 'type' => Controls_Manager::SWITCHER, |
| 372 | 'description' => __( 'This option will remove the current post from the query.', 'premium-addons-for-elementor' ), |
| 373 | 'label_on' => __( 'Yes', 'premium-addons-for-elementor' ), |
| 374 | 'label_off' => __( 'No', 'premium-addons-for-elementor' ), |
| 375 | ] |
| 376 | ); |
| 377 | |
| 378 | $this->add_control('premium_blog_order_by', |
| 379 | [ |
| 380 | 'label' => __( 'Order By', 'premium-addons-for-elementor' ), |
| 381 | 'type' => Controls_Manager::SELECT, |
| 382 | 'separator' => 'before', |
| 383 | 'label_block' => true, |
| 384 | 'options' => [ |
| 385 | 'none' => __('None', 'premium-addons-for-elementor'), |
| 386 | 'ID' => __('ID', 'premium-addons-for-elementor'), |
| 387 | 'author'=> __('Author', 'premium-addons-for-elementor'), |
| 388 | 'title' => __('Title', 'premium-addons-for-elementor'), |
| 389 | 'name' => __('Name', 'premium-addons-for-elementor'), |
| 390 | 'date' => __('Date', 'premium-addons-for-elementor'), |
| 391 | 'modified'=> __('Last Modified', 'premium-addons-for-elementor'), |
| 392 | 'rand' => __('Random', 'premium-addons-for-elementor'), |
| 393 | 'comment_count'=> __('Number of Comments', 'premium-addons-for-elementor'), |
| 394 | ], |
| 395 | 'default' => 'date' |
| 396 | ] |
| 397 | ); |
| 398 | |
| 399 | $this->add_control('premium_blog_order', |
| 400 | [ |
| 401 | 'label' => __( 'Order', 'premium-addons-for-elementor' ), |
| 402 | 'type' => Controls_Manager::SELECT, |
| 403 | 'label_block' => true, |
| 404 | 'options' => [ |
| 405 | 'DESC' => __('Descending', 'premium-addons-for-elementor'), |
| 406 | 'ASC' => __('Ascending', 'premium-addons-for-elementor'), |
| 407 | ], |
| 408 | 'default' => 'DESC' |
| 409 | ] |
| 410 | ); |
| 411 | |
| 412 | $this->end_controls_section(); |
| 413 | |
| 414 | $this->start_controls_section('premium_blog_general_settings', |
| 415 | [ |
| 416 | 'label' => __('Featured Image', 'premium-addons-for-elementor'), |
| 417 | ] |
| 418 | ); |
| 419 | |
| 420 | $this->add_control('show_featured_image', |
| 421 | [ |
| 422 | 'label' => __('Show Featured Image', 'premium-addons-for-elementor'), |
| 423 | 'type' => Controls_Manager::SWITCHER, |
| 424 | 'default' => 'yes', |
| 425 | 'condition' => [ |
| 426 | 'premium_blog_skin!' => 'banner' |
| 427 | ] |
| 428 | ] |
| 429 | ); |
| 430 | |
| 431 | $featured_image_conditions = array( |
| 432 | 'show_featured_image' => 'yes' |
| 433 | ); |
| 434 | |
| 435 | $this->add_group_control( |
| 436 | Group_Control_Image_Size::get_type(), |
| 437 | [ |
| 438 | 'name' => 'featured_image', |
| 439 | 'default' => 'full', |
| 440 | 'condition' => $featured_image_conditions |
| 441 | ] |
| 442 | ); |
| 443 | |
| 444 | $this->add_control('premium_blog_hover_color_effect', |
| 445 | [ |
| 446 | 'label' => __('Overlay Effect', 'premium-addons-for-elementor'), |
| 447 | 'type' => Controls_Manager::SELECT, |
| 448 | 'description' => __('Choose an overlay color effect','premium-addons-for-elementor'), |
| 449 | 'options' => [ |
| 450 | 'none' => __('None', 'premium-addons-for-elementor'), |
| 451 | 'framed' => __('Framed', 'premium-addons-for-elementor'), |
| 452 | 'diagonal' => __('Diagonal', 'premium-addons-for-elementor'), |
| 453 | 'bordered' => __('Bordered', 'premium-addons-for-elementor'), |
| 454 | 'squares' => __('Squares', 'premium-addons-for-elementor'), |
| 455 | ], |
| 456 | 'default' => 'framed', |
| 457 | 'label_block' => true, |
| 458 | 'condition' => array_merge( $featured_image_conditions, [ |
| 459 | 'premium_blog_skin' => ['modern', 'cards'] |
| 460 | ]) |
| 461 | ] |
| 462 | ); |
| 463 | |
| 464 | $this->add_control('premium_blog_hover_image_effect', |
| 465 | [ |
| 466 | 'label' => __('Hover Effect', 'premium-addons-for-elementor'), |
| 467 | 'type' => Controls_Manager::SELECT, |
| 468 | 'description' => __('Choose a hover effect for the image','premium-addons-for-elementor'), |
| 469 | 'options' => [ |
| 470 | 'none' => __('None', 'premium-addons-for-elementor'), |
| 471 | 'zoomin' => __('Zoom In', 'premium-addons-for-elementor'), |
| 472 | 'zoomout'=> __('Zoom Out', 'premium-addons-for-elementor'), |
| 473 | 'scale' => __('Scale', 'premium-addons-for-elementor'), |
| 474 | 'gray' => __('Grayscale', 'premium-addons-for-elementor'), |
| 475 | 'blur' => __('Blur', 'premium-addons-for-elementor'), |
| 476 | 'bright' => __('Bright', 'premium-addons-for-elementor'), |
| 477 | 'sepia' => __('Sepia', 'premium-addons-for-elementor'), |
| 478 | 'trans' => __('Translate', 'premium-addons-for-elementor'), |
| 479 | ], |
| 480 | 'default' => 'zoomin', |
| 481 | 'label_block' => true, |
| 482 | 'condition' => $featured_image_conditions |
| 483 | ] |
| 484 | ); |
| 485 | |
| 486 | $this->add_responsive_control('thumb_width', |
| 487 | [ |
| 488 | 'label' => __('Width (%)', 'premium-addons-for-elementor'), |
| 489 | 'type' => Controls_Manager::SLIDER, |
| 490 | 'default' => [ |
| 491 | 'size' => '25' |
| 492 | ], |
| 493 | 'condition' => array_merge( $featured_image_conditions, [ |
| 494 | 'premium_blog_skin' => 'side' |
| 495 | ] ), |
| 496 | 'selectors' => [ |
| 497 | '{{WRAPPER}} .premium-blog-thumb-effect-wrapper' => 'flex-basis: {{SIZE}}%' |
| 498 | ] |
| 499 | ] |
| 500 | ); |
| 501 | |
| 502 | $this->add_responsive_control('premium_blog_thumb_min_height', |
| 503 | [ |
| 504 | 'label' => __('Height', 'premium-addons-for-elementor'), |
| 505 | 'type' => Controls_Manager::SLIDER, |
| 506 | 'size_units' => ['px', 'em'], |
| 507 | 'range' => [ |
| 508 | 'px' => [ |
| 509 | 'min' => 0, |
| 510 | 'max' => 600, |
| 511 | ], |
| 512 | 'em' => [ |
| 513 | 'min' => 1, |
| 514 | 'max' => 60, |
| 515 | ], |
| 516 | ], |
| 517 | 'condition' => array_merge( $featured_image_conditions ), |
| 518 | 'selectors' => [ |
| 519 | '{{WRAPPER}} .premium-blog-thumbnail-container img' => 'height: {{SIZE}}{{UNIT}};' |
| 520 | ] |
| 521 | ] |
| 522 | ); |
| 523 | |
| 524 | $this->add_responsive_control('premium_blog_thumbnail_fit', |
| 525 | [ |
| 526 | 'label' => __('Thumbnail Fit', 'premium-addons-for-elementor'), |
| 527 | 'type' => Controls_Manager::SELECT, |
| 528 | 'options' => [ |
| 529 | 'cover' => __('Cover', 'premium-addons-for-elementor'), |
| 530 | 'fill' => __('Fill', 'premium-addons-for-elementor'), |
| 531 | 'contain'=> __('Contain', 'premium-addons-for-elementor'), |
| 532 | ], |
| 533 | 'default' => 'cover', |
| 534 | 'selectors' => [ |
| 535 | '{{WRAPPER}} .premium-blog-thumbnail-container img' => 'object-fit: {{VALUE}}' |
| 536 | ], |
| 537 | 'condition' => array_merge( $featured_image_conditions ), |
| 538 | ] |
| 539 | ); |
| 540 | |
| 541 | $this->end_controls_section(); |
| 542 | |
| 543 | $this->start_controls_section('premium_blog_content_settings', |
| 544 | [ |
| 545 | 'label' => __('Display Options', 'premium-addons-for-elementor'), |
| 546 | ] |
| 547 | ); |
| 548 | |
| 549 | $this->add_control('premium_blog_title_tag', |
| 550 | [ |
| 551 | 'label' => __( 'Title HTML Tag', 'premium-addons-for-elementor' ), |
| 552 | 'description' => __( 'Select a heading tag for the post title.', 'premium-addons-for-elementor' ), |
| 553 | 'type' => Controls_Manager::SELECT, |
| 554 | 'default' => 'h2', |
| 555 | 'options' => [ |
| 556 | 'h1' => 'H1', |
| 557 | 'h2' => 'H2', |
| 558 | 'h3' => 'H3', |
| 559 | 'h4' => 'H4', |
| 560 | 'h5' => 'H5', |
| 561 | 'h6' => 'H6', |
| 562 | 'div' => 'div', |
| 563 | 'span' => 'span', |
| 564 | 'p' => 'p', |
| 565 | ], |
| 566 | 'label_block' => true, |
| 567 | ] |
| 568 | ); |
| 569 | |
| 570 | $this->add_responsive_control('premium_blog_posts_columns_spacing', |
| 571 | [ |
| 572 | 'label' => __('Rows Spacing', 'premium-addons-for-elementor'), |
| 573 | 'type' => Controls_Manager::SLIDER, |
| 574 | 'size_units' => ['px', '%', "em"], |
| 575 | 'range' => [ |
| 576 | 'px' => [ |
| 577 | 'min' => 1, |
| 578 | 'max' => 200, |
| 579 | ], |
| 580 | ], |
| 581 | 'default' => [ |
| 582 | 'size' => 5, |
| 583 | 'unit' => 'px' |
| 584 | ], |
| 585 | 'render_type' => 'template', |
| 586 | 'selectors' => [ |
| 587 | '{{WRAPPER}} .premium-blog-post-outer-container' => 'margin-bottom: {{SIZE}}{{UNIT}}' |
| 588 | ] |
| 589 | ] |
| 590 | ); |
| 591 | |
| 592 | $this->add_responsive_control('premium_blog_posts_spacing', |
| 593 | [ |
| 594 | 'label' => __('Columns Spacing', 'premium-addons-for-elementor'), |
| 595 | 'type' => Controls_Manager::SLIDER, |
| 596 | 'default' => [ |
| 597 | 'size' => 5, |
| 598 | ], |
| 599 | 'range' => [ |
| 600 | 'px' => [ |
| 601 | 'min' => 0, |
| 602 | 'max' => 50, |
| 603 | ], |
| 604 | ], |
| 605 | 'selectors' => [ |
| 606 | '{{WRAPPER}} .premium-blog-post-outer-container' => 'padding-right: calc( {{SIZE}}{{UNIT}}/2 ); padding-left: calc( {{SIZE}}{{UNIT}}/2 )', |
| 607 | '{{WRAPPER}} .premium-blog-wrap' => 'margin-left: calc( -{{SIZE}}{{UNIT}}/2 ); margin-right: calc( -{{SIZE}}{{UNIT}}/2 );', |
| 608 | ], |
| 609 | 'condition' => [ |
| 610 | 'premium_blog_grid' => 'yes' |
| 611 | ], |
| 612 | ] |
| 613 | ); |
| 614 | |
| 615 | $this->add_responsive_control('premium_flip_text_align', |
| 616 | [ |
| 617 | 'label' => __( 'Alignment', 'premium-addons-for-elementor' ), |
| 618 | 'type' => Controls_Manager::CHOOSE, |
| 619 | 'options' => [ |
| 620 | 'left' => [ |
| 621 | 'title'=> __( 'Left', 'premium-addons-for-elementor' ), |
| 622 | 'icon' => 'fa fa-align-left', |
| 623 | ], |
| 624 | 'center' => [ |
| 625 | 'title'=> __( 'Center', 'premium-addons-for-elementor' ), |
| 626 | 'icon' => 'fa fa-align-center', |
| 627 | ], |
| 628 | 'right' => [ |
| 629 | 'title'=> __( 'Right', 'premium-addons-for-elementor' ), |
| 630 | 'icon' => 'fa fa-align-right', |
| 631 | ], |
| 632 | ], |
| 633 | 'toggle' => false, |
| 634 | 'default' => 'left', |
| 635 | 'prefix_class' => 'premium-blog-align-', |
| 636 | 'selectors' => [ |
| 637 | '{{WRAPPER}} .premium-blog-content-wrapper' => 'text-align: {{VALUE}};', |
| 638 | ], |
| 639 | ] |
| 640 | ); |
| 641 | |
| 642 | $this->add_responsive_control('content_vertical_alignment', |
| 643 | [ |
| 644 | 'label' => __( 'Vertical Alignment', 'premium-addons-for-elementor' ), |
| 645 | 'type' => Controls_Manager::CHOOSE, |
| 646 | 'options' => [ |
| 647 | 'flex-start' => [ |
| 648 | 'title' => __( 'Top', 'premium-addons-for-elementor' ), |
| 649 | 'icon' => 'fa fa-long-arrow-up', |
| 650 | ], |
| 651 | 'center' => [ |
| 652 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 653 | 'icon' => 'fa fa-align-justify', |
| 654 | ], |
| 655 | 'flex-end' => [ |
| 656 | 'title' => __( 'Bottom', 'premium-addons-for-elementor' ), |
| 657 | 'icon' => 'fa fa-long-arrow-down', |
| 658 | ], |
| 659 | ], |
| 660 | 'default' => 'flex-end', |
| 661 | 'toggle' => false, |
| 662 | 'condition' => [ |
| 663 | 'premium_blog_skin' => 'banner', |
| 664 | ], |
| 665 | 'selectors' => [ |
| 666 | '{{WRAPPER}} .premium-blog-content-wrapper' => 'justify-content: {{VALUE}};', |
| 667 | ], |
| 668 | ] |
| 669 | ); |
| 670 | |
| 671 | $this->end_controls_section(); |
| 672 | |
| 673 | $this->start_controls_section('premium_blog_posts_options', |
| 674 | [ |
| 675 | 'label' => __('Post Options', 'premium-addons-for-elementor'), |
| 676 | ] |
| 677 | ); |
| 678 | |
| 679 | $this->add_control('premium_blog_excerpt', |
| 680 | [ |
| 681 | 'label' => __('Show Post Content', 'premium-addons-for-elementor'), |
| 682 | 'type' => Controls_Manager::SWITCHER, |
| 683 | 'default' => 'yes', |
| 684 | ] |
| 685 | ); |
| 686 | |
| 687 | $this->add_control('content_source', |
| 688 | [ |
| 689 | 'label' => __('Get Content From', 'premium-addons-for-elementor'), |
| 690 | 'type' => Controls_Manager::SELECT, |
| 691 | 'options' => [ |
| 692 | 'excerpt' => __('Post Excerpt', 'premium-addons-for-elementor'), |
| 693 | 'full' => __('Post Full Content', 'premium-addons-for-elementor'), |
| 694 | ], |
| 695 | 'default' => 'excerpt', |
| 696 | 'label_block' => true, |
| 697 | 'condition' => [ |
| 698 | 'premium_blog_excerpt' => 'yes', |
| 699 | ] |
| 700 | ] |
| 701 | ); |
| 702 | |
| 703 | $this->add_control('premium_blog_excerpt_length', |
| 704 | [ |
| 705 | 'label' => __('Excerpt Length', 'premium-addons-for-elementor'), |
| 706 | 'type' => Controls_Manager::NUMBER, |
| 707 | 'description' => __('Excerpt is used for article summary with a link to the whole entry. The default except length is 55','premium-addons-for-elementor'), |
| 708 | 'default' => 22, |
| 709 | 'condition' => [ |
| 710 | 'premium_blog_excerpt' => 'yes', |
| 711 | 'content_source' => 'excerpt' |
| 712 | ] |
| 713 | ] |
| 714 | ); |
| 715 | |
| 716 | $this->add_control('premium_blog_excerpt_type', |
| 717 | [ |
| 718 | 'label' => __('Excerpt Type', 'premium-addons-for-elementor'), |
| 719 | 'type' => Controls_Manager::SELECT, |
| 720 | 'options' => [ |
| 721 | 'dots' => __('Dots', 'premium-addons-for-elementor'), |
| 722 | 'link' => __('Link', 'premium-addons-for-elementor'), |
| 723 | ], |
| 724 | 'default' => 'dots', |
| 725 | 'label_block' => true, |
| 726 | 'condition' => [ |
| 727 | 'premium_blog_excerpt' => 'yes', |
| 728 | ] |
| 729 | ] |
| 730 | ); |
| 731 | |
| 732 | $this->add_control('read_more_full_width', |
| 733 | [ |
| 734 | 'label' => __('Full Width', 'premium-addons-for-elementor'), |
| 735 | 'type' => Controls_Manager::SWITCHER, |
| 736 | 'prefix_class' => 'premium-blog-cta-full-', |
| 737 | 'condition' => [ |
| 738 | 'premium_blog_excerpt' => 'yes', |
| 739 | 'premium_blog_excerpt_type' => 'link' |
| 740 | ] |
| 741 | ] |
| 742 | ); |
| 743 | |
| 744 | $this->add_control('premium_blog_excerpt_text', |
| 745 | [ |
| 746 | 'label' => __( 'Read More Text', 'premium-addons-for-elementor' ), |
| 747 | 'type' => Controls_Manager::TEXT, |
| 748 | 'default' => __( 'Read More »', 'premium-addons-for-elementor' ), |
| 749 | 'condition' => [ |
| 750 | 'premium_blog_excerpt' => 'yes', |
| 751 | 'premium_blog_excerpt_type' => 'link' |
| 752 | ] |
| 753 | ] |
| 754 | ); |
| 755 | |
| 756 | $this->add_control('premium_blog_author_meta', |
| 757 | [ |
| 758 | 'label' => __('Author Meta', 'premium-addons-for-elementor'), |
| 759 | 'type' => Controls_Manager::SWITCHER, |
| 760 | 'default' => 'yes', |
| 761 | ] |
| 762 | ); |
| 763 | |
| 764 | $this->add_control('premium_blog_date_meta', |
| 765 | [ |
| 766 | 'label' => __('Date Meta', 'premium-addons-for-elementor'), |
| 767 | 'type' => Controls_Manager::SWITCHER, |
| 768 | 'default' => 'yes', |
| 769 | ] |
| 770 | ); |
| 771 | |
| 772 | $this->add_control('premium_blog_categories_meta', |
| 773 | [ |
| 774 | 'label' => __('Categories Meta', 'premium-addons-for-elementor'), |
| 775 | 'type' => Controls_Manager::SWITCHER, |
| 776 | 'description' => __('Display or hide categories meta','premium-addons-for-elementor'), |
| 777 | 'default' => 'yes', |
| 778 | ] |
| 779 | ); |
| 780 | |
| 781 | $this->add_control('premium_blog_comments_meta', |
| 782 | [ |
| 783 | 'label' => __('Comments Meta', 'premium-addons-for-elementor'), |
| 784 | 'description' => __('Display or hide comments meta','premium-addons-for-elementor'), |
| 785 | 'type' => Controls_Manager::SWITCHER, |
| 786 | 'default' => 'yes', |
| 787 | ] |
| 788 | ); |
| 789 | |
| 790 | $this->add_control('premium_blog_tags_meta', |
| 791 | [ |
| 792 | 'label' => __('Tags Meta', 'premium-addons-for-elementor'), |
| 793 | 'type' => Controls_Manager::SWITCHER, |
| 794 | 'description' => __('Display or hide post tags','premium-addons-for-elementor'), |
| 795 | ] |
| 796 | ); |
| 797 | |
| 798 | // $this->add_control('premium_blog_post_format_icon', |
| 799 | // [ |
| 800 | // 'label' => __( 'Post Format Icon', 'premium-addons-for-elementor' ), |
| 801 | // 'type' => Controls_Manager::SWITCHER, |
| 802 | // 'description' => __( 'Please note that post format icon is hidden for 3 and 4 columns', 'premium-addons-for-elementor' ), |
| 803 | // 'default' => 'yes', |
| 804 | // 'prefix_class' => 'premium-blog-format-icon-', |
| 805 | // 'render_type' => 'template' |
| 806 | // ] |
| 807 | // ); |
| 808 | |
| 809 | $this->end_controls_section(); |
| 810 | |
| 811 | $this->start_controls_section('premium_blog_advanced_settings', |
| 812 | [ |
| 813 | 'label' => __('Advanced Settings', 'premium-addons-for-elementor'), |
| 814 | ] |
| 815 | ); |
| 816 | |
| 817 | $this->add_control('premium_blog_cat_tabs', |
| 818 | [ |
| 819 | 'label' => __('Filter Tabs', 'premium-addons-for-elementor'), |
| 820 | 'type' => Controls_Manager::SWITCHER, |
| 821 | 'condition' => [ |
| 822 | 'premium_blog_carousel!' => 'yes' |
| 823 | ] |
| 824 | ] |
| 825 | ); |
| 826 | |
| 827 | $this->add_control('filter_tabs_type', |
| 828 | [ |
| 829 | 'label' => __( 'Get Tabs From', 'premium-addons-for-elementor' ), |
| 830 | 'type' => Controls_Manager::SELECT, |
| 831 | 'default' => 'category', |
| 832 | 'label_block' => true, |
| 833 | 'options' => [ |
| 834 | 'category' => __( 'Categories', 'premium-addons-for-elementor' ), |
| 835 | 'tag' => __( 'Tags', 'premium-addons-for-elementor' ), |
| 836 | ], |
| 837 | 'condition' => [ |
| 838 | 'premium_blog_cat_tabs' => 'yes', |
| 839 | 'premium_blog_carousel!' => 'yes' |
| 840 | ] |
| 841 | ] |
| 842 | ); |
| 843 | |
| 844 | $this->add_control('filter_tabs_notice', |
| 845 | [ |
| 846 | 'raw' => __('Please make sure to select the categories/tags you need to show from Query tab.', 'premium-addons-for-elemeentor'), |
| 847 | 'type' => Controls_Manager::RAW_HTML, |
| 848 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 849 | 'condition' => [ |
| 850 | 'premium_blog_cat_tabs' => 'yes', |
| 851 | 'premium_blog_carousel!' => 'yes' |
| 852 | ] |
| 853 | ] |
| 854 | ); |
| 855 | |
| 856 | $this->add_control('premium_blog_tab_label', |
| 857 | [ |
| 858 | 'label' => __( 'First Tab Label', 'premium-addons-for-elementor' ), |
| 859 | 'type' => Controls_Manager::TEXT, |
| 860 | 'default' => __('All', 'premium-addons-for-elementor'), |
| 861 | 'condition' => [ |
| 862 | 'premium_blog_cat_tabs' => 'yes', |
| 863 | 'premium_blog_carousel!' => 'yes' |
| 864 | ] |
| 865 | ] |
| 866 | ); |
| 867 | |
| 868 | $this->add_responsive_control('premium_blog_filter_align', |
| 869 | [ |
| 870 | 'label' => __( 'Alignment', 'premium-addons-for-elementor' ), |
| 871 | 'type' => Controls_Manager::CHOOSE, |
| 872 | 'options' => [ |
| 873 | 'flex-start' => [ |
| 874 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 875 | 'icon' => 'fa fa-align-left', |
| 876 | ], |
| 877 | 'center' => [ |
| 878 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 879 | 'icon' => 'fa fa-align-center', |
| 880 | ], |
| 881 | 'flex-end' => [ |
| 882 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 883 | 'icon' => 'fa fa-align-right', |
| 884 | ], |
| 885 | ], |
| 886 | 'default' => 'center', |
| 887 | 'toggle' => false, |
| 888 | 'condition' => [ |
| 889 | 'premium_blog_cat_tabs' => 'yes', |
| 890 | 'premium_blog_carousel!' => 'yes' |
| 891 | ], |
| 892 | 'selectors' => [ |
| 893 | '{{WRAPPER}} .premium-blog-filter' => 'justify-content: {{VALUE}};', |
| 894 | ], |
| 895 | ] |
| 896 | ); |
| 897 | |
| 898 | $this->add_control('premium_blog_new_tab', |
| 899 | [ |
| 900 | 'label' => __('Links in New Tab', 'premium-addons-for-elementor'), |
| 901 | 'type' => Controls_Manager::SWITCHER, |
| 902 | 'description' => __('Enable links to be opened in a new tab','premium-addons-for-elementor'), |
| 903 | 'default' => 'yes', |
| 904 | ] |
| 905 | ); |
| 906 | |
| 907 | $this->end_controls_section(); |
| 908 | |
| 909 | $this->start_controls_section('premium_blog_carousel_settings', |
| 910 | [ |
| 911 | 'label' => __('Carousel', 'premium-addons-for-elementor'), |
| 912 | 'condition' => [ |
| 913 | // 'premium_blog_grid' => 'yes', |
| 914 | 'premium_blog_paging!' => 'yes', |
| 915 | ] |
| 916 | ] |
| 917 | ); |
| 918 | |
| 919 | $this->add_control('premium_blog_carousel', |
| 920 | [ |
| 921 | 'label' => __('Enable Carousel', 'premium-addons-for-elementor'), |
| 922 | 'type' => Controls_Manager::SWITCHER |
| 923 | ] |
| 924 | ); |
| 925 | |
| 926 | $this->add_control('premium_blog_carousel_fade', |
| 927 | [ |
| 928 | 'label' => __('Fade', 'premium-addons-for-elementor'), |
| 929 | 'type' => Controls_Manager::SWITCHER, |
| 930 | 'condition' => [ |
| 931 | 'premium_blog_carousel' => 'yes', |
| 932 | 'premium_blog_columns_number' => '100%' |
| 933 | ] |
| 934 | ] |
| 935 | ); |
| 936 | |
| 937 | $this->add_control('premium_blog_carousel_play', |
| 938 | [ |
| 939 | 'label' => __('Auto Play', 'premium-addons-for-elementor'), |
| 940 | 'type' => Controls_Manager::SWITCHER, |
| 941 | 'condition' => [ |
| 942 | 'premium_blog_carousel' => 'yes', |
| 943 | ] |
| 944 | ] |
| 945 | ); |
| 946 | |
| 947 | $this->add_control('slides_to_scroll', |
| 948 | [ |
| 949 | 'label' => __( 'Slides To Scroll', 'premium-addons-for-elementor' ), |
| 950 | 'type' => Controls_Manager::NUMBER, |
| 951 | 'condition' => [ |
| 952 | 'premium_blog_carousel' => 'yes', |
| 953 | ], |
| 954 | ] |
| 955 | ); |
| 956 | |
| 957 | $this->add_control('premium_blog_carousel_autoplay_speed', |
| 958 | [ |
| 959 | 'label' => __( 'Autoplay Speed', 'premium-addons-for-elementor' ), |
| 960 | 'description' => __( 'Autoplay Speed means at which time the next slide should come. Set a value in milliseconds (ms)', 'premium-addons-for-elementor' ), |
| 961 | 'type' => Controls_Manager::NUMBER, |
| 962 | 'default' => 5000, |
| 963 | 'condition' => [ |
| 964 | 'premium_blog_carousel' => 'yes', |
| 965 | 'premium_blog_carousel_play' => 'yes', |
| 966 | ], |
| 967 | ] |
| 968 | ); |
| 969 | |
| 970 | $this->add_control('premium_blog_carousel_center', |
| 971 | [ |
| 972 | 'label' => __('Center Mode', 'premium-addons-for-elementor'), |
| 973 | 'type' => Controls_Manager::SWITCHER, |
| 974 | 'condition' => [ |
| 975 | 'premium_blog_carousel' => 'yes', |
| 976 | ] |
| 977 | ] |
| 978 | ); |
| 979 | |
| 980 | $this->add_control('premium_blog_carousel_spacing', |
| 981 | [ |
| 982 | 'label' => __( 'Slides\' Spacing', 'premium-addons-for-elementor' ), |
| 983 | 'description' => __('Set a spacing value in pixels (px)', 'premium-addons-for-elementor'), |
| 984 | 'type' => Controls_Manager::NUMBER, |
| 985 | 'default' => '15', |
| 986 | 'condition' => [ |
| 987 | 'premium_blog_carousel' => 'yes', |
| 988 | ] |
| 989 | ] |
| 990 | ); |
| 991 | |
| 992 | $this->add_control('premium_blog_carousel_dots', |
| 993 | [ |
| 994 | 'label' => __('Navigation Dots', 'premium-addons-for-elementor'), |
| 995 | 'type' => Controls_Manager::SWITCHER, |
| 996 | 'condition' => [ |
| 997 | 'premium_blog_carousel' => 'yes' |
| 998 | ] |
| 999 | ] |
| 1000 | ); |
| 1001 | |
| 1002 | $this->add_control('premium_blog_carousel_arrows', |
| 1003 | [ |
| 1004 | 'label' => __('Navigation Arrows', 'premium-addons-for-elementor'), |
| 1005 | 'type' => Controls_Manager::SWITCHER, |
| 1006 | 'default' => 'yes', |
| 1007 | 'condition' => [ |
| 1008 | 'premium_blog_carousel' => 'yes' |
| 1009 | ] |
| 1010 | ] |
| 1011 | ); |
| 1012 | |
| 1013 | $this->add_responsive_control('premium_blog_carousel_arrows_pos', |
| 1014 | [ |
| 1015 | 'label' => __('Arrows Position', 'premium-addons-for-elementor'), |
| 1016 | 'type' => Controls_Manager::SLIDER, |
| 1017 | 'size_units' => ['px', "em"], |
| 1018 | 'range' => [ |
| 1019 | 'px' => [ |
| 1020 | 'min' => -100, |
| 1021 | 'max' => 100, |
| 1022 | ], |
| 1023 | 'em' => [ |
| 1024 | 'min' => -10, |
| 1025 | 'max' => 10, |
| 1026 | ], |
| 1027 | ], |
| 1028 | 'condition' => [ |
| 1029 | 'premium_blog_carousel' => 'yes', |
| 1030 | 'premium_blog_carousel_arrows' => 'yes' |
| 1031 | ], |
| 1032 | 'selectors' => [ |
| 1033 | '{{WRAPPER}} .premium-blog-wrap a.carousel-arrow.carousel-next' => 'right: {{SIZE}}{{UNIT}};', |
| 1034 | '{{WRAPPER}} .premium-blog-wrap a.carousel-arrow.carousel-prev' => 'left: {{SIZE}}{{UNIT}};', |
| 1035 | ] |
| 1036 | ] |
| 1037 | ); |
| 1038 | |
| 1039 | |
| 1040 | $this->end_controls_section(); |
| 1041 | |
| 1042 | $this->start_controls_section('premium_blog_pagination_section', |
| 1043 | [ |
| 1044 | 'label' => __('Pagination', 'premium-addons-for-elementor'), |
| 1045 | 'condition' => [ |
| 1046 | 'premium_blog_carousel!' => 'yes', |
| 1047 | ] |
| 1048 | ] |
| 1049 | ); |
| 1050 | |
| 1051 | $this->add_control('premium_blog_paging', |
| 1052 | [ |
| 1053 | 'label' => __('Enable Pagination', 'premium-addons-for-elementor'), |
| 1054 | 'type' => Controls_Manager::SWITCHER, |
| 1055 | 'description' => __('Pagination is the process of dividing the posts into discrete pages','premium-addons-for-elementor'), |
| 1056 | ] |
| 1057 | ); |
| 1058 | |
| 1059 | $this->add_control('max_pages', |
| 1060 | [ |
| 1061 | 'label' => __( 'Page Limit', 'premium-addons-for-elementor' ), |
| 1062 | 'type' => Controls_Manager::NUMBER, |
| 1063 | 'default' => 5, |
| 1064 | 'condition' => [ |
| 1065 | 'premium_blog_paging' => 'yes', |
| 1066 | ] |
| 1067 | ] |
| 1068 | ); |
| 1069 | |
| 1070 | $this->add_control('pagination_strings', |
| 1071 | [ |
| 1072 | 'label' => __('Enable Pagination Next/Prev Strings', 'premium-addons-for-elementor'), |
| 1073 | 'type' => Controls_Manager::SWITCHER, |
| 1074 | 'default' => 'yes', |
| 1075 | 'condition' => [ |
| 1076 | 'premium_blog_paging' => 'yes' |
| 1077 | ] |
| 1078 | ] |
| 1079 | ); |
| 1080 | |
| 1081 | $this->add_control('premium_blog_prev_text', |
| 1082 | [ |
| 1083 | 'label' => __( 'Previous Page String', 'premium-addons-for-elementor' ), |
| 1084 | 'type' => Controls_Manager::TEXT, |
| 1085 | 'default' => __('Previous','premium-addons-for-elementor'), |
| 1086 | 'condition' => [ |
| 1087 | 'premium_blog_paging' => 'yes', |
| 1088 | 'pagination_strings' => 'yes' |
| 1089 | ] |
| 1090 | ] |
| 1091 | ); |
| 1092 | |
| 1093 | $this->add_control('premium_blog_next_text', |
| 1094 | [ |
| 1095 | 'label' => __( 'Next Page String', 'premium-addons-for-elementor' ), |
| 1096 | 'type' => Controls_Manager::TEXT, |
| 1097 | 'default' => __('Next','premium-addons-for-elementor'), |
| 1098 | 'condition' => [ |
| 1099 | 'premium_blog_paging' => 'yes', |
| 1100 | 'pagination_strings' => 'yes' |
| 1101 | ] |
| 1102 | ] |
| 1103 | ); |
| 1104 | |
| 1105 | $this->add_responsive_control('premium_blog_pagination_align', |
| 1106 | [ |
| 1107 | 'label' => __( 'Alignment', 'premium-addons-for-elementor' ), |
| 1108 | 'type' => Controls_Manager::CHOOSE, |
| 1109 | 'options' => [ |
| 1110 | 'left' => [ |
| 1111 | 'title'=> __( 'Left', 'premium-addons-for-elementor' ), |
| 1112 | 'icon' => 'fa fa-align-left', |
| 1113 | ], |
| 1114 | 'center' => [ |
| 1115 | 'title'=> __( 'Center', 'premium-addons-for-elementor' ), |
| 1116 | 'icon' => 'fa fa-align-center', |
| 1117 | ], |
| 1118 | 'right' => [ |
| 1119 | 'title'=> __( 'Right', 'premium-addons-for-elementor' ), |
| 1120 | 'icon' => 'fa fa-align-right', |
| 1121 | ], |
| 1122 | ], |
| 1123 | 'default' => 'right', |
| 1124 | 'toggle' => false, |
| 1125 | 'condition' => [ |
| 1126 | 'premium_blog_paging' => 'yes', |
| 1127 | ], |
| 1128 | 'selectors' => [ |
| 1129 | '{{WRAPPER}} .premium-blog-pagination-container' => 'text-align: {{VALUE}}', |
| 1130 | ] |
| 1131 | ] |
| 1132 | ); |
| 1133 | |
| 1134 | $this->end_controls_section(); |
| 1135 | |
| 1136 | $this->start_controls_section('premium_blog_filter_style', |
| 1137 | [ |
| 1138 | 'label' => __('Filter','premium-addons-for-elementor'), |
| 1139 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1140 | 'condition' => [ |
| 1141 | 'premium_blog_cat_tabs' => 'yes' |
| 1142 | ] |
| 1143 | ] |
| 1144 | ); |
| 1145 | |
| 1146 | $this->add_group_control( |
| 1147 | Group_Control_Typography::get_type(), |
| 1148 | [ |
| 1149 | 'name' => 'premium_blog_filter_typo', |
| 1150 | 'scheme' => Scheme_Typography::TYPOGRAPHY_1, |
| 1151 | 'selector' => '{{WRAPPER}} .premium-blog-filters-container li a.category', |
| 1152 | ] |
| 1153 | ); |
| 1154 | |
| 1155 | $this->start_controls_tabs('tabs_filter'); |
| 1156 | |
| 1157 | $this->start_controls_tab('tab_filter_normal', |
| 1158 | [ |
| 1159 | 'label' => __('Normal', 'premium-addons-for-elementor'), |
| 1160 | ] |
| 1161 | ); |
| 1162 | |
| 1163 | $this->add_control('premium_blog_filter_color', |
| 1164 | [ |
| 1165 | 'label' => __('Color', 'premium-addons-for-elementor'), |
| 1166 | 'type' => Controls_Manager::COLOR, |
| 1167 | 'scheme' => [ |
| 1168 | 'type' => Scheme_Color::get_type(), |
| 1169 | 'value' => Scheme_Color::COLOR_2, |
| 1170 | ], |
| 1171 | 'selectors' => [ |
| 1172 | '{{WRAPPER}} .premium-blog-filters-container li a.category span' => 'color: {{VALUE}};', |
| 1173 | ] |
| 1174 | ] |
| 1175 | ); |
| 1176 | |
| 1177 | $this->add_control('premium_blog_background_color', |
| 1178 | [ |
| 1179 | 'label' => __('Background Color', 'premium-addons-for-elementor'), |
| 1180 | 'type' => Controls_Manager::COLOR, |
| 1181 | 'scheme' => [ |
| 1182 | 'type' => Scheme_Color::get_type(), |
| 1183 | 'value' => Scheme_Color::COLOR_1, |
| 1184 | ], |
| 1185 | 'selectors' => [ |
| 1186 | '{{WRAPPER}} .premium-blog-filters-container li a.category' => 'background-color: {{VALUE}};', |
| 1187 | ], |
| 1188 | ] |
| 1189 | ); |
| 1190 | |
| 1191 | $this->add_group_control( |
| 1192 | Group_Control_Border::get_type(), |
| 1193 | [ |
| 1194 | 'name' => 'premium_blog_filter_border', |
| 1195 | 'selector' => '{{WRAPPER}} .premium-blog-filters-container li a.category', |
| 1196 | ] |
| 1197 | ); |
| 1198 | |
| 1199 | $this->add_control('premium_blog_filter_border_radius', |
| 1200 | [ |
| 1201 | 'label' => __('Border Radius', 'premium-addons-for-elementor'), |
| 1202 | 'type' => Controls_Manager::SLIDER, |
| 1203 | 'size_units' => ['px','em','%'], |
| 1204 | 'selectors' => [ |
| 1205 | '{{WRAPPER}} .premium-blog-filters-container li a.category' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 1206 | ], |
| 1207 | 'separator' => 'after' |
| 1208 | ] |
| 1209 | ); |
| 1210 | |
| 1211 | $this->end_controls_tab(); |
| 1212 | |
| 1213 | $this->start_controls_tab('tab_filter_active', |
| 1214 | [ |
| 1215 | 'label' => __('Active', 'premium-addons-for-elementor'), |
| 1216 | ] |
| 1217 | ); |
| 1218 | |
| 1219 | $this->add_control('premium_blog_filter_active_color', |
| 1220 | [ |
| 1221 | 'label' => __('Color', 'premium-addons-for-elementor'), |
| 1222 | 'type' => Controls_Manager::COLOR, |
| 1223 | 'scheme' => [ |
| 1224 | 'type' => Scheme_Color::get_type(), |
| 1225 | 'value' => Scheme_Color::COLOR_1, |
| 1226 | ], |
| 1227 | 'selectors' => [ |
| 1228 | '{{WRAPPER}} .premium-blog-filters-container li a.active span' => 'color: {{VALUE}};', |
| 1229 | ] |
| 1230 | ] |
| 1231 | ); |
| 1232 | |
| 1233 | $this->add_control('premium_blog_background_active_color', |
| 1234 | [ |
| 1235 | 'label' => __('Background Color', 'premium-addons-for-elementor'), |
| 1236 | 'type' => Controls_Manager::COLOR, |
| 1237 | 'scheme' => [ |
| 1238 | 'type' => Scheme_Color::get_type(), |
| 1239 | 'value' => Scheme_Color::COLOR_2, |
| 1240 | ], |
| 1241 | 'selectors' => [ |
| 1242 | '{{WRAPPER}} .premium-blog-filters-container li a.active' => 'background-color: {{VALUE}};', |
| 1243 | ], |
| 1244 | ] |
| 1245 | ); |
| 1246 | |
| 1247 | $this->add_group_control( |
| 1248 | Group_Control_Border::get_type(), |
| 1249 | [ |
| 1250 | 'name' => 'filter_active_border', |
| 1251 | 'selector' => '{{WRAPPER}} .premium-blog-filters-container li a.active', |
| 1252 | ] |
| 1253 | ); |
| 1254 | |
| 1255 | $this->add_control('filter_active_border_radius', |
| 1256 | [ |
| 1257 | 'label' => __('Border Radius', 'premium-addons-for-elementor'), |
| 1258 | 'type' => Controls_Manager::SLIDER, |
| 1259 | 'size_units' => ['px','em','%'], |
| 1260 | 'selectors' => [ |
| 1261 | '{{WRAPPER}} .premium-blog-filters-container li a.active' => 'border-radius: {{SIZE}}{{UNIT}}', |
| 1262 | ], |
| 1263 | 'separator' => 'after' |
| 1264 | ] |
| 1265 | ); |
| 1266 | |
| 1267 | $this->end_controls_tab(); |
| 1268 | |
| 1269 | $this->end_controls_tabs(); |
| 1270 | |
| 1271 | $this->add_group_control( |
| 1272 | Group_Control_Box_Shadow::get_type(), |
| 1273 | [ |
| 1274 | 'name' => 'premium_blog_filter_shadow', |
| 1275 | 'selector' => '{{WRAPPER}} .premium-blog-filters-container li a.category' |
| 1276 | ] |
| 1277 | ); |
| 1278 | |
| 1279 | $this->add_responsive_control('premium_blog_filter_margin', |
| 1280 | [ |
| 1281 | 'label' => __('Margin', 'premium-addons-for-elementor'), |
| 1282 | 'type' => Controls_Manager::DIMENSIONS, |
| 1283 | 'size_units' => ['px', 'em', '%'], |
| 1284 | 'selectors' => [ |
| 1285 | '{{WRAPPER}} .premium-blog-filters-container li a.category' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1286 | ], |
| 1287 | ] |
| 1288 | ); |
| 1289 | |
| 1290 | $this->add_responsive_control('premium_blog_filter_padding', |
| 1291 | [ |
| 1292 | 'label' => __('Padding', 'premium-addons-for-elementor'), |
| 1293 | 'type' => Controls_Manager::DIMENSIONS, |
| 1294 | 'size_units' => ['px', 'em', '%'], |
| 1295 | 'selectors' => [ |
| 1296 | '{{WRAPPER}} .premium-blog-filters-container li a.category' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1297 | ], |
| 1298 | ] |
| 1299 | ); |
| 1300 | |
| 1301 | $this->end_controls_section(); |
| 1302 | |
| 1303 | $this->start_controls_section('premium_blog_image_style_section', |
| 1304 | [ |
| 1305 | 'label' => __('Image', 'premium-addons-for-elementor'), |
| 1306 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1307 | 'condition' => $featured_image_conditions |
| 1308 | ] |
| 1309 | ); |
| 1310 | |
| 1311 | $this->add_control('premium_blog_plus_color', |
| 1312 | [ |
| 1313 | 'label' => __('Plus Sign Color', 'premium-addons-for-elementor'), |
| 1314 | 'type' => Controls_Manager::COLOR, |
| 1315 | 'selectors' => [ |
| 1316 | '{{WRAPPER}} .premium-blog-thumbnail-container:before, {{WRAPPER}} .premium-blog-thumbnail-container:after' => 'background-color: {{VALUE}} !important', |
| 1317 | ], |
| 1318 | 'condition' => [ |
| 1319 | 'premium_blog_skin' => [ 'modern', 'cards' ] |
| 1320 | ] |
| 1321 | ] |
| 1322 | ); |
| 1323 | |
| 1324 | $this->add_control('premium_blog_overlay_color', |
| 1325 | [ |
| 1326 | 'label' => __('Overlay Color', 'premium-addons-for-elementor'), |
| 1327 | 'type' => Controls_Manager::COLOR, |
| 1328 | 'selectors' => [ |
| 1329 | '{{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}};', |
| 1330 | ] |
| 1331 | ] |
| 1332 | ); |
| 1333 | |
| 1334 | $this->add_control('premium_blog_border_effect_color', |
| 1335 | [ |
| 1336 | 'label' => __('Border Color', 'premium-addons-for-elementor'), |
| 1337 | 'type' => Controls_Manager::COLOR, |
| 1338 | 'scheme' => [ |
| 1339 | 'type' => Scheme_Color::get_type(), |
| 1340 | 'value' => Scheme_Color::COLOR_2, |
| 1341 | ], |
| 1342 | 'condition' => [ |
| 1343 | 'premium_blog_hover_color_effect' => 'bordered', |
| 1344 | ], |
| 1345 | 'selectors' => [ |
| 1346 | '{{WRAPPER}} .premium-blog-post-link:before, {{WRAPPER}} .premium-blog-post-link:after' => 'border-color: {{VALUE}};', |
| 1347 | ], |
| 1348 | ] |
| 1349 | ); |
| 1350 | |
| 1351 | $this->add_group_control( |
| 1352 | Group_Control_Css_Filter::get_type(), |
| 1353 | [ |
| 1354 | 'name' => 'css_filters', |
| 1355 | 'selector' => '{{WRAPPER}} .premium-blog-thumbnail-container img', |
| 1356 | ] |
| 1357 | ); |
| 1358 | |
| 1359 | $this->add_group_control( |
| 1360 | Group_Control_Css_Filter::get_type(), |
| 1361 | [ |
| 1362 | 'name' => 'hover_css_filters', |
| 1363 | 'label' => __('Hover CSS Filters', 'premium-addons-for-elementor'), |
| 1364 | 'selector' => '{{WRAPPER}} .premium-blog-post-container:hover .premium-blog-thumbnail-container img' |
| 1365 | ] |
| 1366 | ); |
| 1367 | |
| 1368 | $this->end_controls_section(); |
| 1369 | |
| 1370 | $this->start_controls_section('premium_blog_title_style_section', |
| 1371 | [ |
| 1372 | 'label' => __('Title', 'premium-addons-for-elementor'), |
| 1373 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1374 | ] |
| 1375 | ); |
| 1376 | |
| 1377 | $this->add_group_control( |
| 1378 | Group_Control_Typography::get_type(), |
| 1379 | [ |
| 1380 | 'name' => 'premium_blog_title_typo', |
| 1381 | 'scheme' => Scheme_Typography::TYPOGRAPHY_1, |
| 1382 | 'selector' => '{{WRAPPER}} .premium-blog-entry-title, {{WRAPPER}} .premium-blog-entry-title a', |
| 1383 | ] |
| 1384 | ); |
| 1385 | |
| 1386 | $this->add_control('premium_blog_title_color', |
| 1387 | [ |
| 1388 | 'label' => __('Color', 'premium-addons-for-elementor'), |
| 1389 | 'type' => Controls_Manager::COLOR, |
| 1390 | 'scheme' => [ |
| 1391 | 'type' => Scheme_Color::get_type(), |
| 1392 | 'value' => Scheme_Color::COLOR_2, |
| 1393 | ], |
| 1394 | 'selectors' => [ |
| 1395 | '{{WRAPPER}} .premium-blog-entry-title a' => 'color: {{VALUE}};', |
| 1396 | ] |
| 1397 | ] |
| 1398 | ); |
| 1399 | |
| 1400 | $this->add_control('premium_blog_title_hover_color', |
| 1401 | [ |
| 1402 | 'label' => __('Hover Color', 'premium-addons-for-elementor'), |
| 1403 | 'type' => Controls_Manager::COLOR, |
| 1404 | 'scheme' => [ |
| 1405 | 'type' => Scheme_Color::get_type(), |
| 1406 | 'value' => Scheme_Color::COLOR_1, |
| 1407 | ], |
| 1408 | 'selectors' => [ |
| 1409 | '{{WRAPPER}} .premium-blog-entry-title:hover a' => 'color: {{VALUE}};', |
| 1410 | ] |
| 1411 | ] |
| 1412 | ); |
| 1413 | |
| 1414 | $this->add_responsive_control('title_spacing', |
| 1415 | [ |
| 1416 | 'label' => __('Bottom Spacing', 'premium-addons-for-elementor'), |
| 1417 | 'type' => Controls_Manager::SLIDER, |
| 1418 | 'size_units' => ['px', 'em', '%'], |
| 1419 | 'selectors' => [ |
| 1420 | '{{WRAPPER}} .premium-blog-entry-title' => 'margin-bottom: {{SIZE}}{{UNIT}}', |
| 1421 | ] |
| 1422 | ] |
| 1423 | ); |
| 1424 | |
| 1425 | $this->end_controls_section(); |
| 1426 | |
| 1427 | $this->start_controls_section('post_categories_style_section', |
| 1428 | [ |
| 1429 | 'label' => __('Categories', 'premium-addons-for-elementor'), |
| 1430 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1431 | 'condition' => [ |
| 1432 | 'premium_blog_skin' => [ 'side', 'banner' ], |
| 1433 | 'premium_blog_categories_meta' => 'yes' |
| 1434 | ] |
| 1435 | ] |
| 1436 | ); |
| 1437 | |
| 1438 | $this->add_group_control( |
| 1439 | Group_Control_Typography::get_type(), |
| 1440 | [ |
| 1441 | 'name' => 'category_typography', |
| 1442 | 'scheme' => Scheme_Typography::TYPOGRAPHY_2, |
| 1443 | 'selector' => '{{WRAPPER}} .premium-blog-cats-container a', |
| 1444 | ] |
| 1445 | ); |
| 1446 | |
| 1447 | $repeater = new REPEATER(); |
| 1448 | |
| 1449 | $repeater->add_control('category_color', |
| 1450 | [ |
| 1451 | 'label' => __('Color', 'premium-addons-for-elementor'), |
| 1452 | 'type' => Controls_Manager::COLOR, |
| 1453 | 'selectors' => [ |
| 1454 | '{{WRAPPER}} {{CURRENT_ITEM}}' => 'color: {{VALUE}}', |
| 1455 | ] |
| 1456 | ] |
| 1457 | ); |
| 1458 | |
| 1459 | $repeater->add_control('category_hover_color', |
| 1460 | [ |
| 1461 | 'label' => __('Hover Color', 'premium-addons-for-elementor'), |
| 1462 | 'type' => Controls_Manager::COLOR, |
| 1463 | 'selectors' => [ |
| 1464 | '{{WRAPPER}} {{CURRENT_ITEM}}:hover' => 'color: {{VALUE}}', |
| 1465 | ] |
| 1466 | ] |
| 1467 | ); |
| 1468 | |
| 1469 | $repeater->add_control('category_background_color', |
| 1470 | [ |
| 1471 | 'label' => __('Background Color', 'premium-addons-for-elementor'), |
| 1472 | 'type' => Controls_Manager::COLOR, |
| 1473 | 'selectors' => [ |
| 1474 | '{{WRAPPER}} {{CURRENT_ITEM}}' => 'background-color: {{VALUE}}', |
| 1475 | ] |
| 1476 | ] |
| 1477 | ); |
| 1478 | |
| 1479 | $repeater->add_control('category_hover_background_color', |
| 1480 | [ |
| 1481 | 'label' => __('Hover Background Color', 'premium-addons-for-elementor'), |
| 1482 | 'type' => Controls_Manager::COLOR, |
| 1483 | 'selectors' => [ |
| 1484 | '{{WRAPPER}} {{CURRENT_ITEM}}:hover' => 'background-color: {{VALUE}}', |
| 1485 | ] |
| 1486 | ] |
| 1487 | ); |
| 1488 | |
| 1489 | $repeater->add_group_control( |
| 1490 | Group_Control_Border::get_type(), |
| 1491 | [ |
| 1492 | 'name' => 'category_border', |
| 1493 | 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}', |
| 1494 | ] |
| 1495 | ); |
| 1496 | |
| 1497 | $repeater->add_control('category_border_radius', |
| 1498 | [ |
| 1499 | 'label' => __('Border Radius', 'premium-addons-for-elementor'), |
| 1500 | 'type' => Controls_Manager::SLIDER, |
| 1501 | 'size_units' => ['px','em','%'], |
| 1502 | 'selectors' => [ |
| 1503 | '{{WRAPPER}} {{CURRENT_ITEM}}' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 1504 | ] |
| 1505 | ] |
| 1506 | ); |
| 1507 | |
| 1508 | $this->add_control('categories_repeater', |
| 1509 | [ |
| 1510 | 'label' => __('Categories', 'premium-addons-for-elementor'), |
| 1511 | 'type' => Controls_Manager::REPEATER, |
| 1512 | 'fields' => $repeater->get_controls(), |
| 1513 | 'default' => [ |
| 1514 | [ |
| 1515 | 'category_background_color' => '', |
| 1516 | ], |
| 1517 | ], |
| 1518 | 'render_type' => 'ui', |
| 1519 | 'condition' => [ |
| 1520 | 'premium_blog_skin' => [ 'side', 'banner' ], |
| 1521 | 'premium_blog_categories_meta' => 'yes' |
| 1522 | ] |
| 1523 | ] |
| 1524 | ); |
| 1525 | |
| 1526 | $this->add_responsive_control('categories_margin', |
| 1527 | [ |
| 1528 | 'label' => __('Margin', 'premium-addons-for-elementor'), |
| 1529 | 'type' => Controls_Manager::DIMENSIONS, |
| 1530 | 'size_units' => ['px', 'em', '%'], |
| 1531 | 'selectors' => [ |
| 1532 | '{{WRAPPER}} .premium-blog-cats-container a' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1533 | ] |
| 1534 | ] |
| 1535 | ); |
| 1536 | |
| 1537 | $this->add_responsive_control('categories_padding', |
| 1538 | [ |
| 1539 | 'label' => __('Padding', 'premium-addons-for-elementor'), |
| 1540 | 'type' => Controls_Manager::DIMENSIONS, |
| 1541 | 'size_units' => ['px', 'em', '%'], |
| 1542 | 'selectors' => [ |
| 1543 | '{{WRAPPER}} .premium-blog-cats-container a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1544 | ] |
| 1545 | ] |
| 1546 | ); |
| 1547 | |
| 1548 | $this->end_controls_section(); |
| 1549 | |
| 1550 | $this->start_controls_section('premium_blog_meta_style_section', |
| 1551 | [ |
| 1552 | 'label' => __('Metadata', 'premium-addons-for-elementor'), |
| 1553 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1554 | ] |
| 1555 | ); |
| 1556 | |
| 1557 | $this->add_group_control( |
| 1558 | Group_Control_Typography::get_type(), |
| 1559 | [ |
| 1560 | 'name' => 'premium_blog_meta_typo', |
| 1561 | 'scheme' => Scheme_Typography::TYPOGRAPHY_2, |
| 1562 | 'selector' => '{{WRAPPER}} .premium-blog-meta-data', |
| 1563 | ] |
| 1564 | ); |
| 1565 | |
| 1566 | $this->add_control('premium_blog_meta_color', |
| 1567 | [ |
| 1568 | 'label' => __('Metadata Color', 'premium-addons-for-elementor'), |
| 1569 | 'type' => Controls_Manager::COLOR, |
| 1570 | 'selectors' => [ |
| 1571 | '{{WRAPPER}} .premium-blog-meta-data > *' => 'color: {{VALUE}}', |
| 1572 | ] |
| 1573 | ] |
| 1574 | ); |
| 1575 | |
| 1576 | $this->add_control('premium_blog_meta_hover_color', |
| 1577 | [ |
| 1578 | 'label' => __('Links Hover Color', 'premium-addons-for-elementor'), |
| 1579 | 'type' => Controls_Manager::COLOR, |
| 1580 | 'selectors' => [ |
| 1581 | '{{WRAPPER}} .premium-blog-meta-data:not(.premium-blog-post-time):hover > *' => 'color: {{VALUE}}', |
| 1582 | ] |
| 1583 | ] |
| 1584 | ); |
| 1585 | |
| 1586 | $this->add_control('separator_color', |
| 1587 | [ |
| 1588 | 'label' => __('Separator Color', 'premium-addons-for-elementor'), |
| 1589 | 'type' => Controls_Manager::COLOR, |
| 1590 | 'separator' => 'before', |
| 1591 | 'selectors' => [ |
| 1592 | '{{WRAPPER}} .premium-blog-meta-separator' => 'color: {{VALUE}}', |
| 1593 | ] |
| 1594 | ] |
| 1595 | ); |
| 1596 | |
| 1597 | $this->end_controls_section(); |
| 1598 | |
| 1599 | $this->start_controls_section('premium_blog_content_style_section', |
| 1600 | [ |
| 1601 | 'label' => __('Content Box', 'premium-addons-for-elementor'), |
| 1602 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1603 | ] |
| 1604 | ); |
| 1605 | |
| 1606 | $this->add_group_control( |
| 1607 | Group_Control_Typography::get_type(), |
| 1608 | [ |
| 1609 | 'name' => 'premium_blog_content_typo', |
| 1610 | 'selector' => '{{WRAPPER}} .premium-blog-post-content', |
| 1611 | 'condition' => [ |
| 1612 | 'content_source' => 'excerpt' |
| 1613 | ] |
| 1614 | ] |
| 1615 | ); |
| 1616 | |
| 1617 | $this->add_control('premium_blog_post_content_color', |
| 1618 | [ |
| 1619 | 'label' => __('Text Color', 'premium-addons-for-elementor'), |
| 1620 | 'type' => Controls_Manager::COLOR, |
| 1621 | 'scheme' => [ |
| 1622 | 'type' => Scheme_Color::get_type(), |
| 1623 | 'value' => Scheme_Color::COLOR_3, |
| 1624 | ], |
| 1625 | 'selectors' => [ |
| 1626 | '{{WRAPPER}} .premium-blog-post-content' => 'color: {{VALUE}};', |
| 1627 | ], |
| 1628 | 'condition' => [ |
| 1629 | 'content_source' => 'excerpt' |
| 1630 | ] |
| 1631 | ] |
| 1632 | ); |
| 1633 | |
| 1634 | $this->add_responsive_control('excerpt_text_margin', |
| 1635 | [ |
| 1636 | 'label' => __('Text Margin', 'premium-addons-for-elementor'), |
| 1637 | 'type' => Controls_Manager::DIMENSIONS, |
| 1638 | 'size_units' => ['px', 'em', '%'], |
| 1639 | 'selectors' => [ |
| 1640 | '{{WRAPPER}} .premium-blog-post-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1641 | ], |
| 1642 | 'condition' => [ |
| 1643 | 'content_source' => 'excerpt' |
| 1644 | ] |
| 1645 | ] |
| 1646 | ); |
| 1647 | |
| 1648 | $this->add_control('premium_blog_content_background_color', |
| 1649 | [ |
| 1650 | 'label' => __('Background Color', 'premium-addons-for-elementor'), |
| 1651 | 'type' => Controls_Manager::COLOR, |
| 1652 | 'separator' => 'before', |
| 1653 | 'selectors' => [ |
| 1654 | '{{WRAPPER}} .premium-blog-content-wrapper' => 'background-color: {{VALUE}};', |
| 1655 | ], |
| 1656 | 'condition' => [ |
| 1657 | 'premium_blog_skin!' => 'banner' |
| 1658 | ] |
| 1659 | ] |
| 1660 | ); |
| 1661 | |
| 1662 | $this->add_group_control( |
| 1663 | Group_Control_Background::get_type(), |
| 1664 | [ |
| 1665 | 'name' => 'premium_blog_content_background_color', |
| 1666 | 'types' => [ 'classic', 'gradient' ], |
| 1667 | 'selector' => '{{WRAPPER}} .premium-blog-content-wrapper', |
| 1668 | 'condition' => [ |
| 1669 | 'premium_blog_skin' => 'banner' |
| 1670 | ] |
| 1671 | ] |
| 1672 | ); |
| 1673 | |
| 1674 | $this->add_group_control( |
| 1675 | Group_Control_Box_Shadow::get_type(), |
| 1676 | [ |
| 1677 | 'name' => 'premium_blog_box_shadow', |
| 1678 | 'selector' => '{{WRAPPER}} .premium-blog-content-wrapper', |
| 1679 | ] |
| 1680 | ); |
| 1681 | |
| 1682 | $this->add_responsive_control('prmeium_blog_content_margin', |
| 1683 | [ |
| 1684 | 'label' => __('Margin', 'premium-addons-for-elementor'), |
| 1685 | 'type' => Controls_Manager::DIMENSIONS, |
| 1686 | 'size_units' => ['px', 'em', '%'], |
| 1687 | 'selectors' => [ |
| 1688 | '{{WRAPPER}} .premium-blog-content-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1689 | ] |
| 1690 | ] |
| 1691 | ); |
| 1692 | |
| 1693 | $this->add_responsive_control('prmeium_blog_content_padding', |
| 1694 | [ |
| 1695 | 'label' => __('Padding', 'premium-addons-for-elementor'), |
| 1696 | 'type' => Controls_Manager::DIMENSIONS, |
| 1697 | 'size_units' => ['px', 'em', '%'], |
| 1698 | 'selectors' => [ |
| 1699 | '{{WRAPPER}} .premium-blog-content-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1700 | ] |
| 1701 | ] |
| 1702 | ); |
| 1703 | |
| 1704 | $this->end_controls_section(); |
| 1705 | |
| 1706 | $this->start_controls_section('premium_blog_read_more_style', |
| 1707 | [ |
| 1708 | 'label' => __('Button', 'premium-addons-for-elementor'), |
| 1709 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1710 | 'condition' => [ |
| 1711 | 'premium_blog_excerpt' => 'yes', |
| 1712 | 'premium_blog_excerpt_type' => 'link' |
| 1713 | ] |
| 1714 | ] |
| 1715 | ); |
| 1716 | |
| 1717 | $this->add_group_control( |
| 1718 | Group_Control_Typography::get_type(), |
| 1719 | [ |
| 1720 | 'name' => 'premium_blog_read_more_typo', |
| 1721 | 'selector' => '{{WRAPPER}} .premium-blog-excerpt-link', |
| 1722 | ] |
| 1723 | ); |
| 1724 | |
| 1725 | $this->add_responsive_control('read_more_spacing', |
| 1726 | [ |
| 1727 | 'label' => __('Spacing', 'premium-addons-for-elementor'), |
| 1728 | 'type' => Controls_Manager::SLIDER, |
| 1729 | 'selectors' => [ |
| 1730 | '{{WRAPPER}} .premium-blog-excerpt-link' => 'margin-top: {{SIZE}}px', |
| 1731 | ] |
| 1732 | ] |
| 1733 | ); |
| 1734 | |
| 1735 | $this->start_controls_tabs('read_more_style_tabs'); |
| 1736 | |
| 1737 | $this->start_controls_tab('read_more_tab_normal', |
| 1738 | [ |
| 1739 | 'label' => __('Normal', 'premium-addons-for-elementor'), |
| 1740 | |
| 1741 | ] |
| 1742 | ); |
| 1743 | |
| 1744 | $this->add_control('premium_blog_read_more_color', |
| 1745 | [ |
| 1746 | 'label' => __('Color', 'premium-addons-for-elementor'), |
| 1747 | 'type' => Controls_Manager::COLOR, |
| 1748 | 'selectors' => [ |
| 1749 | '{{WRAPPER}} .premium-blog-excerpt-link' => 'color: {{VALUE}};', |
| 1750 | ] |
| 1751 | ] |
| 1752 | ); |
| 1753 | |
| 1754 | $this->add_control('read_more_background_color', |
| 1755 | [ |
| 1756 | 'label' => __('Background Color', 'premium-addons-for-elementor'), |
| 1757 | 'type' => Controls_Manager::COLOR, |
| 1758 | 'selectors' => [ |
| 1759 | '{{WRAPPER}} .premium-blog-excerpt-link' => 'background-color: {{VALUE}};', |
| 1760 | ] |
| 1761 | ] |
| 1762 | ); |
| 1763 | |
| 1764 | $this->add_group_control( |
| 1765 | Group_Control_Border::get_type(), |
| 1766 | [ |
| 1767 | 'name' => 'read_more_border', |
| 1768 | 'selector' => '{{WRAPPER}} .premium-blog-excerpt-link', |
| 1769 | ] |
| 1770 | ); |
| 1771 | |
| 1772 | $this->add_control('read_more_border_radius', |
| 1773 | [ |
| 1774 | 'label' => __('Border Radius', 'premium-addons-for-elementor'), |
| 1775 | 'type' => Controls_Manager::SLIDER, |
| 1776 | 'size_units' => ['px','em','%'], |
| 1777 | 'selectors' => [ |
| 1778 | '{{WRAPPER}} .premium-blog-excerpt-link' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 1779 | ] |
| 1780 | ] |
| 1781 | ); |
| 1782 | |
| 1783 | $this->end_controls_tab(); |
| 1784 | |
| 1785 | $this->start_controls_tab('read_more_tab_hover', |
| 1786 | [ |
| 1787 | 'label' => __('Hover', 'premium-addons-for-elementor'), |
| 1788 | ] |
| 1789 | ); |
| 1790 | |
| 1791 | $this->add_control('premium_blog_read_more_hover_color', |
| 1792 | [ |
| 1793 | 'label' => __('Color', 'premium-addons-for-elementor'), |
| 1794 | 'type' => Controls_Manager::COLOR, |
| 1795 | 'selectors' => [ |
| 1796 | '{{WRAPPER}} .premium-blog-excerpt-link:hover' => 'color: {{VALUE}};', |
| 1797 | ] |
| 1798 | ] |
| 1799 | ); |
| 1800 | |
| 1801 | $this->add_control('read_more_hover_background_color', |
| 1802 | [ |
| 1803 | 'label' => __('Background Color', 'premium-addons-for-elementor'), |
| 1804 | 'type' => Controls_Manager::COLOR, |
| 1805 | 'selectors' => [ |
| 1806 | '{{WRAPPER}} .premium-blog-excerpt-link:hover' => 'background-color: {{VALUE}};', |
| 1807 | ] |
| 1808 | ] |
| 1809 | ); |
| 1810 | |
| 1811 | $this->add_group_control( |
| 1812 | Group_Control_Border::get_type(), |
| 1813 | [ |
| 1814 | 'name' => 'read_more_hover_border', |
| 1815 | 'selector' => '{{WRAPPER}} .premium-blog-excerpt-link:hover', |
| 1816 | ] |
| 1817 | ); |
| 1818 | |
| 1819 | $this->add_control('read_more_hover_border_radius', |
| 1820 | [ |
| 1821 | 'label' => __('Border Radius', 'premium-addons-for-elementor'), |
| 1822 | 'type' => Controls_Manager::SLIDER, |
| 1823 | 'size_units' => ['px','em','%'], |
| 1824 | 'selectors' => [ |
| 1825 | '{{WRAPPER}} .premium-blog-excerpt-link:hover' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 1826 | ] |
| 1827 | ] |
| 1828 | ); |
| 1829 | |
| 1830 | $this->end_controls_tab(); |
| 1831 | |
| 1832 | $this->end_controls_tabs(); |
| 1833 | |
| 1834 | $this->add_responsive_control('read_more_padding', |
| 1835 | [ |
| 1836 | 'label' => __('Padding', 'premium-addons-for-elementor'), |
| 1837 | 'type' => Controls_Manager::DIMENSIONS, |
| 1838 | 'size_units' => ['px', 'em', '%'], |
| 1839 | 'separator' => 'before', |
| 1840 | 'selectors' => [ |
| 1841 | '{{WRAPPER}} .premium-blog-excerpt-link' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1842 | ], |
| 1843 | ] |
| 1844 | ); |
| 1845 | |
| 1846 | $this->end_controls_section(); |
| 1847 | |
| 1848 | $this->start_controls_section('premium_blog_tags_style_section', |
| 1849 | [ |
| 1850 | 'label' => __('Tags', 'premium-addons-for-elementor'), |
| 1851 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1852 | ] |
| 1853 | ); |
| 1854 | |
| 1855 | $this->add_group_control( |
| 1856 | Group_Control_Typography::get_type(), |
| 1857 | [ |
| 1858 | 'name' => 'premium_blog_tags_typo', |
| 1859 | 'scheme' => Scheme_Typography::TYPOGRAPHY_2, |
| 1860 | 'selector' => '{{WRAPPER}} .premium-blog-post-tags-container', |
| 1861 | ] |
| 1862 | ); |
| 1863 | |
| 1864 | $this->add_control('premium_blog_tags_color', |
| 1865 | [ |
| 1866 | 'label' => __('Color', 'premium-addons-for-elementor'), |
| 1867 | 'type' => Controls_Manager::COLOR, |
| 1868 | 'scheme' => [ |
| 1869 | 'type' => Scheme_Color::get_type(), |
| 1870 | 'value' => Scheme_Color::COLOR_2, |
| 1871 | ], |
| 1872 | 'selectors' => [ |
| 1873 | '{{WRAPPER}} .premium-blog-post-tags-container' => 'color: {{VALUE}}', |
| 1874 | ] |
| 1875 | ] |
| 1876 | ); |
| 1877 | |
| 1878 | $this->add_control('premium_blog_tags_hoer_color', |
| 1879 | [ |
| 1880 | 'label' => __('Hover Color', 'premium-addons-for-elementor'), |
| 1881 | 'type' => Controls_Manager::COLOR, |
| 1882 | 'selectors' => [ |
| 1883 | '{{WRAPPER}} .premium-blog-post-tags-container a:hover' => 'color: {{VALUE}}', |
| 1884 | ] |
| 1885 | ] |
| 1886 | ); |
| 1887 | |
| 1888 | $this->end_controls_section(); |
| 1889 | |
| 1890 | $this->start_controls_section('premium_blog_box_style_section', |
| 1891 | [ |
| 1892 | 'label' => __('Box', 'premium-addons-for-elementor'), |
| 1893 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1894 | ] |
| 1895 | ); |
| 1896 | |
| 1897 | $this->add_control('premium_blog_box_background_color', |
| 1898 | [ |
| 1899 | 'label' => __('Background Color', 'premium-addons-for-elementor'), |
| 1900 | 'type' => Controls_Manager::COLOR, |
| 1901 | 'default' => '#f5f5f5', |
| 1902 | 'selectors' => [ |
| 1903 | '{{WRAPPER}} .premium-blog-post-container' => 'background-color: {{VALUE}};', |
| 1904 | ] |
| 1905 | ] |
| 1906 | ); |
| 1907 | |
| 1908 | $this->add_group_control( |
| 1909 | Group_Control_Border::get_type(), |
| 1910 | [ |
| 1911 | 'name' => 'box_border', |
| 1912 | 'selector' => '{{WRAPPER}} .premium-blog-post-container', |
| 1913 | ] |
| 1914 | ); |
| 1915 | |
| 1916 | $this->add_control('box_border_radius', |
| 1917 | [ |
| 1918 | 'label' => __('Border Radius', 'premium-addons-for-elementor'), |
| 1919 | 'type' => Controls_Manager::SLIDER, |
| 1920 | 'size_units' => ['px','em', '%'], |
| 1921 | 'selectors' => [ |
| 1922 | '{{WRAPPER}} .premium-blog-post-container' => 'border-radius: {{SIZE}}{{UNIT}};' |
| 1923 | ] |
| 1924 | ] |
| 1925 | ); |
| 1926 | |
| 1927 | $this->add_responsive_control('prmeium_blog_box_padding', |
| 1928 | [ |
| 1929 | 'label' => __('Spacing', 'premium-addons-for-elementor'), |
| 1930 | 'type' => Controls_Manager::DIMENSIONS, |
| 1931 | 'size_units' => ['px', 'em', '%'], |
| 1932 | 'selectors' => [ |
| 1933 | '{{WRAPPER}} .premium-blog-post-outer-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1934 | ] |
| 1935 | ] |
| 1936 | ); |
| 1937 | |
| 1938 | $this->add_responsive_control('prmeium_blog_inner_box_padding', |
| 1939 | [ |
| 1940 | 'label' => __('Padding', 'premium-addons-for-elementor'), |
| 1941 | 'type' => Controls_Manager::DIMENSIONS, |
| 1942 | 'size_units' => ['px', 'em', '%'], |
| 1943 | 'selectors' => [ |
| 1944 | '{{WRAPPER}} .premium-blog-post-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1945 | ] |
| 1946 | ] |
| 1947 | ); |
| 1948 | |
| 1949 | $this->end_controls_section(); |
| 1950 | |
| 1951 | $this->start_controls_section('premium_blog_pagination_Style', |
| 1952 | [ |
| 1953 | 'label' => __('Pagination', 'premium-addons-for-elementor'), |
| 1954 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1955 | 'condition' => [ |
| 1956 | 'premium_blog_paging' => 'yes', |
| 1957 | ] |
| 1958 | ] |
| 1959 | ); |
| 1960 | |
| 1961 | $this->add_group_control( |
| 1962 | Group_Control_Typography::get_type(), |
| 1963 | [ |
| 1964 | 'name' => 'premium_blog_pagination_typo', |
| 1965 | 'selector' => '{{WRAPPER}} .premium-blog-pagination-container > .page-numbers', |
| 1966 | ] |
| 1967 | ); |
| 1968 | |
| 1969 | $this->start_controls_tabs('premium_blog_pagination_colors'); |
| 1970 | |
| 1971 | $this->start_controls_tab('premium_blog_pagination_nomral', |
| 1972 | [ |
| 1973 | 'label' => __('Normal', 'premium-addons-for-elementor'), |
| 1974 | |
| 1975 | ] |
| 1976 | ); |
| 1977 | |
| 1978 | $this->add_control('prmeium_blog_pagination_color', |
| 1979 | [ |
| 1980 | 'label' => __('Color', 'premium-addons-for-elementor'), |
| 1981 | 'type' => Controls_Manager::COLOR, |
| 1982 | 'scheme' => [ |
| 1983 | 'type' => Scheme_Color::get_type(), |
| 1984 | 'value' => Scheme_Color::COLOR_2, |
| 1985 | ], |
| 1986 | 'selectors' => [ |
| 1987 | '{{WRAPPER}} .premium-blog-pagination-container .page-numbers' => 'color: {{VALUE}};' |
| 1988 | ] |
| 1989 | ] |
| 1990 | ); |
| 1991 | |
| 1992 | $this->add_control('prmeium_blog_pagination_back_color', |
| 1993 | [ |
| 1994 | 'label' => __('Background Color', 'premium-addons-for-elementor'), |
| 1995 | 'type' => Controls_Manager::COLOR, |
| 1996 | 'scheme' => [ |
| 1997 | 'type' => Scheme_Color::get_type(), |
| 1998 | 'value' => Scheme_Color::COLOR_1, |
| 1999 | ], |
| 2000 | 'selectors' => [ |
| 2001 | '{{WRAPPER}} .premium-blog-pagination-container .page-numbers' => 'background-color: {{VALUE}};' |
| 2002 | ] |
| 2003 | ] |
| 2004 | ); |
| 2005 | |
| 2006 | $this->add_group_control( |
| 2007 | Group_Control_Border::get_type(), |
| 2008 | [ |
| 2009 | 'name' => 'navigation_border', |
| 2010 | 'separator' => 'before', |
| 2011 | 'selector' => '{{WRAPPER}} .premium-blog-pagination-container .page-numbers', |
| 2012 | ] |
| 2013 | ); |
| 2014 | |
| 2015 | $this->add_control('navigation_border_radius', |
| 2016 | [ |
| 2017 | 'label' => __('Border Radius', 'premium-addons-for-elementor'), |
| 2018 | 'type' => Controls_Manager::SLIDER, |
| 2019 | 'size_units' => ['px', '%' ,'em'], |
| 2020 | 'selectors' => [ |
| 2021 | '{{WRAPPER}} .premium-blog-pagination-container .page-numbers' => 'border-radius: {{SIZE}}{{UNIT}};' |
| 2022 | ] |
| 2023 | ] |
| 2024 | ); |
| 2025 | |
| 2026 | $this->end_controls_tab(); |
| 2027 | |
| 2028 | $this->start_controls_tab('premium_blog_pagination_hover', |
| 2029 | [ |
| 2030 | 'label' => __('Hover', 'premium-addons-for-elementor'), |
| 2031 | |
| 2032 | ] |
| 2033 | ); |
| 2034 | |
| 2035 | $this->add_control('prmeium_blog_pagination_hover_color', |
| 2036 | [ |
| 2037 | 'label' => __('Color', 'premium-addons-for-elementor'), |
| 2038 | 'type' => Controls_Manager::COLOR, |
| 2039 | 'scheme' => [ |
| 2040 | 'type' => Scheme_Color::get_type(), |
| 2041 | 'value' => Scheme_Color::COLOR_1, |
| 2042 | ], |
| 2043 | 'selectors' => [ |
| 2044 | '{{WRAPPER}} .premium-blog-pagination-container .page-numbers:hover' => 'color: {{VALUE}};' |
| 2045 | ] |
| 2046 | ] |
| 2047 | ); |
| 2048 | |
| 2049 | $this->add_control('prmeium_blog_pagination_back_hover_color', |
| 2050 | [ |
| 2051 | 'label' => __('Background Color', 'premium-addons-for-elementor'), |
| 2052 | 'type' => Controls_Manager::COLOR, |
| 2053 | 'scheme' => [ |
| 2054 | 'type' => Scheme_Color::get_type(), |
| 2055 | 'value' => Scheme_Color::COLOR_2, |
| 2056 | ], |
| 2057 | 'selectors' => [ |
| 2058 | '{{WRAPPER}} .premium-blog-pagination-container .page-numbers:hover' => 'background-color: {{VALUE}};' |
| 2059 | ] |
| 2060 | ] |
| 2061 | ); |
| 2062 | |
| 2063 | $this->add_group_control( |
| 2064 | Group_Control_Border::get_type(), |
| 2065 | [ |
| 2066 | 'name' => 'hover_navigation_border', |
| 2067 | 'separator' => 'before', |
| 2068 | 'selector' => '{{WRAPPER}} .premium-blog-pagination-container .page-numbers:hover', |
| 2069 | ] |
| 2070 | ); |
| 2071 | |
| 2072 | $this->add_control('hover_navigation_border_radius', |
| 2073 | [ |
| 2074 | 'label' => __('Border Radius', 'premium-addons-for-elementor'), |
| 2075 | 'type' => Controls_Manager::SLIDER, |
| 2076 | 'size_units' => ['px', '%' ,'em'], |
| 2077 | 'selectors' => [ |
| 2078 | '{{WRAPPER}} .premium-blog-pagination-container .page-numbers:hover' => 'border-radius: {{SIZE}}{{UNIT}};' |
| 2079 | ] |
| 2080 | ] |
| 2081 | ); |
| 2082 | |
| 2083 | $this->end_controls_tab(); |
| 2084 | |
| 2085 | $this->start_controls_tab('premium_blog_pagination_active', |
| 2086 | [ |
| 2087 | 'label' => __('Active', 'premium-addons-for-elementor'), |
| 2088 | |
| 2089 | ] |
| 2090 | ); |
| 2091 | |
| 2092 | $this->add_control('prmeium_blog_pagination_active_color', |
| 2093 | [ |
| 2094 | 'label' => __('Color', 'premium-addons-for-elementor'), |
| 2095 | 'type' => Controls_Manager::COLOR, |
| 2096 | 'scheme' => [ |
| 2097 | 'type' => Scheme_Color::get_type(), |
| 2098 | 'value' => Scheme_Color::COLOR_1, |
| 2099 | ], |
| 2100 | 'selectors' => [ |
| 2101 | '{{WRAPPER}} .premium-blog-pagination-container span.current' => 'color: {{VALUE}};' |
| 2102 | ] |
| 2103 | ] |
| 2104 | ); |
| 2105 | |
| 2106 | $this->add_control('prmeium_blog_pagination_back_active_color', |
| 2107 | [ |
| 2108 | 'label' => __('Background Color', 'premium-addons-for-elementor'), |
| 2109 | 'type' => Controls_Manager::COLOR, |
| 2110 | 'scheme' => [ |
| 2111 | 'type' => Scheme_Color::get_type(), |
| 2112 | 'value' => Scheme_Color::COLOR_2, |
| 2113 | ], |
| 2114 | 'selectors' => [ |
| 2115 | '{{WRAPPER}} .premium-blog-pagination-container span.current' => 'background-color: {{VALUE}};' |
| 2116 | ] |
| 2117 | ] |
| 2118 | ); |
| 2119 | |
| 2120 | $this->add_group_control( |
| 2121 | Group_Control_Border::get_type(), |
| 2122 | [ |
| 2123 | 'name' => 'active_navigation_border', |
| 2124 | 'separator' => 'before', |
| 2125 | 'selector' => '{{WRAPPER}} .premium-blog-pagination-container span.current', |
| 2126 | ] |
| 2127 | ); |
| 2128 | |
| 2129 | $this->add_control('active_navigation_border_radius', |
| 2130 | [ |
| 2131 | 'label' => __('Border Radius', 'premium-addons-for-elementor'), |
| 2132 | 'type' => Controls_Manager::SLIDER, |
| 2133 | 'size_units' => ['px', '%' ,'em'], |
| 2134 | 'selectors' => [ |
| 2135 | '{{WRAPPER}} .premium-blog-pagination-container span.current' => 'border-radius: {{SIZE}}{{UNIT}};' |
| 2136 | ] |
| 2137 | ] |
| 2138 | ); |
| 2139 | |
| 2140 | $this->end_controls_tab(); |
| 2141 | |
| 2142 | $this->end_controls_tabs(); |
| 2143 | |
| 2144 | $this->add_responsive_control('prmeium_blog_pagination_margin', |
| 2145 | [ |
| 2146 | 'label' => __('Margin', 'premium-addons-for-elementor'), |
| 2147 | 'type' => Controls_Manager::DIMENSIONS, |
| 2148 | 'size_units' => ['px', 'em', '%'], |
| 2149 | 'separator' => 'before', |
| 2150 | 'selectors' => [ |
| 2151 | '{{WRAPPER}} .premium-blog-pagination-container .page-numbers' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 2152 | ] |
| 2153 | ] |
| 2154 | ); |
| 2155 | |
| 2156 | $this->add_responsive_control('prmeium_blog_pagination_padding', |
| 2157 | [ |
| 2158 | 'label' => __('Padding', 'premium-addons-for-elementor'), |
| 2159 | 'type' => Controls_Manager::DIMENSIONS, |
| 2160 | 'size_units' => ['px', 'em', '%'], |
| 2161 | 'selectors' => [ |
| 2162 | '{{WRAPPER}} .premium-blog-pagination-container .page-numbers' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 2163 | ] |
| 2164 | ] |
| 2165 | ); |
| 2166 | |
| 2167 | $this->add_control('pagination_overlay_color', |
| 2168 | [ |
| 2169 | 'label' => __('Overlay Color', 'premium-addons-for-elementor'), |
| 2170 | 'type' => Controls_Manager::COLOR, |
| 2171 | 'separator' => 'before', |
| 2172 | 'selectors' => [ |
| 2173 | '{{WRAPPER}} .premium-loading-feed' => 'background-color: {{VALUE}}' |
| 2174 | ] |
| 2175 | ] |
| 2176 | ); |
| 2177 | |
| 2178 | $this->add_control('spinner_color', |
| 2179 | [ |
| 2180 | 'label' => __('Spinner Color', 'premium-addons-for-elementor'), |
| 2181 | 'type' => Controls_Manager::COLOR, |
| 2182 | 'selectors' => [ |
| 2183 | '{{WRAPPER}} .premium-loader' => 'border-color: {{VALUE}}' |
| 2184 | ] |
| 2185 | ] |
| 2186 | ); |
| 2187 | |
| 2188 | $this->add_control('spinner_fill_color', |
| 2189 | [ |
| 2190 | 'label' => __('Fill Color', 'premium-addons-for-elementor'), |
| 2191 | 'type' => Controls_Manager::COLOR, |
| 2192 | 'selectors' => [ |
| 2193 | '{{WRAPPER}} .premium-loader' => 'border-top-color: {{VALUE}}' |
| 2194 | ] |
| 2195 | ] |
| 2196 | ); |
| 2197 | |
| 2198 | $this->end_controls_section(); |
| 2199 | |
| 2200 | $this->start_controls_section('carousel_dots_style', |
| 2201 | [ |
| 2202 | 'label' => __('Carousel Dots', 'premium-addons-for-elementor'), |
| 2203 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2204 | 'condition' => [ |
| 2205 | 'premium_blog_carousel' => 'yes', |
| 2206 | 'premium_blog_carousel_dots' => 'yes' |
| 2207 | ] |
| 2208 | ] |
| 2209 | ); |
| 2210 | |
| 2211 | $this->add_control('carousel_dot_navigation_color', |
| 2212 | [ |
| 2213 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2214 | 'type' => Controls_Manager::COLOR, |
| 2215 | 'scheme' => [ |
| 2216 | 'type' => Scheme_Color::get_type(), |
| 2217 | 'value' => Scheme_Color::COLOR_2, |
| 2218 | ], |
| 2219 | 'selectors' => [ |
| 2220 | '{{WRAPPER}} ul.slick-dots li' => 'color: {{VALUE}}' |
| 2221 | ] |
| 2222 | ] |
| 2223 | ); |
| 2224 | |
| 2225 | $this->add_control('carousel_dot_navigation_active_color', |
| 2226 | [ |
| 2227 | 'label' => __( 'Active Color', 'premium-addons-for-elementor' ), |
| 2228 | 'type' => Controls_Manager::COLOR, |
| 2229 | 'scheme' => [ |
| 2230 | 'type' => Scheme_Color::get_type(), |
| 2231 | 'value' => Scheme_Color::COLOR_1, |
| 2232 | ], |
| 2233 | 'selectors' => [ |
| 2234 | '{{WRAPPER}} ul.slick-dots li.slick-active' => 'color: {{VALUE}}' |
| 2235 | ] |
| 2236 | ] |
| 2237 | ); |
| 2238 | |
| 2239 | $this->end_controls_section(); |
| 2240 | |
| 2241 | $this->start_controls_section('carousel_arrows_style', |
| 2242 | [ |
| 2243 | 'label' => __('Carousel Arrows', 'premium-addons-for-elementor'), |
| 2244 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2245 | 'condition' => [ |
| 2246 | 'premium_blog_carousel' => 'yes', |
| 2247 | 'premium_blog_carousel_arrows' => 'yes' |
| 2248 | ] |
| 2249 | ] |
| 2250 | ); |
| 2251 | |
| 2252 | $this->add_control('arrow_color', |
| 2253 | [ |
| 2254 | 'label' => __('Color', 'premium-addons-for-elementor'), |
| 2255 | 'type' => Controls_Manager::COLOR, |
| 2256 | 'scheme' => [ |
| 2257 | 'type' => Scheme_Color::get_type(), |
| 2258 | 'value' => Scheme_Color::COLOR_1, |
| 2259 | ], |
| 2260 | 'selectors' => [ |
| 2261 | '{{WRAPPER}} .premium-blog-wrap .slick-arrow' => 'color: {{VALUE}};', |
| 2262 | ] |
| 2263 | ] |
| 2264 | ); |
| 2265 | |
| 2266 | $this->add_responsive_control('premium_blog_carousel_arrow_size', |
| 2267 | [ |
| 2268 | 'label' => __('Size', 'premium-addons-for-elementor'), |
| 2269 | 'type' => Controls_Manager::SLIDER, |
| 2270 | 'size_units' => ['px', '%' ,'em'], |
| 2271 | 'selectors' => [ |
| 2272 | '{{WRAPPER}} .premium-blog-wrap .slick-arrow i' => 'font-size: {{SIZE}}{{UNIT}};' |
| 2273 | ] |
| 2274 | ] |
| 2275 | ); |
| 2276 | |
| 2277 | $this->add_control('premium_blog_carousel_arrow_background', |
| 2278 | [ |
| 2279 | 'label' => __('Background Color', 'premium-addons-for-elementor'), |
| 2280 | 'type' => Controls_Manager::COLOR, |
| 2281 | 'scheme' => [ |
| 2282 | 'type' => Scheme_Color::get_type(), |
| 2283 | 'value' => Scheme_Color::COLOR_2, |
| 2284 | ], |
| 2285 | 'selectors' => [ |
| 2286 | '{{WRAPPER}} .premium-blog-wrap .slick-arrow' => 'background-color: {{VALUE}};', |
| 2287 | ] |
| 2288 | ] |
| 2289 | ); |
| 2290 | |
| 2291 | $this->add_control('premium_blog_carousel_border_radius', |
| 2292 | [ |
| 2293 | 'label' => __('Border Radius', 'premium-addons-for-elementor'), |
| 2294 | 'type' => Controls_Manager::SLIDER, |
| 2295 | 'size_units' => ['px', '%' ,'em'], |
| 2296 | 'selectors' => [ |
| 2297 | '{{WRAPPER}} .premium-blog-wrap .slick-arrow' => 'border-radius: {{SIZE}}{{UNIT}};' |
| 2298 | ] |
| 2299 | ] |
| 2300 | ); |
| 2301 | |
| 2302 | $this->add_control('premium_blog_carousel_arrow_padding', |
| 2303 | [ |
| 2304 | 'label' => __('Padding', 'premium-addons-for-elementor'), |
| 2305 | 'type' => Controls_Manager::SLIDER, |
| 2306 | 'size_units' => ['px', '%' ,'em'], |
| 2307 | 'selectors' => [ |
| 2308 | '{{WRAPPER}} .premium-blog-wrap .slick-arrow' => 'padding: {{SIZE}}{{UNIT}};' |
| 2309 | ] |
| 2310 | ] |
| 2311 | ); |
| 2312 | |
| 2313 | $this->end_controls_section(); |
| 2314 | |
| 2315 | } |
| 2316 | |
| 2317 | |
| 2318 | /** |
| 2319 | * Get Filter Array. |
| 2320 | * |
| 2321 | * Returns an array of filters |
| 2322 | * |
| 2323 | * @since 3.20.8 |
| 2324 | * @access protected |
| 2325 | * |
| 2326 | * @param $filter string filter by |
| 2327 | * |
| 2328 | * @return array |
| 2329 | */ |
| 2330 | public function get_filter_array( $filter ) { |
| 2331 | |
| 2332 | $settings = $this->get_settings(); |
| 2333 | |
| 2334 | $post_type = $settings['post_type_filter']; |
| 2335 | |
| 2336 | if( 'tag' === $filter && 'post' === $post_type ) { |
| 2337 | $filter = 'post_tag'; |
| 2338 | } |
| 2339 | |
| 2340 | $filter_rule = isset( $settings[ $filter . '_' . $post_type . '_filter_rule' ] ) ? $settings[ $filter . '_' . $post_type . '_filter_rule' ] : ''; |
| 2341 | |
| 2342 | //Fix: Make sure there is a value set for the current tax control |
| 2343 | if( empty( $filter_rule ) ) { |
| 2344 | return; |
| 2345 | } |
| 2346 | |
| 2347 | $filters = $settings[ 'tax_' . $filter . '_' . $post_type . '_filter' ]; |
| 2348 | |
| 2349 | // Get the categories based on filter source. |
| 2350 | $taxs = get_terms( $filter ); |
| 2351 | |
| 2352 | $tabs_array = array(); |
| 2353 | |
| 2354 | if ( is_wp_error( $taxs ) ) { |
| 2355 | return array(); |
| 2356 | } |
| 2357 | |
| 2358 | if ( empty( $filters ) || '' === $filters ) { |
| 2359 | |
| 2360 | $tabs_array = $taxs; |
| 2361 | |
| 2362 | } else { |
| 2363 | |
| 2364 | foreach ( $taxs as $key => $value ) { |
| 2365 | |
| 2366 | if ( 'IN' === $filter_rule ) { |
| 2367 | |
| 2368 | if ( in_array( $value->slug, $filters, true ) ) { |
| 2369 | |
| 2370 | $tabs_array[] = $value; |
| 2371 | } |
| 2372 | } else { |
| 2373 | |
| 2374 | if ( ! in_array( $value->slug, $filters, true ) ) { |
| 2375 | |
| 2376 | $tabs_array[] = $value; |
| 2377 | } |
| 2378 | } |
| 2379 | } |
| 2380 | } |
| 2381 | |
| 2382 | return $tabs_array; |
| 2383 | } |
| 2384 | |
| 2385 | /* |
| 2386 | * Get Filter Tabs Markup |
| 2387 | * |
| 2388 | * @since 3.11.2 |
| 2389 | * @access protected |
| 2390 | */ |
| 2391 | protected function get_filter_tabs_markup() { |
| 2392 | |
| 2393 | $settings = $this->get_settings(); |
| 2394 | |
| 2395 | $filter_rule = $settings['filter_tabs_type']; |
| 2396 | |
| 2397 | $filters = $this->get_filter_array( $filter_rule ); |
| 2398 | |
| 2399 | if( empty( $filters ) ) |
| 2400 | return; |
| 2401 | |
| 2402 | ?> |
| 2403 | <div class="premium-blog-filter"> |
| 2404 | <ul class="premium-blog-filters-container"> |
| 2405 | <?php if( ! empty( $settings['premium_blog_tab_label'] ) ) : ?> |
| 2406 | <li> |
| 2407 | <a href="javascript:;" class="category active" data-filter="*"> |
| 2408 | <span><?php echo esc_html( $settings['premium_blog_tab_label'] ); ?></span> |
| 2409 | </a> |
| 2410 | </li> |
| 2411 | <?php endif; ?> |
| 2412 | <?php foreach( $filters as $index => $filter ) { |
| 2413 | $key = 'blog_category_' . $index; |
| 2414 | |
| 2415 | // $name = $filter; |
| 2416 | // if( 'tags' === $filter_rule ) { |
| 2417 | // $name = ucfirst( $name ); |
| 2418 | // } |
| 2419 | |
| 2420 | // $name_filter = str_replace(' ', '-', $name ); |
| 2421 | // $name_lower = strtolower( $name_filter ); |
| 2422 | |
| 2423 | $this->add_render_attribute( $key, 'class', 'category' ); |
| 2424 | |
| 2425 | if( empty( $settings['premium_blog_tab_label'] ) && 0 === $index ) { |
| 2426 | $this->add_render_attribute( $key, 'class', 'active' ); |
| 2427 | } |
| 2428 | ?> |
| 2429 | <li> |
| 2430 | <a href="javascript:;" <?php echo $this->get_render_attribute_string( $key ); ?> data-filter="<?php echo esc_attr( $filter->slug ); ?>"> |
| 2431 | <span><?php echo $filter->name; ?></span> |
| 2432 | </a> |
| 2433 | </li> |
| 2434 | <?php } ?> |
| 2435 | </ul> |
| 2436 | </div> |
| 2437 | <?php |
| 2438 | } |
| 2439 | |
| 2440 | /** |
| 2441 | * Render Blog output on the frontend. |
| 2442 | * |
| 2443 | * Written in PHP and used to generate the final HTML. |
| 2444 | * |
| 2445 | * @since 0.0.1 |
| 2446 | * @access protected |
| 2447 | */ |
| 2448 | protected function render() { |
| 2449 | |
| 2450 | $settings = $this->get_settings(); |
| 2451 | |
| 2452 | $settings['widget_id'] = $this->get_id(); |
| 2453 | |
| 2454 | // $offset = ! empty( $settings['premium_blog_offset'] ) ? $settings['premium_blog_offset'] : 0; |
| 2455 | |
| 2456 | // $post_per_page = ! empty( $settings['premium_blog_number_of_posts'] ) ? $settings['premium_blog_number_of_posts'] : 3; |
| 2457 | |
| 2458 | $blog_helper = Blog_Helper::getInstance(); |
| 2459 | |
| 2460 | $blog_helper->set_widget_settings( $settings ); |
| 2461 | |
| 2462 | $query = $blog_helper->get_query_posts(); |
| 2463 | |
| 2464 | if( ! $query->have_posts() ) { |
| 2465 | |
| 2466 | $this->get_empty_query_message(); |
| 2467 | return; |
| 2468 | } |
| 2469 | |
| 2470 | if ( $settings['premium_blog_paging'] === 'yes' ) { |
| 2471 | |
| 2472 | $total_pages = $query->max_num_pages; |
| 2473 | |
| 2474 | if ( !empty( $settings[ 'max_pages' ] ) ) { |
| 2475 | $total_pages = min( $settings[ 'max_pages' ], $total_pages ); |
| 2476 | } |
| 2477 | |
| 2478 | } |
| 2479 | |
| 2480 | $carousel = 'yes' == $settings['premium_blog_carousel'] ? true : false; |
| 2481 | |
| 2482 | $this->add_render_attribute( 'blog', 'class', 'premium-blog-wrap' ); |
| 2483 | |
| 2484 | if( 'yes' === $settings['premium_blog_grid'] ) { |
| 2485 | |
| 2486 | $this->add_render_attribute('blog', |
| 2487 | [ |
| 2488 | 'class' => 'premium-blog-' . $settings['premium_blog_layout'], |
| 2489 | 'data-layout' => $settings['premium_blog_layout'], |
| 2490 | 'data-equal' => $settings['force_height'] |
| 2491 | ] |
| 2492 | ); |
| 2493 | |
| 2494 | } else { |
| 2495 | |
| 2496 | $this->add_render_attribute( 'blog', 'class', 'premium-blog-list' ); |
| 2497 | |
| 2498 | } |
| 2499 | |
| 2500 | //Add page ID to be used later to get posts by AJAX |
| 2501 | $page_id = ''; |
| 2502 | if ( null !== Plugin::$instance->documents->get_current() ) { |
| 2503 | $page_id = Plugin::$instance->documents->get_current()->get_main_id(); |
| 2504 | } |
| 2505 | $this->add_render_attribute( 'blog', 'data-page', $page_id ); |
| 2506 | |
| 2507 | |
| 2508 | if ( $settings['premium_blog_paging'] === 'yes' && $total_pages > 1 ) { |
| 2509 | |
| 2510 | $this->add_render_attribute('blog', 'data-pagination', 'true' ); |
| 2511 | |
| 2512 | } |
| 2513 | |
| 2514 | if ( $carousel ) { |
| 2515 | |
| 2516 | $play = 'yes' === $settings['premium_blog_carousel_play'] ? true : false; |
| 2517 | $fade = 'yes' === $settings['premium_blog_carousel_fade'] ? 'true' : 'false'; |
| 2518 | $arrows = 'yes' === $settings['premium_blog_carousel_arrows'] ? 'true' : 'false'; |
| 2519 | $grid = 'yes' === $settings['premium_blog_grid'] ? 'true' : 'false'; |
| 2520 | $center_mode = 'yes' === $settings['premium_blog_carousel_center'] ? 'true' : 'false'; |
| 2521 | $spacing = intval( $settings['premium_blog_carousel_spacing'] ); |
| 2522 | $slides_scroll = $settings['slides_to_scroll']; |
| 2523 | |
| 2524 | $speed = ! empty( $settings['premium_blog_carousel_autoplay_speed'] ) ? $settings['premium_blog_carousel_autoplay_speed'] : 5000; |
| 2525 | $dots = 'yes' === $settings['premium_blog_carousel_dots'] ? 'true' : 'false'; |
| 2526 | |
| 2527 | $columns = intval ( 100 / substr( $settings['premium_blog_columns_number'], 0, strpos( $settings['premium_blog_columns_number'], '%') ) ); |
| 2528 | |
| 2529 | $columns_tablet = intval ( 100 / substr( $settings['premium_blog_columns_number_tablet'], 0, strpos( $settings['premium_blog_columns_number_tablet'], '%') ) ); |
| 2530 | |
| 2531 | $columns_mobile = intval ( 100 / substr( $settings['premium_blog_columns_number_mobile'], 0, strpos( $settings['premium_blog_columns_number_mobile'], '%') ) ); |
| 2532 | |
| 2533 | $carousel_settings = [ |
| 2534 | 'data-carousel' => $carousel, |
| 2535 | 'data-grid' => $grid, |
| 2536 | 'data-fade' => $fade, |
| 2537 | 'data-play' => $play, |
| 2538 | 'data-center' => $center_mode, |
| 2539 | 'data-slides-spacing' => $spacing, |
| 2540 | 'data-speed' => $speed, |
| 2541 | 'data-col' => $columns, |
| 2542 | 'data-col-tablet' => $columns_tablet, |
| 2543 | 'data-col-mobile' => $columns_mobile, |
| 2544 | 'data-arrows' => $arrows, |
| 2545 | 'data-dots' => $dots, |
| 2546 | 'data-scroll-slides' => $slides_scroll |
| 2547 | ]; |
| 2548 | |
| 2549 | $this->add_render_attribute( 'blog', $carousel_settings ); |
| 2550 | |
| 2551 | |
| 2552 | } |
| 2553 | |
| 2554 | ?> |
| 2555 | <div class="premium-blog"> |
| 2556 | <?php if ( 'yes' === $settings['premium_blog_cat_tabs'] && 'yes' !== $settings['premium_blog_carousel'] ) : ?> |
| 2557 | <?php $this->get_filter_tabs_markup(); ?> |
| 2558 | <?php endif; ?> |
| 2559 | <div <?php echo $this->get_render_attribute_string('blog'); ?>> |
| 2560 | <?php |
| 2561 | $id = $this->get_id(); |
| 2562 | $blog_helper->render_posts(); |
| 2563 | ?> |
| 2564 | </div> |
| 2565 | </div> |
| 2566 | <?php if ( $settings['premium_blog_paging'] === 'yes' && $total_pages > 1 ) : ?> |
| 2567 | <div class="premium-blog-footer"> |
| 2568 | <?php $blog_helper->render_pagination(); ?> |
| 2569 | </div> |
| 2570 | <?php |
| 2571 | endif; |
| 2572 | |
| 2573 | if ( Plugin::instance()->editor->is_edit_mode() ) { |
| 2574 | |
| 2575 | if( 'yes' === $settings['premium_blog_grid'] ) { |
| 2576 | if ( 'masonry' === $settings['premium_blog_layout'] && 'yes' !== $settings['premium_blog_carousel'] ) { |
| 2577 | $this->render_editor_script(); |
| 2578 | } |
| 2579 | } |
| 2580 | } |
| 2581 | |
| 2582 | } |
| 2583 | |
| 2584 | /** |
| 2585 | * Render Editor Masonry Script. |
| 2586 | * |
| 2587 | * @since 3.12.3 |
| 2588 | * @access protected |
| 2589 | */ |
| 2590 | protected function render_editor_script() { |
| 2591 | |
| 2592 | ?><script type="text/javascript"> |
| 2593 | jQuery( document ).ready( function( $ ) { |
| 2594 | |
| 2595 | $( '.premium-blog-wrap' ).each( function() { |
| 2596 | |
| 2597 | var $node_id = '<?php echo $this->get_id(); ?>', |
| 2598 | scope = $( '[data-id="' + $node_id + '"]' ), |
| 2599 | selector = $(this); |
| 2600 | |
| 2601 | if ( selector.closest( scope ).length < 1 ) { |
| 2602 | return; |
| 2603 | } |
| 2604 | |
| 2605 | var masonryArgs = { |
| 2606 | itemSelector : '.premium-blog-post-outer-container', |
| 2607 | percentPosition : true, |
| 2608 | layoutMode : 'masonry', |
| 2609 | }; |
| 2610 | |
| 2611 | var $isotopeObj = {}; |
| 2612 | |
| 2613 | selector.imagesLoaded( function() { |
| 2614 | |
| 2615 | $isotopeObj = selector.isotope( masonryArgs ); |
| 2616 | |
| 2617 | $isotopeObj.imagesLoaded().progress(function() { |
| 2618 | $isotopeObj.isotope("layout"); |
| 2619 | }); |
| 2620 | |
| 2621 | selector.find('.premium-blog-post-outer-container').resize( function() { |
| 2622 | $isotopeObj.isotope( 'layout' ); |
| 2623 | }); |
| 2624 | }); |
| 2625 | |
| 2626 | }); |
| 2627 | }); |
| 2628 | </script> |
| 2629 | <?php |
| 2630 | } |
| 2631 | |
| 2632 | /* |
| 2633 | * Get Empty Query Message |
| 2634 | * |
| 2635 | * Written in PHP and used to generate the final HTML when the query is empty |
| 2636 | * |
| 2637 | * @since 3.20.3 |
| 2638 | * @access protected |
| 2639 | * |
| 2640 | */ |
| 2641 | protected function get_empty_query_message() { |
| 2642 | ?> |
| 2643 | <div class="premium-error-notice"> |
| 2644 | <?php echo __('The current query has no posts. Please make sure you have published items matching your query.','premium-addons-for-elementor'); ?> |
| 2645 | </div> |
| 2646 | <?php |
| 2647 | } |
| 2648 | } |