blog-posts.php
3344 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Elementor; |
| 4 | |
| 5 | use \Elementor\ElementsKit_Widget_Blog_Posts_Handler as Handler; |
| 6 | use \ElementsKit_Lite\Modules\Controls\Controls_Manager as ElementsKit_Controls_Manager; |
| 7 | |
| 8 | if (! defined('ABSPATH')) exit; |
| 9 | |
| 10 | class ElementsKit_Widget_Blog_Posts extends Widget_Base |
| 11 | { |
| 12 | use \ElementsKit_Lite\Widgets\Widget_Notice; |
| 13 | |
| 14 | public $base; |
| 15 | |
| 16 | public function get_script_depends() |
| 17 | { |
| 18 | $deps = ['imagesloaded', 'ekit-masonry', 'ekit-blog-posts']; |
| 19 | return $deps; |
| 20 | } |
| 21 | |
| 22 | public function get_style_depends() |
| 23 | { |
| 24 | $deps = ['ekit-button','ekit-blog-posts']; |
| 25 | return $deps; |
| 26 | } |
| 27 | |
| 28 | public function get_name() |
| 29 | { |
| 30 | return Handler::get_name(); |
| 31 | } |
| 32 | |
| 33 | public function get_title() |
| 34 | { |
| 35 | return Handler::get_title(); |
| 36 | } |
| 37 | |
| 38 | public function get_icon() |
| 39 | { |
| 40 | return Handler::get_icon(); |
| 41 | } |
| 42 | |
| 43 | public function get_categories() |
| 44 | { |
| 45 | return Handler::get_categories(); |
| 46 | } |
| 47 | |
| 48 | public function get_keywords() |
| 49 | { |
| 50 | return Handler::get_keywords(); |
| 51 | } |
| 52 | |
| 53 | public function get_help_url() |
| 54 | { |
| 55 | return 'https://wpmet.com/doc/blog-posts-2/'; |
| 56 | } |
| 57 | |
| 58 | |
| 59 | protected function is_dynamic_content(): bool |
| 60 | { |
| 61 | return true; |
| 62 | } |
| 63 | |
| 64 | public function has_widget_inner_wrapper(): bool |
| 65 | { |
| 66 | return ! Plugin::$instance->experiments->is_feature_active('e_optimized_markup'); |
| 67 | } |
| 68 | |
| 69 | protected function register_controls() |
| 70 | { |
| 71 | // Layout |
| 72 | $this->start_controls_section( |
| 73 | 'ekit_blog_posts_general', |
| 74 | [ |
| 75 | 'label' => esc_html__('Layout', 'elementskit-lite'), |
| 76 | ] |
| 77 | ); |
| 78 | |
| 79 | $this->add_control( |
| 80 | 'ekit_blog_posts_layout_style', |
| 81 | [ |
| 82 | 'label' => esc_html__('Layout Style', 'elementskit-lite'), |
| 83 | 'type' => Controls_Manager::SELECT, |
| 84 | 'options' => [ |
| 85 | 'elementskit-blog-block-post' => esc_html__('Block', 'elementskit-lite'), |
| 86 | 'elementskit-post-image-card' => esc_html__('Grid With Thumb', 'elementskit-lite'), |
| 87 | 'elementskit-post-card' => esc_html__('Grid Without Thumb', 'elementskit-lite'), |
| 88 | ], |
| 89 | 'default' => 'elementskit-blog-block-post', |
| 90 | ] |
| 91 | ); |
| 92 | |
| 93 | $this->add_control( |
| 94 | 'ekit_blog_posts_feature_img', |
| 95 | [ |
| 96 | 'label' => esc_html__('Show Featured Image', 'elementskit-lite'), |
| 97 | 'type' => Controls_Manager::SWITCHER, |
| 98 | 'label_on' => esc_html__('Yes', 'elementskit-lite'), |
| 99 | 'label_off' => esc_html__('No', 'elementskit-lite'), |
| 100 | 'default' => 'yes', |
| 101 | 'condition' => [ |
| 102 | 'ekit_blog_posts_layout_style!' => 'elementskit-post-card', |
| 103 | ], |
| 104 | ] |
| 105 | ); |
| 106 | |
| 107 | $this->add_control( |
| 108 | 'ekit_blog_posts_layout_style_thumb', |
| 109 | [ |
| 110 | 'label' => esc_html__('Image Position', 'elementskit-lite'), |
| 111 | 'type' => Controls_Manager::SELECT, |
| 112 | 'options' => [ |
| 113 | 'block' => esc_html__('Top', 'elementskit-lite'), |
| 114 | 'flex' => esc_html__('Left', 'elementskit-lite'), |
| 115 | ], |
| 116 | 'default' => 'block', |
| 117 | 'selectors' => [ |
| 118 | '{{WRAPPER}} .elementskit-post-image-card' => 'display: {{VALUE}}' |
| 119 | ], |
| 120 | 'condition' => [ |
| 121 | 'ekit_blog_posts_layout_style' => 'elementskit-post-image-card', |
| 122 | 'ekit_blog_posts_feature_img' => 'yes', |
| 123 | ], |
| 124 | ] |
| 125 | ); |
| 126 | |
| 127 | /** |
| 128 | * Control: Featured Image Size |
| 129 | */ |
| 130 | $this->add_group_control( |
| 131 | Group_Control_Image_Size::get_type(), |
| 132 | [ |
| 133 | 'name' => 'ekit_blog_posts_feature_img_size', |
| 134 | 'fields_options' => [ |
| 135 | 'size' => [ |
| 136 | 'label' => esc_html__('Featured Image Size', 'elementskit-lite'), |
| 137 | ], |
| 138 | ], |
| 139 | 'exclude' => ['custom'], // PHPCS:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude |
| 140 | 'default' => 'large', |
| 141 | 'condition' => [ |
| 142 | 'ekit_blog_posts_feature_img' => 'yes', |
| 143 | 'ekit_blog_posts_layout_style!' => 'elementskit-post-card', |
| 144 | ], |
| 145 | ] |
| 146 | ); |
| 147 | |
| 148 | $this->add_control( |
| 149 | 'ekit_blog_posts_feature_img_float', |
| 150 | [ |
| 151 | 'label' => esc_html__('Featured Image Alignment', 'elementskit-lite'), |
| 152 | 'type' => Controls_Manager::CHOOSE, |
| 153 | 'options' => [ |
| 154 | 'left' => [ |
| 155 | 'title' => esc_html__('Left', 'elementskit-lite'), |
| 156 | 'icon' => 'eicon-text-align-left', |
| 157 | ], |
| 158 | 'right' => [ |
| 159 | 'title' => esc_html__('Right', 'elementskit-lite'), |
| 160 | 'icon' => 'eicon-text-align-right', |
| 161 | ], |
| 162 | ], |
| 163 | 'condition' => [ |
| 164 | 'ekit_blog_posts_feature_img' => 'yes', |
| 165 | 'ekit_blog_posts_layout_style' => 'elementskit-blog-block-post', |
| 166 | ], |
| 167 | 'default' => 'left', |
| 168 | ] |
| 169 | ); |
| 170 | |
| 171 | $this->add_control( |
| 172 | 'ekit_blog_posts_column', |
| 173 | [ |
| 174 | 'label' => esc_html__('Show Posts Per Row', 'elementskit-lite'), |
| 175 | 'type' => Controls_Manager::SELECT, |
| 176 | 'options' => [ |
| 177 | 'ekit-col-12' => esc_html__('1', 'elementskit-lite'), |
| 178 | 'ekit-col-6' => esc_html__('2', 'elementskit-lite'), |
| 179 | 'ekit-col-4' => esc_html__('3', 'elementskit-lite'), |
| 180 | 'ekit-col-3' => esc_html__('4', 'elementskit-lite'), |
| 181 | 'ekit-col-2' => esc_html__('6', 'elementskit-lite'), |
| 182 | ], |
| 183 | 'condition' => [ |
| 184 | 'ekit_blog_posts_layout_style' => ['elementskit-post-image-card', 'elementskit-post-card'], |
| 185 | ], |
| 186 | 'default' => 'ekit-col-4', |
| 187 | ] |
| 188 | ); |
| 189 | |
| 190 | $this->add_control( |
| 191 | 'ekit_blog_posts_title', |
| 192 | [ |
| 193 | 'label' => esc_html__('Show Title', 'elementskit-lite'), |
| 194 | 'type' => Controls_Manager::SWITCHER, |
| 195 | 'label_on' => esc_html__('Yes', 'elementskit-lite'), |
| 196 | 'label_off' => esc_html__('No', 'elementskit-lite'), |
| 197 | 'default' => 'yes', |
| 198 | ] |
| 199 | ); |
| 200 | $this->add_control( |
| 201 | 'ekit_blog_posts_title_trim', |
| 202 | [ |
| 203 | 'label' => esc_html__('Crop title by word', 'elementskit-lite'), |
| 204 | 'type' => Controls_Manager::NUMBER, |
| 205 | 'default' => '', |
| 206 | 'condition' => [ |
| 207 | 'ekit_blog_posts_title' => 'yes', |
| 208 | ], |
| 209 | ] |
| 210 | ); |
| 211 | $this->add_control( |
| 212 | 'ekit_blog_posts_content', |
| 213 | [ |
| 214 | 'label' => esc_html__('Show Content', 'elementskit-lite'), |
| 215 | 'type' => Controls_Manager::SWITCHER, |
| 216 | 'label_on' => esc_html__('Yes', 'elementskit-lite'), |
| 217 | 'label_off' => esc_html__('No', 'elementskit-lite'), |
| 218 | 'default' => 'yes', |
| 219 | ] |
| 220 | ); |
| 221 | $this->add_control( |
| 222 | 'ekit_blog_posts_content_trim', |
| 223 | [ |
| 224 | 'label' => esc_html__('Crop content by word', 'elementskit-lite'), |
| 225 | 'type' => Controls_Manager::NUMBER, |
| 226 | 'default' => '', |
| 227 | 'condition' => [ |
| 228 | 'ekit_blog_posts_content' => 'yes', |
| 229 | ], |
| 230 | ] |
| 231 | ); |
| 232 | |
| 233 | $this->add_control( |
| 234 | 'ekit_blog_posts_read_more', |
| 235 | [ |
| 236 | 'label' => esc_html__('Show Read More', 'elementskit-lite'), |
| 237 | 'type' => Controls_Manager::SWITCHER, |
| 238 | 'label_on' => esc_html__('Yes', 'elementskit-lite'), |
| 239 | 'label_off' => esc_html__('No', 'elementskit-lite'), |
| 240 | 'default' => 'yes', |
| 241 | 'condition' => ['ekit_blog_posts_layout_style!' => 'elementskit-blog-block-post'], |
| 242 | ] |
| 243 | ); |
| 244 | |
| 245 | $this->add_control( |
| 246 | 'grid_masonry', |
| 247 | [ |
| 248 | 'label' => esc_html__('Enable Masonry', 'elementskit-lite'), |
| 249 | 'type' => Controls_Manager::SWITCHER, |
| 250 | 'return_value' => 'yes', |
| 251 | 'condition' => [ |
| 252 | 'ekit_blog_posts_layout_style!' => 'elementskit-blog-block-post', |
| 253 | ], |
| 254 | 'assets' => [ |
| 255 | 'scripts' => [ |
| 256 | [ |
| 257 | 'name' => 'masonry', |
| 258 | 'conditions' => [ |
| 259 | 'terms' => [ |
| 260 | [ |
| 261 | 'name' => 'grid_masonry', |
| 262 | 'operator' => '===', |
| 263 | 'value' => 'yes', |
| 264 | ], |
| 265 | ], |
| 266 | ], |
| 267 | ], |
| 268 | ], |
| 269 | |
| 270 | ], |
| 271 | ] |
| 272 | ); |
| 273 | // Row Gap |
| 274 | $this->add_control( |
| 275 | 'masonry_row_gap', |
| 276 | [ |
| 277 | 'label' => esc_html__('Row Gap', 'elementskit-lite'), |
| 278 | 'type' => Controls_Manager::SLIDER, |
| 279 | 'size_units' => ['px', 'em', 'rem'], |
| 280 | 'range' => [ |
| 281 | 'px' => [ |
| 282 | 'min' => 0, |
| 283 | 'max' => 200, |
| 284 | ], |
| 285 | 'em' => [ |
| 286 | 'min' => 0, |
| 287 | 'max' => 10, |
| 288 | 'step' => 0.1, |
| 289 | ], |
| 290 | 'rem' => [ |
| 291 | 'min' => 0, |
| 292 | 'max' => 10, |
| 293 | 'step' => 0.1, |
| 294 | ], |
| 295 | ], |
| 296 | 'default' => [ |
| 297 | 'unit' => 'px', |
| 298 | 'size' => 30, |
| 299 | ], |
| 300 | 'condition' => [ |
| 301 | 'grid_masonry' => 'yes', |
| 302 | ], |
| 303 | ] |
| 304 | ); |
| 305 | |
| 306 | // Column Gap |
| 307 | $this->add_control( |
| 308 | 'masonry_column_gap', |
| 309 | [ |
| 310 | 'label' => esc_html__('Column Gap', 'elementskit-lite'), |
| 311 | 'type' => Controls_Manager::SLIDER, |
| 312 | 'size_units' => ['px', 'em', 'rem'], |
| 313 | 'range' => [ |
| 314 | 'px' => [ |
| 315 | 'min' => 0, |
| 316 | 'max' => 200, |
| 317 | ], |
| 318 | 'em' => [ |
| 319 | 'min' => 0, |
| 320 | 'max' => 10, |
| 321 | 'step' => 0.1, |
| 322 | ], |
| 323 | 'rem' => [ |
| 324 | 'min' => 0, |
| 325 | 'max' => 10, |
| 326 | 'step' => 0.1, |
| 327 | ], |
| 328 | ], |
| 329 | 'default' => [ |
| 330 | 'unit' => 'px', |
| 331 | 'size' => 30, |
| 332 | ], |
| 333 | 'condition' => [ |
| 334 | 'grid_masonry' => 'yes', |
| 335 | ], |
| 336 | ] |
| 337 | ); |
| 338 | |
| 339 | $this->end_controls_section(); |
| 340 | // Query |
| 341 | $this->start_controls_section( |
| 342 | 'ekit_blog_posts_content_section', |
| 343 | [ |
| 344 | 'label' => esc_html__('Query', 'elementskit-lite'), |
| 345 | ] |
| 346 | ); |
| 347 | |
| 348 | $this->add_control( |
| 349 | 'ekit_blog_posts_num', |
| 350 | [ |
| 351 | 'label' => esc_html__('Posts Count', 'elementskit-lite'), |
| 352 | 'type' => Controls_Manager::NUMBER, |
| 353 | 'min' => 1, |
| 354 | 'default' => 3, |
| 355 | ] |
| 356 | ); |
| 357 | |
| 358 | |
| 359 | $this->add_control( |
| 360 | 'ekit_blog_posts_is_manual_selection', |
| 361 | [ |
| 362 | 'label' => esc_html__('Select posts by:', 'elementskit-lite'), |
| 363 | 'type' => Controls_Manager::SELECT, |
| 364 | 'default' => '', |
| 365 | 'options' => [ |
| 366 | 'recent' => esc_html__('Recent Post', 'elementskit-lite'), |
| 367 | 'yes' => esc_html__('Selected Post', 'elementskit-lite'), |
| 368 | '' => esc_html__('Category Post', 'elementskit-lite'), |
| 369 | ], |
| 370 | |
| 371 | ] |
| 372 | ); |
| 373 | |
| 374 | $this->add_control( |
| 375 | 'ekit_blog_posts_manual_selection', |
| 376 | [ |
| 377 | 'label' => esc_html__('Search & Select', 'elementskit-lite'), |
| 378 | 'type' => ElementsKit_Controls_Manager::AJAXSELECT2, |
| 379 | 'options' => 'ajaxselect2/post_list', |
| 380 | 'label_block' => true, |
| 381 | 'multiple' => true, |
| 382 | 'condition' => ['ekit_blog_posts_is_manual_selection' => 'yes'] |
| 383 | ] |
| 384 | ); |
| 385 | $this->add_control( |
| 386 | 'ekit_blog_posts_cats', |
| 387 | [ |
| 388 | 'label' => esc_html__('Select Categories', 'elementskit-lite'), |
| 389 | 'type' => ElementsKit_Controls_Manager::AJAXSELECT2, |
| 390 | 'options' => 'ajaxselect2/category', |
| 391 | 'label_block' => true, |
| 392 | 'multiple' => true, |
| 393 | 'condition' => ['ekit_blog_posts_is_manual_selection' => ''] |
| 394 | ] |
| 395 | ); |
| 396 | |
| 397 | $this->add_control( |
| 398 | 'ekit_blog_posts_offset', |
| 399 | [ |
| 400 | 'label' => esc_html__('Offset', 'elementskit-lite'), |
| 401 | 'type' => Controls_Manager::NUMBER, |
| 402 | 'min' => 0, |
| 403 | 'max' => 20, |
| 404 | 'default' => 0, |
| 405 | ] |
| 406 | ); |
| 407 | |
| 408 | $this->add_control( |
| 409 | 'ekit_blog_posts_order_by', |
| 410 | [ |
| 411 | 'label' => esc_html__('Order by', 'elementskit-lite'), |
| 412 | 'type' => Controls_Manager::SELECT, |
| 413 | 'options' => [ |
| 414 | 'date' => esc_html__('Date', 'elementskit-lite'), |
| 415 | 'title' => esc_html__('Title', 'elementskit-lite'), |
| 416 | 'author' => esc_html__('Author', 'elementskit-lite'), |
| 417 | 'modified' => esc_html__('Modified', 'elementskit-lite'), |
| 418 | 'comment_count' => esc_html__('Comments', 'elementskit-lite'), |
| 419 | ], |
| 420 | 'default' => 'date', |
| 421 | ] |
| 422 | ); |
| 423 | |
| 424 | $this->add_control( |
| 425 | 'ekit_blog_posts_sort', |
| 426 | [ |
| 427 | 'label' => esc_html__('Order', 'elementskit-lite'), |
| 428 | 'type' => Controls_Manager::SELECT, |
| 429 | 'options' => [ |
| 430 | 'ASC' => esc_html__('ASC', 'elementskit-lite'), |
| 431 | 'DESC' => esc_html__('DESC', 'elementskit-lite'), |
| 432 | ], |
| 433 | 'default' => 'DESC', |
| 434 | ] |
| 435 | ); |
| 436 | |
| 437 | $this->end_controls_section(); |
| 438 | |
| 439 | // meta data |
| 440 | $this->start_controls_section( |
| 441 | 'ekit_blog_posts_meta_data_tab', |
| 442 | [ |
| 443 | 'label' => esc_html__('Meta Data', 'elementskit-lite'), |
| 444 | 'tab' => Controls_Manager::TAB_CONTENT, |
| 445 | ] |
| 446 | ); |
| 447 | |
| 448 | $this->add_control( |
| 449 | 'ekit_blog_posts_floating_date', |
| 450 | [ |
| 451 | 'label' => esc_html__('Show Floating Date', 'elementskit-lite'), |
| 452 | 'type' => Controls_Manager::SWITCHER, |
| 453 | 'label_on' => esc_html__('Yes', 'elementskit-lite'), |
| 454 | 'label_off' => esc_html__('No', 'elementskit-lite'), |
| 455 | 'default' => 'no', |
| 456 | 'condition' => [ |
| 457 | 'ekit_blog_posts_layout_style' => 'elementskit-post-image-card', |
| 458 | ], |
| 459 | ] |
| 460 | ); |
| 461 | $this->add_control( |
| 462 | 'ekit_blog_posts_floating_date_style', |
| 463 | [ |
| 464 | 'label' => esc_html__('Choose Style', 'elementskit-lite'), |
| 465 | 'type' => ElementsKit_Controls_Manager::IMAGECHOOSE, |
| 466 | 'default' => 'style1', |
| 467 | 'options' => [ |
| 468 | 'style1' => [ |
| 469 | 'title' => esc_html__('Image style 1', 'elementskit-lite'), |
| 470 | 'imagelarge' => Handler::get_url() . 'assets/imagechoose/floating-date-1.png', |
| 471 | 'imagesmall' => Handler::get_url() . 'assets/imagechoose/floating-date-1.png', |
| 472 | 'width' => '50%', |
| 473 | ], |
| 474 | 'style2' => [ |
| 475 | 'title' => esc_html__('Image style 2', 'elementskit-lite'), |
| 476 | 'imagelarge' => Handler::get_url() . 'assets/imagechoose/floating-date-2.png', |
| 477 | 'imagesmall' => Handler::get_url() . 'assets/imagechoose/floating-date-2.png', |
| 478 | 'width' => '50%', |
| 479 | ], |
| 480 | ], |
| 481 | 'condition' => [ |
| 482 | 'ekit_blog_posts_floating_date' => 'yes', |
| 483 | ], |
| 484 | ] |
| 485 | ); |
| 486 | |
| 487 | $this->add_control( |
| 488 | 'ekit_blog_posts_floating_category', |
| 489 | [ |
| 490 | 'label' => esc_html__('Show Floating Category', 'elementskit-lite'), |
| 491 | 'type' => Controls_Manager::SWITCHER, |
| 492 | 'label_on' => esc_html__('Yes', 'elementskit-lite'), |
| 493 | 'label_off' => esc_html__('No', 'elementskit-lite'), |
| 494 | 'default' => 'no', |
| 495 | 'condition' => [ |
| 496 | 'ekit_blog_posts_layout_style' => 'elementskit-post-image-card', |
| 497 | ], |
| 498 | ] |
| 499 | ); |
| 500 | |
| 501 | $this->add_control( |
| 502 | 'ekit_blog_posts_meta', |
| 503 | [ |
| 504 | 'label' => esc_html__('Show Meta Data', 'elementskit-lite'), |
| 505 | 'type' => Controls_Manager::SWITCHER, |
| 506 | 'label_on' => esc_html__('Yes', 'elementskit-lite'), |
| 507 | 'label_off' => esc_html__('No', 'elementskit-lite'), |
| 508 | 'default' => 'yes', |
| 509 | ] |
| 510 | ); |
| 511 | $this->add_control( |
| 512 | 'ekit_blog_posts_title_position', |
| 513 | [ |
| 514 | 'label' => esc_html__('Meta Position', 'elementskit-lite'), |
| 515 | 'type' => Controls_Manager::SELECT, |
| 516 | 'options' => [ |
| 517 | 'after_meta' => esc_html__('Before Title', 'elementskit-lite'), |
| 518 | 'before_meta' => esc_html__('After Title', 'elementskit-lite'), |
| 519 | 'after_content' => esc_html__('After Content', 'elementskit-lite'), |
| 520 | ], |
| 521 | 'default' => 'after_meta', |
| 522 | 'condition' => [ |
| 523 | 'ekit_blog_posts_meta' => 'yes', |
| 524 | ] |
| 525 | ] |
| 526 | ); |
| 527 | $this->add_control( |
| 528 | 'ekit_blog_posts_meta_select', |
| 529 | [ |
| 530 | 'label' => esc_html__('Meta Data', 'elementskit-lite'), |
| 531 | 'type' => Controls_Manager::SELECT2, |
| 532 | 'options' => [ |
| 533 | 'author' => esc_html__('Author', 'elementskit-lite'), |
| 534 | 'date' => esc_html__('Date', 'elementskit-lite'), |
| 535 | 'category' => esc_html__('Category', 'elementskit-lite'), |
| 536 | 'comment' => esc_html__('Comment', 'elementskit-lite'), |
| 537 | ], |
| 538 | 'multiple' => true, |
| 539 | // 'default' => [ |
| 540 | // 'author', |
| 541 | // 'date' |
| 542 | // ], |
| 543 | 'condition' => [ |
| 544 | 'ekit_blog_posts_meta' => 'yes', |
| 545 | ], |
| 546 | ] |
| 547 | ); |
| 548 | $this->add_control( |
| 549 | 'ekit_blog_posts_author_image', |
| 550 | [ |
| 551 | 'label' => esc_html__('Show Author Image', 'elementskit-lite'), |
| 552 | 'type' => Controls_Manager::SWITCHER, |
| 553 | 'label_on' => esc_html__('Yes', 'elementskit-lite'), |
| 554 | 'label_off' => esc_html__('No', 'elementskit-lite'), |
| 555 | 'default' => 'no', |
| 556 | 'condition' => [ |
| 557 | 'ekit_blog_posts_meta' => 'yes', |
| 558 | 'ekit_blog_posts_meta_select' => 'author' |
| 559 | ], |
| 560 | ] |
| 561 | ); |
| 562 | $this->add_control( |
| 563 | 'ekit_blog_posts_meta_author_icons', |
| 564 | [ |
| 565 | 'label' => esc_html__('Author Icon', 'elementskit-lite'), |
| 566 | 'type' => Controls_Manager::ICONS, |
| 567 | 'fa4compatibility' => 'ekit_blog_posts_meta_author_icon', |
| 568 | 'default' => [ |
| 569 | 'value' => 'icon icon-user', |
| 570 | 'library' => 'ekiticons', |
| 571 | ], |
| 572 | 'condition' => [ |
| 573 | 'ekit_blog_posts_author_image!' => 'yes', |
| 574 | 'ekit_blog_posts_meta' => 'yes', |
| 575 | 'ekit_blog_posts_meta_select' => 'author' |
| 576 | ] |
| 577 | ] |
| 578 | ); |
| 579 | $this->add_control( |
| 580 | 'ekit_blog_posts_meta_date_icons', |
| 581 | [ |
| 582 | 'label' => esc_html__('Date Icon', 'elementskit-lite'), |
| 583 | 'type' => Controls_Manager::ICONS, |
| 584 | 'fa4compatibility' => 'ekit_blog_posts_meta_date_icon', |
| 585 | 'default' => [ |
| 586 | 'value' => 'icon icon-calendar3', |
| 587 | 'library' => 'ekiticons', |
| 588 | ], |
| 589 | 'condition' => [ |
| 590 | 'ekit_blog_posts_meta' => 'yes', |
| 591 | 'ekit_blog_posts_meta_select' => 'date' |
| 592 | ], |
| 593 | ] |
| 594 | ); |
| 595 | $this->add_control( |
| 596 | 'ekit_blog_posts_meta_category_icons', |
| 597 | [ |
| 598 | 'label' => esc_html__('Category Icon', 'elementskit-lite'), |
| 599 | 'type' => Controls_Manager::ICONS, |
| 600 | 'fa4compatibility' => 'ekit_blog_posts_meta_category_icon', |
| 601 | 'default' => [ |
| 602 | 'value' => 'icon icon-folder', |
| 603 | 'library' => 'ekiticons', |
| 604 | ], |
| 605 | 'condition' => [ |
| 606 | 'ekit_blog_posts_meta' => 'yes', |
| 607 | 'ekit_blog_posts_meta_select' => 'category' |
| 608 | ], |
| 609 | ] |
| 610 | ); |
| 611 | $this->add_control( |
| 612 | 'ekit_blog_posts_meta_comment_icons', |
| 613 | [ |
| 614 | 'label' => esc_html__('Comment Icon', 'elementskit-lite'), |
| 615 | 'type' => Controls_Manager::ICONS, |
| 616 | 'fa4compatibility' => 'ekit_blog_posts_meta_comment_icon', |
| 617 | 'default' => [ |
| 618 | 'value' => 'icon icon-comment', |
| 619 | 'library' => 'ekiticons', |
| 620 | ], |
| 621 | 'condition' => [ |
| 622 | 'ekit_blog_posts_meta' => 'yes', |
| 623 | 'ekit_blog_posts_meta_select' => 'comment' |
| 624 | ], |
| 625 | ] |
| 626 | ); |
| 627 | |
| 628 | |
| 629 | $this->end_controls_section(); |
| 630 | |
| 631 | // Read More Button |
| 632 | $this->start_controls_section( |
| 633 | 'ekit_blog_posts_more_section', |
| 634 | [ |
| 635 | 'label' => esc_html__('Read More Button', 'elementskit-lite'), |
| 636 | 'condition' => ['ekit_blog_posts_read_more' => 'yes', 'ekit_blog_posts_layout_style!' => 'elementskit-blog-block-post'], |
| 637 | ] |
| 638 | ); |
| 639 | |
| 640 | $this->add_control( |
| 641 | 'ekit_blog_posts_btn_text', |
| 642 | [ |
| 643 | 'label' => esc_html__('Label', 'elementskit-lite'), |
| 644 | 'type' => Controls_Manager::TEXT, |
| 645 | 'dynamic' => [ |
| 646 | 'active' => true, |
| 647 | ], |
| 648 | 'default' => esc_html__('Learn more ', 'elementskit-lite'), |
| 649 | 'placeholder' => esc_html__('Learn more ', 'elementskit-lite'), |
| 650 | ] |
| 651 | ); |
| 652 | |
| 653 | $this->add_control( |
| 654 | 'ekit_blog_posts_btn_icons__switch', |
| 655 | [ |
| 656 | 'label' => esc_html__('Add icon? ', 'elementskit-lite'), |
| 657 | 'type' => Controls_Manager::SWITCHER, |
| 658 | 'default' => 'yes', |
| 659 | 'label_on' => esc_html__('Yes', 'elementskit-lite'), |
| 660 | 'label_off' => esc_html__('No', 'elementskit-lite'), |
| 661 | ] |
| 662 | ); |
| 663 | |
| 664 | $this->add_control( |
| 665 | 'ekit_blog_posts_btn_icons', |
| 666 | [ |
| 667 | 'label' => esc_html__('Icon', 'elementskit-lite'), |
| 668 | 'type' => Controls_Manager::ICONS, |
| 669 | 'fa4compatibility' => 'ekit_blog_posts_btn_icon', |
| 670 | 'default' => [ |
| 671 | 'value' => '', |
| 672 | ], |
| 673 | 'label_block' => true, |
| 674 | 'condition' => [ |
| 675 | 'ekit_blog_posts_btn_icons__switch' => 'yes' |
| 676 | ] |
| 677 | ] |
| 678 | ); |
| 679 | $this->add_control( |
| 680 | 'ekit_blog_posts_btn_icon_align', |
| 681 | [ |
| 682 | 'label' => esc_html__('Icon Position', 'elementskit-lite'), |
| 683 | 'type' => Controls_Manager::SELECT, |
| 684 | 'default' => 'left', |
| 685 | 'options' => [ |
| 686 | 'left' => esc_html__('Before', 'elementskit-lite'), |
| 687 | 'right' => esc_html__('After', 'elementskit-lite'), |
| 688 | ], |
| 689 | 'condition' => [ |
| 690 | 'ekit_blog_posts_btn_icons__switch' => 'yes' |
| 691 | ] |
| 692 | ] |
| 693 | ); |
| 694 | $this->add_responsive_control( |
| 695 | 'ekit_blog_posts_btn_align', |
| 696 | [ |
| 697 | 'label' => esc_html__('Alignment', 'elementskit-lite'), |
| 698 | 'type' => Controls_Manager::CHOOSE, |
| 699 | 'options' => [ |
| 700 | 'left' => [ |
| 701 | 'title' => esc_html__('Left', 'elementskit-lite'), |
| 702 | 'icon' => 'eicon-text-align-left', |
| 703 | ], |
| 704 | 'center' => [ |
| 705 | 'title' => esc_html__('Center', 'elementskit-lite'), |
| 706 | 'icon' => 'eicon-text-align-center', |
| 707 | ], |
| 708 | 'right' => [ |
| 709 | 'title' => esc_html__('Right', 'elementskit-lite'), |
| 710 | 'icon' => 'eicon-text-align-right', |
| 711 | ], |
| 712 | ], |
| 713 | 'selectors' => [ |
| 714 | '{{WRAPPER}} .btn-wraper' => 'text-align: {{VALUE}};', |
| 715 | ], |
| 716 | 'default' => 'left', |
| 717 | ] |
| 718 | ); |
| 719 | |
| 720 | $this->add_control( |
| 721 | 'ekit_blog_posts_btn_class', |
| 722 | [ |
| 723 | 'label' => esc_html__('Class', 'elementskit-lite'), |
| 724 | 'type' => Controls_Manager::TEXT, |
| 725 | 'dynamic' => [ |
| 726 | 'active' => true, |
| 727 | ], |
| 728 | 'placeholder' => esc_html__('Class Name', 'elementskit-lite'), |
| 729 | ] |
| 730 | ); |
| 731 | |
| 732 | $this->add_control( |
| 733 | 'ekit_blog_posts_btn_id', |
| 734 | [ |
| 735 | 'label' => esc_html__('id', 'elementskit-lite'), |
| 736 | 'type' => Controls_Manager::TEXT, |
| 737 | 'dynamic' => [ |
| 738 | 'active' => true, |
| 739 | ], |
| 740 | 'placeholder' => esc_html__('ID', 'elementskit-lite'), |
| 741 | ] |
| 742 | ); |
| 743 | |
| 744 | $this->end_controls_section(); |
| 745 | |
| 746 | |
| 747 | |
| 748 | // Post Styles |
| 749 | $this->start_controls_section( |
| 750 | 'ekit_blog_posts_style', |
| 751 | [ |
| 752 | 'label' => esc_html__('Wrapper', 'elementskit-lite'), |
| 753 | 'tab' => Controls_Manager::TAB_STYLE, |
| 754 | ] |
| 755 | ); |
| 756 | |
| 757 | $this->start_controls_tabs( |
| 758 | 'ekit_blog_posts_tabs' |
| 759 | ); |
| 760 | |
| 761 | $this->start_controls_tab( |
| 762 | 'ekit_blog_posts_tab_normal', |
| 763 | [ |
| 764 | 'label' => esc_html__('Normal', 'elementskit-lite'), |
| 765 | ] |
| 766 | ); |
| 767 | |
| 768 | $this->add_group_control( |
| 769 | Group_Control_Background::get_type(), |
| 770 | [ |
| 771 | 'name' => 'ekit_blog_posts_background', |
| 772 | 'label' => esc_html__('Background', 'elementskit-lite'), |
| 773 | 'types' => ['classic', 'gradient'], |
| 774 | 'selector' => '{{WRAPPER}} .elementskit-blog-block-post, {{WRAPPER}} .elementskit-post-image-card, {{WRAPPER}} .elementskit-post-card', |
| 775 | ] |
| 776 | ); |
| 777 | |
| 778 | $this->add_group_control( |
| 779 | Group_Control_Box_Shadow::get_type(), |
| 780 | [ |
| 781 | 'name' => 'ekit_blog_posts_shadow', |
| 782 | 'selector' => '{{WRAPPER}} .elementskit-blog-block-post, {{WRAPPER}} .elementskit-post-image-card, {{WRAPPER}} .elementskit-post-card', |
| 783 | ] |
| 784 | ); |
| 785 | $this->end_controls_tab(); |
| 786 | |
| 787 | $this->start_controls_tab( |
| 788 | 'ekit_blog_posts_tab_hover', |
| 789 | [ |
| 790 | 'label' => esc_html__('Hover', 'elementskit-lite'), |
| 791 | ] |
| 792 | ); |
| 793 | $this->add_group_control( |
| 794 | Group_Control_Background::get_type(), |
| 795 | [ |
| 796 | 'name' => 'ekit_blog_posts_background_hover', |
| 797 | 'label' => esc_html__('Background', 'elementskit-lite'), |
| 798 | 'types' => ['classic', 'gradient'], |
| 799 | 'selector' => '{{WRAPPER}} .elementskit-blog-block-post:hover, {{WRAPPER}} .elementskit-post-image-card:hover, {{WRAPPER}} .elementskit-post-card:hover', |
| 800 | 'fields_options' => [ |
| 801 | 'background' => [ |
| 802 | 'prefix_class' => 'ekit-blog-posts--bg-hover bg-hover-', |
| 803 | ], |
| 804 | ], |
| 805 | ] |
| 806 | ); |
| 807 | |
| 808 | $this->add_group_control( |
| 809 | Group_Control_Box_Shadow::get_type(), |
| 810 | [ |
| 811 | 'name' => 'ekit_blog_posts_shadow_hover', |
| 812 | 'selector' => '{{WRAPPER}} .elementskit-blog-block-post:hover, {{WRAPPER}} .elementskit-post-image-card:hover, {{WRAPPER}} .elementskit-post-card:hover', |
| 813 | ] |
| 814 | ); |
| 815 | $this->end_controls_tab(); |
| 816 | $this->end_controls_tabs(); |
| 817 | |
| 818 | $this->add_control( |
| 819 | 'ekit_blog_posts_equal_height', |
| 820 | [ |
| 821 | 'label' => esc_html__( 'Equalize Card Height', 'elementskit-lite' ), |
| 822 | 'type' => Controls_Manager::SWITCHER, |
| 823 | 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ), |
| 824 | 'label_off' => esc_html__( 'No', 'elementskit-lite' ), |
| 825 | 'return_value' => 'yes', |
| 826 | 'default' => '', |
| 827 | 'separator' => 'before', |
| 828 | 'description' => esc_html__( 'Make all cards equal height and push the Read More button to the bottom.', 'elementskit-lite' ), |
| 829 | 'selectors' => [ |
| 830 | '{{WRAPPER}} .post-items' => 'display: flex; flex-wrap: wrap;', |
| 831 | '{{WRAPPER}} .post-items > [class*="col-"]' => 'display: flex;', |
| 832 | '{{WRAPPER}} .elementskit-post-image-card, {{WRAPPER}} .elementskit-post-card' => 'display: flex; flex-direction: column; width: 100%;', |
| 833 | '{{WRAPPER}} .elementskit-post-body' => 'display: flex; flex-direction: column; flex: 1 1 auto;', |
| 834 | '{{WRAPPER}} .btn-wraper' => 'margin-top: auto;', |
| 835 | ], |
| 836 | 'conditions' => [ |
| 837 | 'relation' => 'and', |
| 838 | 'terms' => [ |
| 839 | [ |
| 840 | 'name' => 'ekit_blog_posts_layout_style', |
| 841 | 'operator' => 'in', |
| 842 | 'value' => [ |
| 843 | 'elementskit-post-image-card', |
| 844 | 'elementskit-post-card', |
| 845 | ], |
| 846 | ], |
| 847 | [ |
| 848 | 'name' => 'grid_masonry', |
| 849 | 'operator' => '!==', |
| 850 | 'value' => 'yes', |
| 851 | ], |
| 852 | ], |
| 853 | ], |
| 854 | ] |
| 855 | ); |
| 856 | |
| 857 | $this->add_control( |
| 858 | 'ekit_blog_posts_hr', |
| 859 | [ |
| 860 | 'type' => \Elementor\Controls_Manager::DIVIDER, |
| 861 | ] |
| 862 | ); |
| 863 | |
| 864 | $this->add_control( |
| 865 | 'ekit_blog_posts_vertical_alignment', |
| 866 | [ |
| 867 | 'label' => esc_html__('Vertical Alignment', 'elementskit-lite'), |
| 868 | 'type' => Controls_Manager::CHOOSE, |
| 869 | 'options' => [ |
| 870 | 'flex-start' => [ |
| 871 | 'title' => esc_html__('Top', 'elementskit-lite'), |
| 872 | 'icon' => 'eicon-v-align-top', |
| 873 | ], |
| 874 | 'center' => [ |
| 875 | 'title' => esc_html__('Middle', 'elementskit-lite'), |
| 876 | 'icon' => 'eicon-v-align-middle', |
| 877 | ], |
| 878 | 'flex-end' => [ |
| 879 | 'title' => esc_html__('Bottom', 'elementskit-lite'), |
| 880 | 'icon' => 'eicon-v-align-bottom', |
| 881 | ], |
| 882 | ], |
| 883 | 'condition' => [ |
| 884 | 'ekit_blog_posts_layout_style' => 'elementskit-blog-block-post', |
| 885 | ], |
| 886 | 'default' => 'flex-start', |
| 887 | 'selectors' => [ |
| 888 | '{{WRAPPER}} .elementskit-blog-block-post > .row' => 'align-items: {{VALUE}};', |
| 889 | ], |
| 890 | ] |
| 891 | ); |
| 892 | |
| 893 | $this->add_responsive_control( |
| 894 | 'ekit_blog_posts_radius', |
| 895 | [ |
| 896 | 'label' => esc_html__('Container Border radius', 'elementskit-lite'), |
| 897 | 'type' => Controls_Manager::DIMENSIONS, |
| 898 | 'size_units' => ['px', '%', 'em'], |
| 899 | 'selectors' => [ |
| 900 | '{{WRAPPER}} .elementskit-blog-block-post, {{WRAPPER}} .elementskit-post-image-card, {{WRAPPER}} .elementskit-post-card' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 901 | ], |
| 902 | ] |
| 903 | ); |
| 904 | |
| 905 | $this->add_responsive_control( |
| 906 | 'ekit_blog_posts_padding', |
| 907 | [ |
| 908 | 'label' => esc_html__('Container Padding', 'elementskit-lite'), |
| 909 | 'type' => Controls_Manager::DIMENSIONS, |
| 910 | 'size_units' => ['px', '%', 'em'], |
| 911 | 'selectors' => [ |
| 912 | '{{WRAPPER}} .elementskit-blog-block-post, {{WRAPPER}} .elementskit-post-image-card, {{WRAPPER}} .elementskit-post-card' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 913 | ], |
| 914 | ] |
| 915 | ); |
| 916 | |
| 917 | $this->add_responsive_control( |
| 918 | 'ekit_blog_posts_margin', |
| 919 | [ |
| 920 | 'label' => esc_html__('Container Margin', 'elementskit-lite'), |
| 921 | 'type' => Controls_Manager::DIMENSIONS, |
| 922 | 'size_units' => ['px', '%', 'em'], |
| 923 | 'tablet_default' => [ |
| 924 | 'top' => '0', |
| 925 | 'right' => '0', |
| 926 | 'bottom' => '30', |
| 927 | 'left' => '0', |
| 928 | 'unit' => 'px', |
| 929 | 'isLinked' => 'false', |
| 930 | ], |
| 931 | 'mobile_default' => [ |
| 932 | 'top' => '0', |
| 933 | 'right' => '0', |
| 934 | 'bottom' => '30', |
| 935 | 'left' => '0', |
| 936 | 'unit' => 'px', |
| 937 | 'isLinked' => 'false', |
| 938 | ], |
| 939 | 'selectors' => [ |
| 940 | '{{WRAPPER}} .ekit-blog-post-masonry-inactive .elementskit-blog-block-post, {{WRAPPER}} .ekit-blog-post-masonry-inactive .elementskit-post-image-card, {{WRAPPER}} .ekit-blog-post-masonry-inactive .elementskit-post-card' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 941 | ], |
| 942 | 'condition' => [ |
| 943 | 'grid_masonry' => '', |
| 944 | ], |
| 945 | ] |
| 946 | ); |
| 947 | |
| 948 | $this->add_responsive_control( |
| 949 | 'ekit_blog_posts_text_content_wraper_padding', |
| 950 | [ |
| 951 | 'label' => esc_html__('Content Padding', 'elementskit-lite'), |
| 952 | 'type' => Controls_Manager::DIMENSIONS, |
| 953 | 'size_units' => ['px', '%'], |
| 954 | 'selectors' => [ |
| 955 | '{{WRAPPER}} .elementskit-blog-block-post .elementskit-post-body' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 956 | '{{WRAPPER}} .elementskit-post-image-card .elementskit-post-body' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 957 | ], |
| 958 | ] |
| 959 | ); |
| 960 | |
| 961 | $this->add_control( |
| 962 | 'ekit_blog_posts_container_border_title', |
| 963 | [ |
| 964 | 'label' => esc_html__('Container Border', 'elementskit-lite'), |
| 965 | 'type' => Controls_Manager::HEADING, |
| 966 | 'separator' => 'before', |
| 967 | ] |
| 968 | ); |
| 969 | |
| 970 | $this->add_group_control( |
| 971 | Group_Control_Border::get_type(), |
| 972 | [ |
| 973 | 'name' => 'ekit_blog_posts_border', |
| 974 | 'label' => esc_html__('Container Border', 'elementskit-lite'), |
| 975 | 'selector' => '{{WRAPPER}} .elementskit-blog-block-post, {{WRAPPER}} .elementskit-post-image-card, {{WRAPPER}} .elementskit-post-card', |
| 976 | ] |
| 977 | ); |
| 978 | |
| 979 | $this->add_control( |
| 980 | 'ekit_blog_posts_content_border_title', |
| 981 | [ |
| 982 | 'label' => esc_html__('Content Border', 'elementskit-lite'), |
| 983 | 'type' => Controls_Manager::HEADING, |
| 984 | 'separator' => 'before', |
| 985 | 'condition' => [ |
| 986 | 'ekit_blog_posts_layout_style' => 'elementskit-post-image-card', |
| 987 | 'ekit_blog_posts_feature_img' => 'yes' |
| 988 | ] |
| 989 | ] |
| 990 | ); |
| 991 | |
| 992 | $this->add_control( |
| 993 | 'ekit_blog_posts_content_background', |
| 994 | [ |
| 995 | 'label' => esc_html_x('Container Background Color', 'elementskit', 'elementskit-lite'), |
| 996 | 'type' => Controls_Manager::COLOR, |
| 997 | 'default' => '', |
| 998 | 'selectors' => [ |
| 999 | '{{WRAPPER}} .elementskit-post-body' => 'background-color: {{VALUE}};', |
| 1000 | ], |
| 1001 | ] |
| 1002 | ); |
| 1003 | |
| 1004 | $this->add_group_control( |
| 1005 | Group_Control_Box_Shadow::get_type(), |
| 1006 | [ |
| 1007 | 'name' => 'ekit_blog_posts_content_box_shadow', |
| 1008 | 'label' => esc_html__('Box Shadow', 'elementskit-lite'), |
| 1009 | 'selector' => '{{WRAPPER}} .elementskit-post-body', |
| 1010 | ] |
| 1011 | ); |
| 1012 | |
| 1013 | $this->add_control( |
| 1014 | 'ekit_blog_posts_content_border_style', |
| 1015 | [ |
| 1016 | 'label' => esc_html_x('Border Type', 'Border Control', 'elementskit-lite'), |
| 1017 | 'type' => Controls_Manager::SELECT, |
| 1018 | 'options' => [ |
| 1019 | '' => esc_html__('None', 'elementskit-lite'), |
| 1020 | 'solid' => esc_html_x('Solid', 'Border Control', 'elementskit-lite'), |
| 1021 | 'double' => esc_html_x('Double', 'Border Control', 'elementskit-lite'), |
| 1022 | 'dotted' => esc_html_x('Dotted', 'Border Control', 'elementskit-lite'), |
| 1023 | 'dashed' => esc_html_x('Dashed', 'Border Control', 'elementskit-lite'), |
| 1024 | 'groove' => esc_html_x('Groove', 'Border Control', 'elementskit-lite'), |
| 1025 | ], |
| 1026 | 'selectors' => [ |
| 1027 | '{{WRAPPER}} .elementskit-post-body' => 'border-style: {{VALUE}};', |
| 1028 | ], |
| 1029 | 'condition' => [ |
| 1030 | 'ekit_blog_posts_layout_style' => 'elementskit-post-image-card', |
| 1031 | 'ekit_blog_posts_feature_img' => 'yes' |
| 1032 | ] |
| 1033 | ] |
| 1034 | ); |
| 1035 | $this->add_control( |
| 1036 | 'ekit_blog_posts_content_border_dimensions', |
| 1037 | [ |
| 1038 | 'label' => esc_html_x('Width', 'Border Control', 'elementskit-lite'), |
| 1039 | 'type' => Controls_Manager::DIMENSIONS, |
| 1040 | 'selectors' => [ |
| 1041 | '{{WRAPPER}} .elementskit-post-body' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1042 | ], |
| 1043 | 'condition' => [ |
| 1044 | 'ekit_blog_posts_layout_style' => 'elementskit-post-image-card', |
| 1045 | 'ekit_blog_posts_feature_img' => 'yes' |
| 1046 | ] |
| 1047 | ] |
| 1048 | ); |
| 1049 | $this->start_controls_tabs('ekit_blog_posts_content_border_tabs', [ |
| 1050 | 'condition' => [ |
| 1051 | 'ekit_blog_posts_layout_style' => 'elementskit-post-image-card', |
| 1052 | 'ekit_blog_posts_feature_img' => 'yes' |
| 1053 | ] |
| 1054 | ]); |
| 1055 | $this->start_controls_tab( |
| 1056 | 'ekit_blog_posts_content_border_normal', |
| 1057 | [ |
| 1058 | 'label' => esc_html__('Normal', 'elementskit-lite'), |
| 1059 | ] |
| 1060 | ); |
| 1061 | |
| 1062 | $this->add_control( |
| 1063 | 'ekit_blog_posts_content_border_color_normal', |
| 1064 | [ |
| 1065 | 'label' => esc_html_x('Color', 'Border Control', 'elementskit-lite'), |
| 1066 | 'type' => Controls_Manager::COLOR, |
| 1067 | 'default' => '', |
| 1068 | 'selectors' => [ |
| 1069 | '{{WRAPPER}} .elementskit-post-body' => 'border-color: {{VALUE}};', |
| 1070 | ], |
| 1071 | ] |
| 1072 | ); |
| 1073 | $this->end_controls_tab(); |
| 1074 | |
| 1075 | $this->start_controls_tab( |
| 1076 | 'ekit_blog_posts_content_border_color_hover_style', |
| 1077 | [ |
| 1078 | 'label' => esc_html__('Hover', 'elementskit-lite'), |
| 1079 | ] |
| 1080 | ); |
| 1081 | $this->add_control( |
| 1082 | 'ekit_blog_posts_content_border_color_hover', |
| 1083 | [ |
| 1084 | 'label' => esc_html_x('Color', 'Border Control', 'elementskit-lite'), |
| 1085 | 'type' => Controls_Manager::COLOR, |
| 1086 | 'default' => '', |
| 1087 | 'selectors' => [ |
| 1088 | '{{WRAPPER}} .elementskit-post-image-card:hover .elementskit-post-body ' => 'border-color: {{VALUE}};', |
| 1089 | ], |
| 1090 | ] |
| 1091 | ); |
| 1092 | $this->end_controls_tab(); |
| 1093 | $this->end_controls_tabs(); |
| 1094 | |
| 1095 | $this->end_controls_section(); |
| 1096 | |
| 1097 | |
| 1098 | // Featured Image Styles |
| 1099 | $this->start_controls_section( |
| 1100 | 'ekit_blog_posts_feature_img_style', |
| 1101 | [ |
| 1102 | 'label' => esc_html__('Featured Image', 'elementskit-lite'), |
| 1103 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1104 | 'condition' => [ |
| 1105 | 'ekit_blog_posts_layout_style!' => 'elementskit-post-card', |
| 1106 | 'ekit_blog_posts_feature_img' => 'yes' |
| 1107 | ], |
| 1108 | ] |
| 1109 | ); |
| 1110 | |
| 1111 | $this->add_responsive_control( |
| 1112 | 'ekit_blog_posts_feature_img_size', |
| 1113 | [ |
| 1114 | 'label' => esc_html__('Image Width', 'elementskit-lite'), |
| 1115 | 'type' => Controls_Manager::SLIDER, |
| 1116 | 'size_units' => ['px', '%', 'em', 'rem'], |
| 1117 | 'range' => [ |
| 1118 | 'px' => [ |
| 1119 | 'min' => 1, |
| 1120 | 'max' => 500, |
| 1121 | ], |
| 1122 | '%' => [ |
| 1123 | 'min' => 1, |
| 1124 | 'max' => 100, |
| 1125 | ], |
| 1126 | 'em' => [ |
| 1127 | 'min' => 1, |
| 1128 | 'max' => 50, |
| 1129 | ], |
| 1130 | 'rem' => [ |
| 1131 | 'min' => 1, |
| 1132 | 'max' => 50, |
| 1133 | ], |
| 1134 | ], |
| 1135 | 'selectors' => [ |
| 1136 | '{{WRAPPER}} .elementskit-entry-thumb img' => 'width: {{SIZE}}{{UNIT}};', |
| 1137 | ], |
| 1138 | 'condition' => [ |
| 1139 | 'ekit_blog_posts_layout_style' => 'elementskit-post-image-card', |
| 1140 | 'ekit_blog_posts_layout_style_thumb' => 'flex', |
| 1141 | ], |
| 1142 | ] |
| 1143 | ); |
| 1144 | |
| 1145 | $this->add_group_control( |
| 1146 | Group_Control_Box_Shadow::get_type(), |
| 1147 | [ |
| 1148 | 'name' => 'ekit_blog_posts_feature_img_shadow', |
| 1149 | 'selector' => '{{WRAPPER}} .elementskit-entry-thumb', |
| 1150 | ] |
| 1151 | ); |
| 1152 | |
| 1153 | $this->add_group_control( |
| 1154 | Group_Control_Border::get_type(), |
| 1155 | [ |
| 1156 | 'name' => 'ekit_blog_posts_feature_img_border', |
| 1157 | 'label' => esc_html__('Border', 'elementskit-lite'), |
| 1158 | 'selector' => '{{WRAPPER}} .elementskit-entry-thumb', |
| 1159 | ] |
| 1160 | ); |
| 1161 | |
| 1162 | $this->add_responsive_control( |
| 1163 | 'ekit_blog_posts_feature_img_radius', |
| 1164 | [ |
| 1165 | 'label' => esc_html__('Border radius', 'elementskit-lite'), |
| 1166 | 'type' => Controls_Manager::DIMENSIONS, |
| 1167 | 'size_units' => ['px', '%', 'em'], |
| 1168 | 'selectors' => [ |
| 1169 | '{{WRAPPER}} .elementskit-entry-thumb' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1170 | ], |
| 1171 | ] |
| 1172 | ); |
| 1173 | |
| 1174 | $this->add_responsive_control( |
| 1175 | 'ekit_blog_posts_feature_img_margin', |
| 1176 | [ |
| 1177 | 'label' => esc_html__('Margin', 'elementskit-lite'), |
| 1178 | 'type' => Controls_Manager::DIMENSIONS, |
| 1179 | 'size_units' => ['px', '%', 'em'], |
| 1180 | 'selectors' => [ |
| 1181 | '{{WRAPPER}} .elementskit-entry-thumb' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1182 | ], |
| 1183 | ] |
| 1184 | ); |
| 1185 | |
| 1186 | $this->add_responsive_control( |
| 1187 | 'ekit_blog_posts_feature_img_padding', |
| 1188 | [ |
| 1189 | 'label' => esc_html__('Padding', 'elementskit-lite'), |
| 1190 | 'type' => Controls_Manager::DIMENSIONS, |
| 1191 | 'size_units' => ['px', '%', 'em'], |
| 1192 | 'selectors' => [ |
| 1193 | ' {{WRAPPER}} .ekit-wid-con .elementskit-entry-thumb' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1194 | ], |
| 1195 | ] |
| 1196 | ); |
| 1197 | |
| 1198 | $this->end_controls_section(); |
| 1199 | |
| 1200 | |
| 1201 | // Meta Styles |
| 1202 | $this->start_controls_section( |
| 1203 | 'ekit_blog_posts_meta_style', |
| 1204 | [ |
| 1205 | 'label' => esc_html__('Meta', 'elementskit-lite'), |
| 1206 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1207 | 'condition' => [ |
| 1208 | 'ekit_blog_posts_meta' => 'yes', |
| 1209 | ], |
| 1210 | ] |
| 1211 | ); |
| 1212 | |
| 1213 | $this->add_group_control( |
| 1214 | Group_Control_Typography::get_type(), |
| 1215 | [ |
| 1216 | 'name' => 'ekit_blog_posts_meta_typography', |
| 1217 | 'selector' => '{{WRAPPER}} .post-meta-list a, {{WRAPPER}} .post-meta-list .meta-date-text', |
| 1218 | ] |
| 1219 | ); |
| 1220 | |
| 1221 | $this->add_responsive_control( |
| 1222 | 'ekit_blog_posts_meta_alignment', |
| 1223 | [ |
| 1224 | 'label' => esc_html__('Alignment', 'elementskit-lite'), |
| 1225 | 'type' => Controls_Manager::CHOOSE, |
| 1226 | 'options' => [ |
| 1227 | 'left' => [ |
| 1228 | 'title' => esc_html__('Left', 'elementskit-lite'), |
| 1229 | 'icon' => 'eicon-text-align-left', |
| 1230 | ], |
| 1231 | 'center' => [ |
| 1232 | 'title' => esc_html__('Center', 'elementskit-lite'), |
| 1233 | 'icon' => 'eicon-text-align-center', |
| 1234 | ], |
| 1235 | 'right' => [ |
| 1236 | 'title' => esc_html__('Right', 'elementskit-lite'), |
| 1237 | 'icon' => 'eicon-text-align-right', |
| 1238 | ], |
| 1239 | ], |
| 1240 | 'default' => 'left', |
| 1241 | 'selectors' => [ |
| 1242 | '{{WRAPPER}} .post-meta-list' => 'text-align: {{VALUE}};', |
| 1243 | ], |
| 1244 | ] |
| 1245 | ); |
| 1246 | |
| 1247 | $this->add_responsive_control( |
| 1248 | 'ekit_blog_posts_meta_margin', |
| 1249 | [ |
| 1250 | 'label' => esc_html__('Container Margin', 'elementskit-lite'), |
| 1251 | 'type' => Controls_Manager::DIMENSIONS, |
| 1252 | 'size_units' => ['px', '%', 'em'], |
| 1253 | 'selectors' => [ |
| 1254 | '{{WRAPPER}} .post-meta-list' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1255 | ], |
| 1256 | ] |
| 1257 | ); |
| 1258 | |
| 1259 | $this->add_responsive_control( |
| 1260 | 'ekit_blog_posts_meta_item_margin', |
| 1261 | [ |
| 1262 | 'label' => esc_html__('Item Margin', 'elementskit-lite'), |
| 1263 | 'type' => Controls_Manager::DIMENSIONS, |
| 1264 | 'size_units' => ['px', '%', 'em'], |
| 1265 | 'selectors' => [ |
| 1266 | '{{WRAPPER}} .post-meta-list > span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1267 | ], |
| 1268 | ] |
| 1269 | ); |
| 1270 | |
| 1271 | $this->add_control( |
| 1272 | 'ekit_blog_posts_meta_padding', |
| 1273 | [ |
| 1274 | 'label' => esc_html__('Item Padding', 'elementskit-lite'), |
| 1275 | 'type' => Controls_Manager::DIMENSIONS, |
| 1276 | 'size_units' => ['px', '%', 'em'], |
| 1277 | 'selectors' => [ |
| 1278 | '{{WRAPPER}} .post-meta-list > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1279 | ], |
| 1280 | ] |
| 1281 | ); |
| 1282 | |
| 1283 | $this->add_control( |
| 1284 | 'ekit_blog_posts_meta_icon_padding', |
| 1285 | [ |
| 1286 | 'label' => esc_html__('Icon Spacing', 'elementskit-lite'), |
| 1287 | 'type' => Controls_Manager::DIMENSIONS, |
| 1288 | 'size_units' => ['px', '%', 'em'], |
| 1289 | 'selectors' => [ |
| 1290 | '{{WRAPPER}} .post-meta-list > span > i, {{WRAPPER}} .post-meta-list > span > svg' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1291 | ], |
| 1292 | ] |
| 1293 | ); |
| 1294 | |
| 1295 | $this->add_responsive_control( |
| 1296 | 'ekit_blog_posts_meta_icon_size', |
| 1297 | [ |
| 1298 | 'label' => esc_html__('Icon Size', 'elementskit-lite'), |
| 1299 | 'type' => Controls_Manager::SLIDER, |
| 1300 | 'range' => [ |
| 1301 | 'px' => [ |
| 1302 | 'min' => 6, |
| 1303 | 'max' => 300, |
| 1304 | ], |
| 1305 | ], |
| 1306 | 'selectors' => [ |
| 1307 | '{{WRAPPER}} .post-meta-list > span :is(i, svg)' => 'font-size: {{SIZE}}{{UNIT}};', |
| 1308 | ], |
| 1309 | ] |
| 1310 | ); |
| 1311 | |
| 1312 | $this->start_controls_tabs( |
| 1313 | 'ekit_blog_posts_meta_background_normal_and_hover_tab' |
| 1314 | ); |
| 1315 | $this->start_controls_tab( |
| 1316 | 'ekit_blog_posts_meta_background_normal_tab', |
| 1317 | [ |
| 1318 | 'label' => esc_html__('Normal', 'elementskit-lite'), |
| 1319 | ] |
| 1320 | ); |
| 1321 | |
| 1322 | $this->add_control( |
| 1323 | 'ekit_blog_posts_meta_color_normal', |
| 1324 | [ |
| 1325 | 'label' => esc_html__('Color', 'elementskit-lite'), |
| 1326 | 'type' => Controls_Manager::COLOR, |
| 1327 | 'selectors' => [ |
| 1328 | '{{WRAPPER}} .post-meta-list > span' => 'color: {{VALUE}}; fill: {{VALUE}};', |
| 1329 | ], |
| 1330 | ] |
| 1331 | ); |
| 1332 | |
| 1333 | $this->add_control( |
| 1334 | 'ekit_blog_posts_meta_color_icon_normal', |
| 1335 | [ |
| 1336 | 'label' => esc_html__('Icon Color', 'elementskit-lite'), |
| 1337 | 'type' => Controls_Manager::COLOR, |
| 1338 | 'selectors' => [ |
| 1339 | '{{WRAPPER}} .post-meta-list > span i' => 'color: {{VALUE}}', |
| 1340 | '{{WRAPPER}} .post-meta-list > span svg' => 'fill: {{VALUE}}', |
| 1341 | ], |
| 1342 | ] |
| 1343 | ); |
| 1344 | |
| 1345 | $this->add_group_control( |
| 1346 | Group_Control_Background::get_type(), |
| 1347 | [ |
| 1348 | 'name' => 'ekit_blog_posts_meta_background_normal', |
| 1349 | 'label' => esc_html__('Background', 'elementskit-lite'), |
| 1350 | 'types' => ['classic', 'gradient',], |
| 1351 | 'selector' => '{{WRAPPER}} .post-meta-list > span', |
| 1352 | 'exclude' => ['image'] // PHPCS:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude |
| 1353 | ] |
| 1354 | ); |
| 1355 | |
| 1356 | $this->add_group_control( |
| 1357 | Group_Control_Border::get_type(), |
| 1358 | [ |
| 1359 | 'name' => 'ekit_blog_posts_meta_border_normal', |
| 1360 | 'label' => esc_html__('Border', 'elementskit-lite'), |
| 1361 | 'selector' => '{{WRAPPER}} .post-meta-list > span', |
| 1362 | ] |
| 1363 | ); |
| 1364 | |
| 1365 | $this->add_control( |
| 1366 | 'ekit_blog_posts_meta_border_radius_normal', |
| 1367 | [ |
| 1368 | 'label' => esc_html__('Border Radius', 'elementskit-lite'), |
| 1369 | 'type' => Controls_Manager::DIMENSIONS, |
| 1370 | 'size_units' => ['px', '%', 'em'], |
| 1371 | 'selectors' => [ |
| 1372 | '{{WRAPPER}} .post-meta-list > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1373 | ], |
| 1374 | ] |
| 1375 | ); |
| 1376 | |
| 1377 | $this->add_group_control( |
| 1378 | Group_Control_Box_Shadow::get_type(), |
| 1379 | [ |
| 1380 | 'name' => 'ekit_blog_posts_meta_box_shadow_normal', |
| 1381 | 'label' => esc_html__('Box Shadow', 'elementskit-lite'), |
| 1382 | 'selector' => '{{WRAPPER}} .post-meta-list > span', |
| 1383 | ] |
| 1384 | ); |
| 1385 | |
| 1386 | $this->add_group_control( |
| 1387 | Group_Control_Text_Shadow::get_type(), |
| 1388 | [ |
| 1389 | 'name' => 'ekit_blog_posts_meta_shadow_normal', |
| 1390 | 'selector' => '{{WRAPPER}} .post-meta-list > span', |
| 1391 | ] |
| 1392 | ); |
| 1393 | |
| 1394 | $this->end_controls_tab(); |
| 1395 | |
| 1396 | $this->start_controls_tab( |
| 1397 | 'ekit_blog_posts_meta_background_hover_tab', |
| 1398 | [ |
| 1399 | 'label' => esc_html__('Hover', 'elementskit-lite'), |
| 1400 | ] |
| 1401 | ); |
| 1402 | |
| 1403 | $this->add_control( |
| 1404 | 'ekit_blog_posts_meta_color_hover', |
| 1405 | [ |
| 1406 | 'label' => esc_html__('Color', 'elementskit-lite'), |
| 1407 | 'type' => Controls_Manager::COLOR, |
| 1408 | 'selectors' => [ |
| 1409 | '{{WRAPPER}} .post-meta-list > span:hover' => 'color: {{VALUE}}; fill: {{VALUE}};', |
| 1410 | '{{WRAPPER}}.ekit-blog-posts--bg-hover .elementskit-post-image-card:hover .post-meta-list > span' => 'color: {{VALUE}}; fill: {{VALUE}};', |
| 1411 | ], |
| 1412 | ] |
| 1413 | ); |
| 1414 | |
| 1415 | $this->add_control( |
| 1416 | 'ekit_blog_posts_meta_color_icon_hover', |
| 1417 | [ |
| 1418 | 'label' => esc_html__('Icon Color', 'elementskit-lite'), |
| 1419 | 'type' => Controls_Manager::COLOR, |
| 1420 | 'selectors' => [ |
| 1421 | '{{WRAPPER}} .post-meta-list > span:hover i' => 'color: {{VALUE}}', |
| 1422 | '{{WRAPPER}} .post-meta-list > span:hover svg' => 'fill: {{VALUE}}', |
| 1423 | '{{WRAPPER}}.ekit-blog-posts--bg-hover .elementskit-post-image-card:hover .post-meta-list > span:hover i' => 'color: {{VALUE}}', |
| 1424 | '{{WRAPPER}}.ekit-blog-posts--bg-hover .elementskit-post-image-card:hover .post-meta-list > span:hover svg' => 'fill: {{VALUE}}', |
| 1425 | ], |
| 1426 | ] |
| 1427 | ); |
| 1428 | |
| 1429 | $this->add_group_control( |
| 1430 | Group_Control_Background::get_type(), |
| 1431 | [ |
| 1432 | 'name' => 'ekit_blog_posts_meta_background_hover', |
| 1433 | 'label' => esc_html__('Background', 'elementskit-lite'), |
| 1434 | 'types' => ['classic', 'gradient',], |
| 1435 | 'selector' => '{{WRAPPER}} .post-meta-list > span:hover, {{WRAPPER}}.ekit-blog-posts--bg-hover .elementskit-post-image-card:hover .post-meta-list > span', |
| 1436 | 'exclude' => ['image'] // PHPCS:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude |
| 1437 | ] |
| 1438 | ); |
| 1439 | |
| 1440 | $this->add_group_control( |
| 1441 | Group_Control_Border::get_type(), |
| 1442 | [ |
| 1443 | 'name' => 'ekit_blog_posts_meta_border_hover', |
| 1444 | 'label' => esc_html__('Border', 'elementskit-lite'), |
| 1445 | 'selector' => '{{WRAPPER}} .post-meta-list > span:hover, {{WRAPPER}}.ekit-blog-posts--bg-hover .elementskit-post-image-card:hover .post-meta-list > span', |
| 1446 | ] |
| 1447 | ); |
| 1448 | |
| 1449 | $this->add_control( |
| 1450 | 'ekit_blog_posts_meta_border_radius_hover', |
| 1451 | [ |
| 1452 | 'label' => esc_html__('Border Radius', 'elementskit-lite'), |
| 1453 | 'type' => Controls_Manager::DIMENSIONS, |
| 1454 | 'size_units' => ['px', '%', 'em'], |
| 1455 | 'selectors' => [ |
| 1456 | '{{WRAPPER}} .post-meta-list > span:hover, {{WRAPPER}}.ekit-blog-posts--bg-hover .elementskit-post-image-card:hover .post-meta-list > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1457 | ], |
| 1458 | ] |
| 1459 | ); |
| 1460 | |
| 1461 | $this->add_group_control( |
| 1462 | Group_Control_Box_Shadow::get_type(), |
| 1463 | [ |
| 1464 | 'name' => 'ekit_blog_posts_meta_box_shadow_hover', |
| 1465 | 'label' => esc_html__('Box Shadow', 'elementskit-lite'), |
| 1466 | 'selector' => '{{WRAPPER}} .post-meta-list > span:hover, {{WRAPPER}}.ekit-blog-posts--bg-hover .elementskit-post-image-card:hover .post-meta-list > span', |
| 1467 | ] |
| 1468 | ); |
| 1469 | |
| 1470 | $this->add_group_control( |
| 1471 | Group_Control_Text_Shadow::get_type(), |
| 1472 | [ |
| 1473 | 'name' => 'ekit_blog_posts_meta_shadow_hover', |
| 1474 | 'selector' => '{{WRAPPER}} .post-meta-list > span:hover, {{WRAPPER}}.ekit-blog-posts--bg-hover .elementskit-post-image-card:hover .post-meta-list > span', |
| 1475 | ] |
| 1476 | ); |
| 1477 | |
| 1478 | $this->end_controls_tab(); |
| 1479 | |
| 1480 | $this->end_controls_tabs(); |
| 1481 | |
| 1482 | $this->end_controls_section(); |
| 1483 | |
| 1484 | // Floating Date Styles |
| 1485 | $this->start_controls_section( |
| 1486 | 'ekit_blog_posts_floating_date_style_area', |
| 1487 | [ |
| 1488 | 'label' => esc_html__('Floating Date', 'elementskit-lite'), |
| 1489 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1490 | 'condition' => [ |
| 1491 | 'ekit_blog_posts_floating_date' => 'yes', |
| 1492 | ], |
| 1493 | ] |
| 1494 | ); |
| 1495 | |
| 1496 | $this->add_responsive_control( |
| 1497 | 'ekit_blog_posts_floating_date_height', |
| 1498 | [ |
| 1499 | 'label' => esc_html__('Height', 'elementskit-lite'), |
| 1500 | 'type' => Controls_Manager::SLIDER, |
| 1501 | 'default' => [ |
| 1502 | 'size' => '', |
| 1503 | ], |
| 1504 | 'range' => [ |
| 1505 | 'px' => [ |
| 1506 | 'min' => -30, |
| 1507 | 'step' => 1, |
| 1508 | ], |
| 1509 | ], |
| 1510 | 'size_units' => ['px'], |
| 1511 | 'selectors' => [ |
| 1512 | '{{WRAPPER}} .elementskit-meta-lists .elementskit-single-meta' => 'height: {{SIZE}}{{UNIT}};', |
| 1513 | ], |
| 1514 | 'condition' => [ |
| 1515 | 'ekit_blog_posts_floating_date_style' => 'style1', |
| 1516 | ], |
| 1517 | |
| 1518 | ] |
| 1519 | ); |
| 1520 | $this->add_responsive_control( |
| 1521 | 'ekit_blog_posts_floating_date_width', |
| 1522 | [ |
| 1523 | 'label' => esc_html__('Width', 'elementskit-lite'), |
| 1524 | 'type' => Controls_Manager::SLIDER, |
| 1525 | 'default' => [ |
| 1526 | 'size' => '', |
| 1527 | ], |
| 1528 | 'range' => [ |
| 1529 | 'px' => [ |
| 1530 | 'min' => -30, |
| 1531 | 'step' => 1, |
| 1532 | ], |
| 1533 | ], |
| 1534 | 'size_units' => ['px'], |
| 1535 | 'selectors' => [ |
| 1536 | '{{WRAPPER}} .elementskit-meta-lists .elementskit-single-meta' => 'width: {{SIZE}}{{UNIT}};', |
| 1537 | ], |
| 1538 | 'condition' => [ |
| 1539 | 'ekit_blog_posts_floating_date_style' => 'style1', |
| 1540 | ], |
| 1541 | ] |
| 1542 | ); |
| 1543 | $this->add_responsive_control( |
| 1544 | 'ekit_blog_posts_floating_date_left_pos', |
| 1545 | [ |
| 1546 | 'label' => esc_html__('Left', 'elementskit-lite'), |
| 1547 | 'type' => Controls_Manager::SLIDER, |
| 1548 | 'default' => [ |
| 1549 | 'size' => '', |
| 1550 | ], |
| 1551 | 'size_units' => ['px', '%'], |
| 1552 | 'range' => [ |
| 1553 | 'px' => [ |
| 1554 | 'min' => -100, |
| 1555 | 'max' => 1000, |
| 1556 | 'step' => 1, |
| 1557 | ], |
| 1558 | '%' => [ |
| 1559 | 'min' => 0, |
| 1560 | 'max' => 100, |
| 1561 | 'step' => 1, |
| 1562 | ], |
| 1563 | ], |
| 1564 | 'selectors' => [ |
| 1565 | '{{WRAPPER}} .elementskit-meta-lists' => 'left: {{SIZE}}{{UNIT}};', |
| 1566 | ], |
| 1567 | 'condition' => [ |
| 1568 | 'ekit_blog_posts_floating_date_style' => 'style1', |
| 1569 | ], |
| 1570 | ] |
| 1571 | ); |
| 1572 | $this->add_responsive_control( |
| 1573 | 'ekit_blog_posts_floating_date_top_pos', |
| 1574 | [ |
| 1575 | 'label' => esc_html__('Top', 'elementskit-lite'), |
| 1576 | 'type' => Controls_Manager::SLIDER, |
| 1577 | 'default' => [ |
| 1578 | 'size' => '', |
| 1579 | ], |
| 1580 | 'size_units' => ['px', '%'], |
| 1581 | 'range' => [ |
| 1582 | 'px' => [ |
| 1583 | 'min' => -100, |
| 1584 | 'max' => 1000, |
| 1585 | 'step' => 1, |
| 1586 | ], |
| 1587 | '%' => [ |
| 1588 | 'min' => 0, |
| 1589 | 'max' => 100, |
| 1590 | 'step' => 1, |
| 1591 | ], |
| 1592 | ], |
| 1593 | 'selectors' => [ |
| 1594 | '{{WRAPPER}} .elementskit-meta-lists' => 'top: {{SIZE}}{{UNIT}};', |
| 1595 | ], |
| 1596 | 'condition' => [ |
| 1597 | 'ekit_blog_posts_floating_date_style' => 'style1', |
| 1598 | ], |
| 1599 | ] |
| 1600 | ); |
| 1601 | $this->add_responsive_control( |
| 1602 | 'ekit_blog_posts_floating_date_bottom_pos', |
| 1603 | [ |
| 1604 | 'label' => esc_html__('Bottom', 'elementskit-lite'), |
| 1605 | 'type' => Controls_Manager::SLIDER, |
| 1606 | 'default' => [ |
| 1607 | 'size' => '', |
| 1608 | ], |
| 1609 | 'size_units' => ['px', '%'], |
| 1610 | 'range' => [ |
| 1611 | 'px' => [ |
| 1612 | 'min' => 0, |
| 1613 | 'max' => 1000, |
| 1614 | 'step' => 1, |
| 1615 | ], |
| 1616 | '%' => [ |
| 1617 | 'min' => 0, |
| 1618 | 'max' => 100, |
| 1619 | 'step' => 1, |
| 1620 | ], |
| 1621 | ], |
| 1622 | 'selectors' => [ |
| 1623 | '{{WRAPPER}} .elementskit-meta-lists.elementskit-style-tag' => 'bottom: {{SIZE}}{{UNIT}};', |
| 1624 | ], |
| 1625 | 'condition' => [ |
| 1626 | 'ekit_blog_posts_floating_date_style' => 'style2', |
| 1627 | ], |
| 1628 | ] |
| 1629 | ); |
| 1630 | $this->add_responsive_control( |
| 1631 | 'ekit_blog_posts_floating_date_style2_left_pos', |
| 1632 | [ |
| 1633 | 'label' => esc_html__('Left', 'elementskit-lite'), |
| 1634 | 'type' => Controls_Manager::SLIDER, |
| 1635 | 'default' => [ |
| 1636 | 'size' => '-10', |
| 1637 | 'unit' => 'px' |
| 1638 | ], |
| 1639 | 'size_units' => ['px', '%'], |
| 1640 | 'range' => [ |
| 1641 | 'px' => [ |
| 1642 | 'min' => -10, |
| 1643 | 'max' => 100, |
| 1644 | 'step' => 1, |
| 1645 | ], |
| 1646 | '%' => [ |
| 1647 | 'min' => -10, |
| 1648 | 'max' => 100, |
| 1649 | 'step' => 1, |
| 1650 | ], |
| 1651 | ], |
| 1652 | 'selectors' => [ |
| 1653 | '{{WRAPPER}} .elementskit-meta-lists.elementskit-style-tag' => 'left: {{SIZE}}{{UNIT}};', |
| 1654 | ], |
| 1655 | 'condition' => [ |
| 1656 | 'ekit_blog_posts_floating_date_style' => 'style2', |
| 1657 | ], |
| 1658 | ] |
| 1659 | ); |
| 1660 | $this->add_control( |
| 1661 | 'ekit_blog_posts_floating_date_heading', |
| 1662 | [ |
| 1663 | 'label' => esc_html__('Date Typography', 'elementskit-lite'), |
| 1664 | 'type' => Controls_Manager::HEADING, |
| 1665 | 'separator' => 'before', |
| 1666 | ] |
| 1667 | ); |
| 1668 | $this->add_group_control( |
| 1669 | Group_Control_Typography::get_type(), |
| 1670 | [ |
| 1671 | 'name' => 'ekit_blog_posts_floating_date_typography_group', |
| 1672 | 'selector' => '{{WRAPPER}} .elementskit-meta-lists .elementskit-single-meta .elementskit-meta-wraper strong', |
| 1673 | ] |
| 1674 | ); |
| 1675 | |
| 1676 | $this->add_control( |
| 1677 | 'ekit_blog_posts_floating_date_color', |
| 1678 | [ |
| 1679 | 'label' => esc_html__('Color', 'elementskit-lite'), |
| 1680 | 'type' => Controls_Manager::COLOR, |
| 1681 | 'selectors' => [ |
| 1682 | '{{WRAPPER}} .elementskit-meta-lists .elementskit-single-meta .elementskit-meta-wraper strong' => 'color: {{VALUE}};' |
| 1683 | ], |
| 1684 | ] |
| 1685 | ); |
| 1686 | $this->add_control( |
| 1687 | 'ekit_blog_posts_floating_date_month_heading', |
| 1688 | [ |
| 1689 | 'label' => esc_html__('Month Typography', 'elementskit-lite'), |
| 1690 | 'type' => Controls_Manager::HEADING, |
| 1691 | 'separator' => 'before', |
| 1692 | ] |
| 1693 | ); |
| 1694 | $this->add_group_control( |
| 1695 | Group_Control_Typography::get_type(), |
| 1696 | [ |
| 1697 | 'name' => 'ekit_blog_posts_floating_date_month_typography_group', |
| 1698 | 'selector' => '{{WRAPPER}} .elementskit-meta-lists .elementskit-single-meta', |
| 1699 | ] |
| 1700 | ); |
| 1701 | |
| 1702 | $this->add_control( |
| 1703 | 'ekit_blog_posts_floating_date_month_color', |
| 1704 | [ |
| 1705 | 'label' => esc_html__('Color', 'elementskit-lite'), |
| 1706 | 'type' => Controls_Manager::COLOR, |
| 1707 | 'selectors' => [ |
| 1708 | '{{WRAPPER}} .elementskit-meta-lists .elementskit-single-meta .elementskit-meta-wraper' => 'color: {{VALUE}};' |
| 1709 | ], |
| 1710 | ] |
| 1711 | ); |
| 1712 | $this->add_group_control( |
| 1713 | Group_Control_Background::get_type(), |
| 1714 | array( |
| 1715 | 'name' => 'ekit_blog_posts_floating_date_bg_color_group', |
| 1716 | 'selector' => '{{WRAPPER}} .elementskit-meta-lists .elementskit-single-meta', |
| 1717 | 'separator' => 'before', |
| 1718 | ) |
| 1719 | ); |
| 1720 | |
| 1721 | $this->add_responsive_control( |
| 1722 | 'ekit_blog_posts_floating_date_padding', |
| 1723 | [ |
| 1724 | 'label' => esc_html__('Padding', 'elementskit-lite'), |
| 1725 | 'type' => Controls_Manager::DIMENSIONS, |
| 1726 | 'size_units' => ['px', 'em', '%'], |
| 1727 | 'selectors' => [ |
| 1728 | '{{WRAPPER}} .elementskit-meta-lists.elementskit-style-tag > .elementskit-single-meta' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1729 | ], |
| 1730 | 'condition' => [ |
| 1731 | 'ekit_blog_posts_floating_date_style' => 'style2', |
| 1732 | ], |
| 1733 | ] |
| 1734 | ); |
| 1735 | $this->add_group_control( |
| 1736 | Group_Control_Border::get_type(), |
| 1737 | [ |
| 1738 | 'name' => 'ekit_blog_posts_floating_date_border_group', |
| 1739 | 'label' => esc_html__('Border', 'elementskit-lite'), |
| 1740 | 'selector' => '{{WRAPPER}} .elementskit-meta-lists .elementskit-single-meta', |
| 1741 | 'condition' => [ |
| 1742 | 'ekit_blog_posts_floating_date_style' => 'style1', |
| 1743 | ], |
| 1744 | ] |
| 1745 | ); |
| 1746 | $this->add_responsive_control( |
| 1747 | 'ekit_blog_posts_floating_date_border_radius', |
| 1748 | [ |
| 1749 | 'label' => esc_html__('Border Radius', 'elementskit-lite'), |
| 1750 | 'type' => Controls_Manager::DIMENSIONS, |
| 1751 | 'size_units' => ['px'], |
| 1752 | 'default' => [ |
| 1753 | 'top' => '', |
| 1754 | 'right' => '', |
| 1755 | 'bottom' => '', |
| 1756 | 'left' => '', |
| 1757 | ], |
| 1758 | 'selectors' => [ |
| 1759 | '{{WRAPPER}} .elementskit-meta-lists .elementskit-single-meta' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1760 | ], |
| 1761 | 'condition' => [ |
| 1762 | 'ekit_blog_posts_floating_date_style' => 'style', |
| 1763 | ], |
| 1764 | ] |
| 1765 | ); |
| 1766 | $this->add_group_control( |
| 1767 | Group_Control_Box_Shadow::get_type(), |
| 1768 | [ |
| 1769 | 'name' => 'ekit_blog_posts_floating_date_shadow_group', |
| 1770 | 'selector' => '{{WRAPPER}} .elementskit-meta-lists .elementskit-single-meta', |
| 1771 | 'condition' => [ |
| 1772 | 'ekit_blog_posts_floating_date_style' => 'style', |
| 1773 | ], |
| 1774 | ] |
| 1775 | ); |
| 1776 | $this->add_control( |
| 1777 | 'ekit_blog_posts_floating_date_triangle_title', |
| 1778 | [ |
| 1779 | 'label' => esc_html__('Triangle', 'elementskit-lite'), |
| 1780 | 'type' => Controls_Manager::HEADING, |
| 1781 | 'separator' => 'before', |
| 1782 | 'condition' => [ |
| 1783 | 'ekit_blog_posts_floating_date_style' => 'style2', |
| 1784 | ], |
| 1785 | ] |
| 1786 | ); |
| 1787 | $this->add_control( |
| 1788 | 'ekit_blog_posts_floating_date_triangle_color', |
| 1789 | [ |
| 1790 | 'label' => esc_html__('Triangle Background', 'elementskit-lite'), |
| 1791 | 'type' => Controls_Manager::COLOR, |
| 1792 | 'selectors' => [ |
| 1793 | '{{WRAPPER}} .elementskit-meta-lists.elementskit-style-tag > .elementskit-single-meta::before' => 'color: {{VALUE}}', |
| 1794 | ], |
| 1795 | 'condition' => [ |
| 1796 | 'ekit_blog_posts_floating_date_style' => 'style2', |
| 1797 | ], |
| 1798 | ] |
| 1799 | ); |
| 1800 | $this->add_control( |
| 1801 | 'ekit_blog_posts_floating_date_triangle_size', |
| 1802 | [ |
| 1803 | 'label' => esc_html__('Triangle Size', 'elementskit-lite'), |
| 1804 | 'condition' => [ |
| 1805 | 'ekit_blog_posts_floating_date_style' => 'style2', |
| 1806 | ], |
| 1807 | 'type' => Controls_Manager::SLIDER, |
| 1808 | 'size_units' => ['px'], |
| 1809 | 'range' => [ |
| 1810 | 'px' => [ |
| 1811 | 'min' => 0, |
| 1812 | 'max' => 100, |
| 1813 | 'step' => 1, |
| 1814 | ], |
| 1815 | ], |
| 1816 | 'default' => [ |
| 1817 | 'unit' => 'px', |
| 1818 | 'size' => 5, |
| 1819 | ], |
| 1820 | 'selectors' => [ |
| 1821 | '{{WRAPPER}} .elementskit-meta-lists.elementskit-style-tag > .elementskit-single-meta::before' => 'border-width: {{SIZE}}{{UNIT}};', |
| 1822 | ], |
| 1823 | 'condition' => [ |
| 1824 | 'ekit_blog_posts_floating_date_style' => 'style2', |
| 1825 | ], |
| 1826 | ] |
| 1827 | ); |
| 1828 | $this->add_control( |
| 1829 | 'ekit_blog_posts_floating_date_triangle_position_left', |
| 1830 | [ |
| 1831 | 'label' => esc_html__('Triangle Position Left', 'elementskit-lite'), |
| 1832 | 'condition' => [ |
| 1833 | 'ekit_blog_posts_floating_date_style' => 'style2', |
| 1834 | ], |
| 1835 | 'type' => Controls_Manager::SLIDER, |
| 1836 | 'size_units' => ['px', '%'], |
| 1837 | 'range' => [ |
| 1838 | 'px' => [ |
| 1839 | 'min' => 0, |
| 1840 | 'max' => 100, |
| 1841 | 'step' => 1, |
| 1842 | ], |
| 1843 | ], |
| 1844 | 'default' => [ |
| 1845 | 'unit' => '%', |
| 1846 | 'size' => 0, |
| 1847 | ], |
| 1848 | 'selectors' => [ |
| 1849 | '{{WRAPPER}} .elementskit-meta-lists.elementskit-style-tag > .elementskit-single-meta::before' => 'left: {{SIZE}}{{UNIT}};', |
| 1850 | ], |
| 1851 | 'condition' => [ |
| 1852 | 'ekit_blog_posts_floating_date_style' => 'style2', |
| 1853 | ], |
| 1854 | ] |
| 1855 | ); |
| 1856 | $this->add_control( |
| 1857 | 'ekit_blog_posts_floating_date_triangle_position_top', |
| 1858 | [ |
| 1859 | 'label' => esc_html__('Triangle Position Top', 'elementskit-lite'), |
| 1860 | 'condition' => [ |
| 1861 | 'ekit_blog_posts_floating_date_style' => 'style2', |
| 1862 | ], |
| 1863 | 'type' => Controls_Manager::SLIDER, |
| 1864 | 'size_units' => ['px', '%'], |
| 1865 | 'range' => [ |
| 1866 | 'px' => [ |
| 1867 | 'min' => -100, |
| 1868 | 'max' => 100, |
| 1869 | 'step' => 1, |
| 1870 | ], |
| 1871 | ], |
| 1872 | 'default' => [ |
| 1873 | 'unit' => 'px', |
| 1874 | 'size' => -10, |
| 1875 | ], |
| 1876 | 'selectors' => [ |
| 1877 | '{{WRAPPER}} .elementskit-meta-lists.elementskit-style-tag > .elementskit-single-meta::before' => 'top: {{SIZE}}{{UNIT}};', |
| 1878 | ], |
| 1879 | 'condition' => [ |
| 1880 | 'ekit_blog_posts_floating_date_style' => 'style2', |
| 1881 | ], |
| 1882 | ] |
| 1883 | ); |
| 1884 | |
| 1885 | $this->add_control( |
| 1886 | 'ekit_blog_posts_floating_date_triangle_position_alignment', |
| 1887 | [ |
| 1888 | 'label' => esc_html__('Triangle Direction', 'elementskit-lite'), |
| 1889 | 'type' => Controls_Manager::CHOOSE, |
| 1890 | 'options' => [ |
| 1891 | 'triangle_left' => [ |
| 1892 | 'title' => esc_html__('From Left', 'elementskit-lite'), |
| 1893 | 'icon' => 'fa fa-caret-right', |
| 1894 | ], |
| 1895 | 'triangle_right' => [ |
| 1896 | 'title' => esc_html__('From Right', 'elementskit-lite'), |
| 1897 | 'icon' => 'fa fa-caret-left', |
| 1898 | ], |
| 1899 | ], |
| 1900 | 'default' => 'triangle_left', |
| 1901 | 'toggle' => true, |
| 1902 | 'condition' => [ |
| 1903 | 'ekit_blog_posts_floating_date_style' => 'style2', |
| 1904 | ], |
| 1905 | ] |
| 1906 | ); |
| 1907 | |
| 1908 | $this->add_control( |
| 1909 | 'ekit_blog_posts_floating_date_triangle_hr', |
| 1910 | [ |
| 1911 | 'type' => Controls_Manager::DIVIDER, |
| 1912 | 'style' => 'thick', |
| 1913 | 'condition' => [ |
| 1914 | 'ekit_blog_posts_floating_date_style' => 'style2', |
| 1915 | ], |
| 1916 | ] |
| 1917 | ); |
| 1918 | $this->end_controls_section(); |
| 1919 | |
| 1920 | // Floating Category Styles |
| 1921 | $this->start_controls_section( |
| 1922 | 'ekit_blog_posts_floating_category_style', |
| 1923 | [ |
| 1924 | 'label' => esc_html__('Floating Category', 'elementskit-lite'), |
| 1925 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1926 | 'condition' => [ |
| 1927 | 'ekit_blog_posts_floating_category' => 'yes', |
| 1928 | ], |
| 1929 | ] |
| 1930 | ); |
| 1931 | |
| 1932 | $this->add_responsive_control( |
| 1933 | 'ekit_blog_posts_floating_category_top_pos', |
| 1934 | [ |
| 1935 | 'label' => esc_html__('Top', 'elementskit-lite'), |
| 1936 | 'type' => Controls_Manager::SLIDER, |
| 1937 | 'default' => [ |
| 1938 | 'size' => '', |
| 1939 | ], |
| 1940 | 'size_units' => ['px', '%'], |
| 1941 | 'range' => [ |
| 1942 | 'px' => [ |
| 1943 | 'min' => -100, |
| 1944 | 'max' => 1000, |
| 1945 | 'step' => 1, |
| 1946 | ], |
| 1947 | '%' => [ |
| 1948 | 'min' => 0, |
| 1949 | 'max' => 100, |
| 1950 | 'step' => 1, |
| 1951 | ], |
| 1952 | ], |
| 1953 | 'selectors' => [ |
| 1954 | '{{WRAPPER}} .elementskit-meta-categories' => 'top: {{SIZE}}{{UNIT}};', |
| 1955 | ], |
| 1956 | ] |
| 1957 | ); |
| 1958 | |
| 1959 | $this->add_responsive_control( |
| 1960 | 'ekit_blog_posts_floating_category_left_pos', |
| 1961 | [ |
| 1962 | 'label' => esc_html__('Left', 'elementskit-lite'), |
| 1963 | 'type' => Controls_Manager::SLIDER, |
| 1964 | 'default' => [ |
| 1965 | 'size' => '', |
| 1966 | ], |
| 1967 | 'size_units' => ['px', '%'], |
| 1968 | 'range' => [ |
| 1969 | 'px' => [ |
| 1970 | 'min' => -100, |
| 1971 | 'max' => 1000, |
| 1972 | 'step' => 1, |
| 1973 | ], |
| 1974 | '%' => [ |
| 1975 | 'min' => 0, |
| 1976 | 'max' => 100, |
| 1977 | 'step' => 1, |
| 1978 | ], |
| 1979 | ], |
| 1980 | 'selectors' => [ |
| 1981 | '{{WRAPPER}} .elementskit-meta-categories' => 'left: {{SIZE}}{{UNIT}};', |
| 1982 | ], |
| 1983 | ] |
| 1984 | ); |
| 1985 | |
| 1986 | $this->add_group_control( |
| 1987 | Group_Control_Typography::get_type(), |
| 1988 | [ |
| 1989 | 'name' => 'ekit_blog_posts_floating_category_typography', |
| 1990 | 'selector' => '{{WRAPPER}} .elementskit-meta-categories .elementskit-meta-wraper span a', |
| 1991 | ] |
| 1992 | ); |
| 1993 | |
| 1994 | $this->add_control( |
| 1995 | 'ekit_blog_posts_floating_category_color', |
| 1996 | [ |
| 1997 | 'label' => esc_html__('Color', 'elementskit-lite'), |
| 1998 | 'type' => Controls_Manager::COLOR, |
| 1999 | 'selectors' => [ |
| 2000 | '{{WRAPPER}} .elementskit-meta-categories .elementskit-meta-wraper span a' => 'color: {{VALUE}};' |
| 2001 | ], |
| 2002 | ] |
| 2003 | ); |
| 2004 | |
| 2005 | $this->add_control( |
| 2006 | 'ekit_blog_posts_floating_category_bg_color', |
| 2007 | [ |
| 2008 | 'label' => esc_html__('Background Color', 'elementskit-lite'), |
| 2009 | 'type' => Controls_Manager::COLOR, |
| 2010 | 'selectors' => [ |
| 2011 | '{{WRAPPER}} .elementskit-meta-categories .elementskit-meta-wraper span' => 'background-color: {{VALUE}};' |
| 2012 | ], |
| 2013 | ] |
| 2014 | ); |
| 2015 | |
| 2016 | |
| 2017 | $this->add_responsive_control( |
| 2018 | 'ekit_blog_posts_floating_category_padding', |
| 2019 | [ |
| 2020 | 'label' => esc_html__('Padding', 'elementskit-lite'), |
| 2021 | 'type' => Controls_Manager::DIMENSIONS, |
| 2022 | 'size_units' => ['px', '%', 'em'], |
| 2023 | 'default' => [ |
| 2024 | 'unit' => 'px', |
| 2025 | 'top' => '4', |
| 2026 | 'right' => '8', |
| 2027 | 'bottom' => '4', |
| 2028 | 'left' => '8', |
| 2029 | ], |
| 2030 | 'selectors' => [ |
| 2031 | '{{WRAPPER}} .elementskit-meta-categories .elementskit-meta-wraper span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2032 | ], |
| 2033 | ] |
| 2034 | ); |
| 2035 | |
| 2036 | $this->add_responsive_control( |
| 2037 | 'ekit_blog_posts_floating_category_padding_radius', |
| 2038 | [ |
| 2039 | 'label' => esc_html__('Border Radius', 'elementskit-lite'), |
| 2040 | 'type' => Controls_Manager::DIMENSIONS, |
| 2041 | 'size_units' => ['px', '%', 'em'], |
| 2042 | 'separator' => 'after', |
| 2043 | 'selectors' => [ |
| 2044 | '{{WRAPPER}} .elementskit-meta-categories .elementskit-meta-wraper span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2045 | ], |
| 2046 | ] |
| 2047 | ); |
| 2048 | |
| 2049 | $this->add_responsive_control( |
| 2050 | 'ekit_blog_posts_floating_category_margin_right', |
| 2051 | [ |
| 2052 | 'label' => esc_html__('Space Between Categories', 'elementskit-lite'), |
| 2053 | 'type' => Controls_Manager::SLIDER, |
| 2054 | 'default' => [ |
| 2055 | 'size' => '', |
| 2056 | ], |
| 2057 | 'size_units' => ['px', '%'], |
| 2058 | 'range' => [ |
| 2059 | 'px' => [ |
| 2060 | 'min' => -100, |
| 2061 | 'max' => 1000, |
| 2062 | 'step' => 1, |
| 2063 | ], |
| 2064 | '%' => [ |
| 2065 | 'min' => 0, |
| 2066 | 'max' => 100, |
| 2067 | 'step' => 1, |
| 2068 | ], |
| 2069 | ], |
| 2070 | 'selectors' => [ |
| 2071 | '{{WRAPPER}} .elementskit-meta-categories .elementskit-meta-wraper span:not(:last-child)' => 'margin-right: {{SIZE}}{{UNIT}};', |
| 2072 | ], |
| 2073 | ] |
| 2074 | ); |
| 2075 | |
| 2076 | $this->end_controls_section(); |
| 2077 | |
| 2078 | // Title Styles |
| 2079 | $this->start_controls_section( |
| 2080 | 'ekit_blog_posts_title_style', |
| 2081 | [ |
| 2082 | 'label' => esc_html__('Title', 'elementskit-lite'), |
| 2083 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2084 | 'condition' => [ |
| 2085 | 'ekit_blog_posts_title' => 'yes', |
| 2086 | ], |
| 2087 | ] |
| 2088 | ); |
| 2089 | |
| 2090 | $this->add_group_control( |
| 2091 | Group_Control_Typography::get_type(), |
| 2092 | [ |
| 2093 | 'name' => 'ekit_blog_posts_title_typography', |
| 2094 | 'selector' => '{{WRAPPER}} .elementskit-post-body .entry-title, {{WRAPPER}} .elementskit-entry-header .entry-title, {{WRAPPER}} .elementskit-post-image-card .elementskit-post-body .entry-title a, {{WRAPPER}} .elementskit-post-card .elementskit-entry-header .entry-title a,{{WRAPPER}} .elementskit-blog-block-post .elementskit-post-body .entry-title a', |
| 2095 | ] |
| 2096 | ); |
| 2097 | |
| 2098 | $this->start_controls_tabs( |
| 2099 | 'ekit_blog_posts_title_tabs' |
| 2100 | ); |
| 2101 | |
| 2102 | $this->start_controls_tab( |
| 2103 | 'ekit_blog_posts_title_normal', |
| 2104 | [ |
| 2105 | 'label' => esc_html__('Normal', 'elementskit-lite'), |
| 2106 | ] |
| 2107 | ); |
| 2108 | |
| 2109 | $this->add_control( |
| 2110 | 'ekit_blog_posts_title_color', |
| 2111 | [ |
| 2112 | 'label' => esc_html__('Color', 'elementskit-lite'), |
| 2113 | 'type' => Controls_Manager::COLOR, |
| 2114 | 'selectors' => [ |
| 2115 | '{{WRAPPER}} .elementskit-post-body .entry-title a' => 'color: {{VALUE}};', |
| 2116 | '{{WRAPPER}} .elementskit-entry-header .entry-title a' => 'color: {{VALUE}};' |
| 2117 | ], |
| 2118 | ] |
| 2119 | ); |
| 2120 | |
| 2121 | $this->add_group_control( |
| 2122 | Group_Control_Text_Shadow::get_type(), |
| 2123 | [ |
| 2124 | 'name' => 'ekit_blog_posts_title_shadow', |
| 2125 | 'selector' => '{{WRAPPER}} .elementskit-post-body .entry-title a, {{WRAPPER}} .elementskit-entry-header .entry-title a', |
| 2126 | ] |
| 2127 | ); |
| 2128 | |
| 2129 | $this->end_controls_tab(); |
| 2130 | |
| 2131 | $this->start_controls_tab( |
| 2132 | 'ekit_blog_posts_title_hover', |
| 2133 | [ |
| 2134 | 'label' => esc_html__('Hover', 'elementskit-lite'), |
| 2135 | ] |
| 2136 | ); |
| 2137 | |
| 2138 | $this->add_control( |
| 2139 | 'ekit_blog_posts_title_hover_color', |
| 2140 | [ |
| 2141 | 'label' => esc_html__('Color', 'elementskit-lite'), |
| 2142 | 'type' => Controls_Manager::COLOR, |
| 2143 | 'selectors' => [ |
| 2144 | '{{WRAPPER}} .elementskit-post-body .entry-title a:hover' => 'color: {{VALUE}};', |
| 2145 | '{{WRAPPER}} .elementskit-entry-header .entry-title a:hover' => 'color: {{VALUE}};', |
| 2146 | '{{WRAPPER}} .elementskit-post-card:hover .entry-title a' => 'color: {{VALUE}};', |
| 2147 | '{{WRAPPER}} .elementskit-post-image-card:hover .entry-title a' => 'color: {{VALUE}};' |
| 2148 | ], |
| 2149 | ] |
| 2150 | ); |
| 2151 | |
| 2152 | $this->add_group_control( |
| 2153 | Group_Control_Text_Shadow::get_type(), |
| 2154 | [ |
| 2155 | 'name' => 'ekit_blog_posts_title_hover_shadow', |
| 2156 | 'selector' => '{{WRAPPER}} .elementskit-post-body .entry-title a:hover, {{WRAPPER}} .elementskit-entry-header .entry-title a:hover', |
| 2157 | ] |
| 2158 | ); |
| 2159 | |
| 2160 | $this->end_controls_tab(); |
| 2161 | |
| 2162 | $this->end_controls_tabs(); |
| 2163 | |
| 2164 | $this->add_control( |
| 2165 | 'ekit_blog_posts_title_hover_shadow_hr', |
| 2166 | [ |
| 2167 | 'type' => Controls_Manager::DIVIDER, |
| 2168 | 'style' => 'thick', |
| 2169 | ] |
| 2170 | ); |
| 2171 | |
| 2172 | $this->add_responsive_control( |
| 2173 | 'ekit_blog_posts_title_alignment', |
| 2174 | [ |
| 2175 | 'label' => esc_html__('Alignment', 'elementskit-lite'), |
| 2176 | 'type' => Controls_Manager::CHOOSE, |
| 2177 | 'options' => [ |
| 2178 | 'left' => [ |
| 2179 | 'title' => esc_html__('Left', 'elementskit-lite'), |
| 2180 | 'icon' => 'eicon-text-align-left', |
| 2181 | ], |
| 2182 | 'center' => [ |
| 2183 | 'title' => esc_html__('Center', 'elementskit-lite'), |
| 2184 | 'icon' => 'eicon-text-align-center', |
| 2185 | ], |
| 2186 | 'right' => [ |
| 2187 | 'title' => esc_html__('Right', 'elementskit-lite'), |
| 2188 | 'icon' => 'eicon-text-align-right', |
| 2189 | ], |
| 2190 | 'justify' => [ |
| 2191 | 'title' => esc_html__('justify', 'elementskit-lite'), |
| 2192 | 'icon' => 'eicon-text-align-justify', |
| 2193 | ], |
| 2194 | ], |
| 2195 | 'default' => 'left', |
| 2196 | 'devices' => ['desktop', 'tablet', 'mobile'], |
| 2197 | 'selectors' => [ |
| 2198 | '{{WRAPPER}} .elementskit-post-body .entry-title' => 'text-align: {{VALUE}};', |
| 2199 | '{{WRAPPER}} .elementskit-entry-header .entry-title' => 'text-align: {{VALUE}};', |
| 2200 | ], |
| 2201 | ] |
| 2202 | ); |
| 2203 | |
| 2204 | $this->add_responsive_control( |
| 2205 | 'ekit_blog_posts_title_margin', |
| 2206 | [ |
| 2207 | 'label' => esc_html__('Margin', 'elementskit-lite'), |
| 2208 | 'type' => Controls_Manager::DIMENSIONS, |
| 2209 | 'size_units' => ['px', '%', 'em'], |
| 2210 | 'selectors' => [ |
| 2211 | '{{WRAPPER}} .elementskit-post-body .entry-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2212 | '{{WRAPPER}} .elementskit-entry-header .entry-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2213 | ], |
| 2214 | ] |
| 2215 | ); |
| 2216 | |
| 2217 | $this->add_control( |
| 2218 | 'ekit_blog_posts_title_separator_hr', |
| 2219 | [ |
| 2220 | 'type' => Controls_Manager::DIVIDER, |
| 2221 | 'style' => 'thick', |
| 2222 | 'condition' => [ |
| 2223 | 'ekit_blog_posts_layout_style' => 'elementskit-post-card', |
| 2224 | ], |
| 2225 | ] |
| 2226 | ); |
| 2227 | |
| 2228 | $this->add_control( |
| 2229 | 'ekit_blog_posts_title_separator', |
| 2230 | [ |
| 2231 | 'label' => esc_html__('Show Separator', 'elementskit-lite'), |
| 2232 | 'type' => Controls_Manager::SWITCHER, |
| 2233 | 'label_on' => esc_html__('Yes', 'elementskit-lite'), |
| 2234 | 'label_off' => esc_html__('No', 'elementskit-lite'), |
| 2235 | 'default' => 'yes', |
| 2236 | 'condition' => [ |
| 2237 | 'ekit_blog_posts_layout_style' => 'elementskit-post-card', |
| 2238 | ], |
| 2239 | ] |
| 2240 | ); |
| 2241 | |
| 2242 | $this->add_control( |
| 2243 | 'ekit_blog_posts_title_separator_color', |
| 2244 | [ |
| 2245 | 'label' => esc_html__('Separator Color', 'elementskit-lite'), |
| 2246 | 'type' => Controls_Manager::COLOR, |
| 2247 | 'condition' => [ |
| 2248 | 'ekit_blog_posts_title_separator' => 'yes', |
| 2249 | 'ekit_blog_posts_layout_style' => 'elementskit-post-card', |
| 2250 | ], |
| 2251 | 'selectors' => [ |
| 2252 | '{{WRAPPER}} .elementskit-border-hr' => 'background-color: {{VALUE}};', |
| 2253 | ], |
| 2254 | ] |
| 2255 | ); |
| 2256 | |
| 2257 | $this->add_control( |
| 2258 | 'ekit_blog_posts_title_separator_width', |
| 2259 | [ |
| 2260 | 'label' => esc_html__('Width', 'elementskit-lite'), |
| 2261 | 'type' => Controls_Manager::SLIDER, |
| 2262 | 'size_units' => ['%'], |
| 2263 | 'range' => [ |
| 2264 | '%' => [ |
| 2265 | 'min' => 0, |
| 2266 | 'max' => 100, |
| 2267 | ], |
| 2268 | ], |
| 2269 | 'default' => [ |
| 2270 | 'unit' => '%', |
| 2271 | 'size' => 5, |
| 2272 | ], |
| 2273 | 'selectors' => [ |
| 2274 | '{{WRAPPER}} .elementskit-border-hr' => 'width: {{SIZE}}{{UNIT}};', |
| 2275 | ], |
| 2276 | 'condition' => [ |
| 2277 | 'ekit_blog_posts_title_separator' => 'yes', |
| 2278 | 'ekit_blog_posts_layout_style' => 'elementskit-post-card', |
| 2279 | ], |
| 2280 | ] |
| 2281 | ); |
| 2282 | |
| 2283 | $this->add_control( |
| 2284 | 'ekit_blog_posts_title_separator_height', |
| 2285 | [ |
| 2286 | 'label' => esc_html__('Height', 'elementskit-lite'), |
| 2287 | 'type' => Controls_Manager::SLIDER, |
| 2288 | 'size_units' => ['px'], |
| 2289 | 'range' => [ |
| 2290 | 'px' => [ |
| 2291 | 'min' => 0, |
| 2292 | 'max' => 100, |
| 2293 | 'step' => 1, |
| 2294 | ], |
| 2295 | ], |
| 2296 | 'default' => [ |
| 2297 | 'unit' => 'px', |
| 2298 | 'size' => 3, |
| 2299 | ], |
| 2300 | 'selectors' => [ |
| 2301 | '{{WRAPPER}} .elementskit-border-hr' => 'height: {{SIZE}}{{UNIT}};', |
| 2302 | ], |
| 2303 | 'condition' => [ |
| 2304 | 'ekit_blog_posts_title_separator' => 'yes', |
| 2305 | 'ekit_blog_posts_layout_style' => 'elementskit-post-card', |
| 2306 | ], |
| 2307 | ] |
| 2308 | ); |
| 2309 | |
| 2310 | $this->add_control( |
| 2311 | 'ekit_blog_posts_title_separator_margin', |
| 2312 | [ |
| 2313 | 'label' => esc_html__('Margin', 'elementskit-lite'), |
| 2314 | 'type' => Controls_Manager::DIMENSIONS, |
| 2315 | 'size_units' => ['px'], |
| 2316 | 'selectors' => [ |
| 2317 | '{{WRAPPER}} .elementskit-border-hr' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2318 | ], |
| 2319 | 'condition' => [ |
| 2320 | 'ekit_blog_posts_title_separator' => 'yes', |
| 2321 | 'ekit_blog_posts_layout_style' => 'elementskit-post-card', |
| 2322 | ], |
| 2323 | ] |
| 2324 | ); |
| 2325 | |
| 2326 | $this->end_controls_section(); |
| 2327 | |
| 2328 | |
| 2329 | // Content Styles |
| 2330 | $this->start_controls_section( |
| 2331 | 'ekit_blog_posts_content_style', |
| 2332 | [ |
| 2333 | 'label' => esc_html__('Content', 'elementskit-lite'), |
| 2334 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2335 | 'condition' => [ |
| 2336 | 'ekit_blog_posts_content' => 'yes', |
| 2337 | ], |
| 2338 | ] |
| 2339 | ); |
| 2340 | |
| 2341 | $this->add_control( |
| 2342 | 'ekit_blog_posts_content_color', |
| 2343 | [ |
| 2344 | 'label' => esc_html__('Color', 'elementskit-lite'), |
| 2345 | 'type' => Controls_Manager::COLOR, |
| 2346 | 'selectors' => [ |
| 2347 | '{{WRAPPER}} .elementskit-post-footer > p' => 'color: {{VALUE}};', |
| 2348 | '{{WRAPPER}} .elementskit-post-body > p' => 'color: {{VALUE}};', |
| 2349 | ], |
| 2350 | ] |
| 2351 | ); |
| 2352 | |
| 2353 | $this->add_control( |
| 2354 | 'ekit_blog_posts_content_color_hover', |
| 2355 | [ |
| 2356 | 'label' => esc_html__('Hover Color', 'elementskit-lite'), |
| 2357 | 'type' => Controls_Manager::COLOR, |
| 2358 | 'selectors' => [ |
| 2359 | '{{WRAPPER}} .elementskit-blog-block-post:hover .elementskit-post-footer > p' => 'color: {{VALUE}};', |
| 2360 | '{{WRAPPER}} .elementskit-post-image-card:hover .elementskit-post-footer > p' => 'color: {{VALUE}};', |
| 2361 | '{{WRAPPER}} .elementskit-post-card:hover .elementskit-post-footer > p' => 'color: {{VALUE}};', |
| 2362 | '{{WRAPPER}} .elementskit-blog-block-post:hover .elementskit-post-body > p' => 'color: {{VALUE}};', |
| 2363 | '{{WRAPPER}} .elementskit-post-image-card:hover .elementskit-post-body > p' => 'color: {{VALUE}};', |
| 2364 | '{{WRAPPER}} .elementskit-post-card:hover .elementskit-post-body > p' => 'color: {{VALUE}};', |
| 2365 | ], |
| 2366 | ] |
| 2367 | ); |
| 2368 | |
| 2369 | $this->add_group_control( |
| 2370 | Group_Control_Typography::get_type(), |
| 2371 | [ |
| 2372 | 'name' => 'ekit_blog_posts_content_typography', |
| 2373 | 'selector' => '{{WRAPPER}} .elementskit-post-footer > p, {{WRAPPER}} .elementskit-post-body > p', |
| 2374 | ] |
| 2375 | ); |
| 2376 | |
| 2377 | $this->add_group_control( |
| 2378 | Group_Control_Text_Shadow::get_type(), |
| 2379 | [ |
| 2380 | 'name' => 'ekit_blog_posts_content_shadow', |
| 2381 | 'selector' => '{{WRAPPER}} .elementskit-post-footer > p, {{WRAPPER}} .elementskit-post-body > p', |
| 2382 | ] |
| 2383 | ); |
| 2384 | |
| 2385 | $this->add_responsive_control( |
| 2386 | 'ekit_blog_posts_content_alignment', |
| 2387 | [ |
| 2388 | 'label' => esc_html__('Alignment', 'elementskit-lite'), |
| 2389 | 'type' => Controls_Manager::CHOOSE, |
| 2390 | 'options' => [ |
| 2391 | 'left' => [ |
| 2392 | 'title' => esc_html__('Left', 'elementskit-lite'), |
| 2393 | 'icon' => 'eicon-text-align-left', |
| 2394 | ], |
| 2395 | 'center' => [ |
| 2396 | 'title' => esc_html__('Center', 'elementskit-lite'), |
| 2397 | 'icon' => 'eicon-text-align-center', |
| 2398 | ], |
| 2399 | 'right' => [ |
| 2400 | 'title' => esc_html__('Right', 'elementskit-lite'), |
| 2401 | 'icon' => 'eicon-text-align-right', |
| 2402 | ], |
| 2403 | 'justify' => [ |
| 2404 | 'title' => esc_html__('justify', 'elementskit-lite'), |
| 2405 | 'icon' => 'eicon-text-align-justify', |
| 2406 | ], |
| 2407 | ], |
| 2408 | 'default' => 'left', |
| 2409 | 'devices' => ['desktop', 'tablet', 'mobile'], |
| 2410 | 'selectors' => [ |
| 2411 | '{{WRAPPER}} .elementskit-post-footer' => 'text-align: {{VALUE}};', |
| 2412 | '{{WRAPPER}} .elementskit-post-body > p' => 'text-align: {{VALUE}};', |
| 2413 | ], |
| 2414 | ] |
| 2415 | ); |
| 2416 | |
| 2417 | $this->add_responsive_control( |
| 2418 | 'ekit_blog_posts_content_margin', |
| 2419 | [ |
| 2420 | 'label' => esc_html__('Margin', 'elementskit-lite'), |
| 2421 | 'type' => Controls_Manager::DIMENSIONS, |
| 2422 | 'size_units' => ['px', '%', 'em'], |
| 2423 | 'selectors' => [ |
| 2424 | '{{WRAPPER}} .elementskit-post-footer' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2425 | '{{WRAPPER}} .elementskit-blog-block-post .elementskit-post-footer > p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2426 | '{{WRAPPER}} .elementskit-post-body > p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2427 | ], |
| 2428 | ] |
| 2429 | ); |
| 2430 | |
| 2431 | // content highlight |
| 2432 | |
| 2433 | $this->add_control( |
| 2434 | 'ekit_blog_posts_content_highlight_border', |
| 2435 | [ |
| 2436 | 'label' => esc_html__('Show Highlight Border', 'elementskit-lite'), |
| 2437 | 'type' => Controls_Manager::SWITCHER, |
| 2438 | 'label_on' => esc_html__('Show', 'elementskit-lite'), |
| 2439 | 'label_off' => esc_html__('Hide', 'elementskit-lite'), |
| 2440 | 'return_value' => 'yes', |
| 2441 | 'default' => '', |
| 2442 | 'separator' => 'before' |
| 2443 | ] |
| 2444 | ); |
| 2445 | |
| 2446 | $this->add_control( |
| 2447 | 'ekit_blog_posts_content_highlight_border_height', |
| 2448 | [ |
| 2449 | 'label' => esc_html__('Hight', 'elementskit-lite'), |
| 2450 | 'type' => Controls_Manager::SLIDER, |
| 2451 | 'size_units' => ['px', '%'], |
| 2452 | 'range' => [ |
| 2453 | 'px' => [ |
| 2454 | 'min' => 5, |
| 2455 | 'max' => 300, |
| 2456 | 'step' => 1, |
| 2457 | ], |
| 2458 | |
| 2459 | ], |
| 2460 | 'default' => [ |
| 2461 | 'unit' => 'px', |
| 2462 | 'size' => 100, |
| 2463 | ], |
| 2464 | 'selectors' => [ |
| 2465 | '{{WRAPPER}} .elementskit-post-body.ekit-highlight-border:before' => 'height: {{SIZE}}{{UNIT}};', |
| 2466 | ], |
| 2467 | 'condition' => [ |
| 2468 | 'ekit_blog_posts_content_highlight_border' => 'yes' |
| 2469 | ] |
| 2470 | ] |
| 2471 | ); |
| 2472 | |
| 2473 | $this->add_control( |
| 2474 | 'ekit_blog_posts_content_highlight_border_width', |
| 2475 | [ |
| 2476 | 'label' => esc_html__('Width', 'elementskit-lite'), |
| 2477 | 'type' => Controls_Manager::SLIDER, |
| 2478 | 'size_units' => ['px', '%'], |
| 2479 | 'range' => [ |
| 2480 | 'px' => [ |
| 2481 | 'min' => 1, |
| 2482 | 'max' => 10, |
| 2483 | 'step' => 1, |
| 2484 | ], |
| 2485 | |
| 2486 | ], |
| 2487 | 'default' => [ |
| 2488 | 'unit' => 'px', |
| 2489 | 'size' => 2, |
| 2490 | ], |
| 2491 | 'selectors' => [ |
| 2492 | '{{WRAPPER}} .elementskit-post-body.ekit-highlight-border:before' => 'width: {{SIZE}}{{UNIT}};', |
| 2493 | ], |
| 2494 | 'condition' => [ |
| 2495 | 'ekit_blog_posts_content_highlight_border' => 'yes' |
| 2496 | ] |
| 2497 | ] |
| 2498 | ); |
| 2499 | |
| 2500 | $this->add_control( |
| 2501 | 'ekit_blog_posts_content_highlight_border_top_bottom_pos', |
| 2502 | [ |
| 2503 | 'label' => esc_html__('Top Bottom Position', 'elementskit-lite'), |
| 2504 | 'type' => Controls_Manager::SLIDER, |
| 2505 | 'size_units' => ['%'], |
| 2506 | 'range' => [ |
| 2507 | '%' => [ |
| 2508 | 'min' => -10, |
| 2509 | 'max' => 110, |
| 2510 | 'step' => 1, |
| 2511 | ], |
| 2512 | |
| 2513 | ], |
| 2514 | 'default' => [ |
| 2515 | 'unit' => '%', |
| 2516 | 'size' => 50, |
| 2517 | ], |
| 2518 | 'selectors' => [ |
| 2519 | '{{WRAPPER}} .elementskit-post-body.ekit-highlight-border:before' => 'top: {{SIZE}}{{UNIT}};', |
| 2520 | ], |
| 2521 | |
| 2522 | 'condition' => [ |
| 2523 | 'ekit_blog_posts_content_highlight_border' => 'yes' |
| 2524 | ] |
| 2525 | ] |
| 2526 | ); |
| 2527 | |
| 2528 | $this->add_control( |
| 2529 | 'ekit_blog_posts_content_highlight_border_left_right_pos', |
| 2530 | [ |
| 2531 | 'label' => esc_html__('Left Right Position', 'elementskit-lite'), |
| 2532 | 'type' => Controls_Manager::SLIDER, |
| 2533 | 'size_units' => ['%'], |
| 2534 | 'range' => [ |
| 2535 | '%' => [ |
| 2536 | 'min' => -5, |
| 2537 | 'max' => 120, |
| 2538 | 'step' => 1, |
| 2539 | ], |
| 2540 | |
| 2541 | ], |
| 2542 | 'default' => [ |
| 2543 | 'unit' => '%', |
| 2544 | 'size' => 0, |
| 2545 | ], |
| 2546 | 'selectors' => [ |
| 2547 | '{{WRAPPER}} .elementskit-post-body.ekit-highlight-border:before' => 'left: {{SIZE}}{{UNIT}};', |
| 2548 | ], |
| 2549 | 'condition' => [ |
| 2550 | 'ekit_blog_posts_content_highlight_border' => 'yes' |
| 2551 | ] |
| 2552 | ] |
| 2553 | ); |
| 2554 | |
| 2555 | $this->start_controls_tabs('ekit_blog_posts_border_highlight_color_tabs', [ |
| 2556 | 'condition' => [ |
| 2557 | 'ekit_blog_posts_content_highlight_border' => 'yes' |
| 2558 | ] |
| 2559 | ]); |
| 2560 | |
| 2561 | $this->start_controls_tab( |
| 2562 | 'ekit_blog_posts_border_highlight_color_normal_tab', |
| 2563 | [ |
| 2564 | 'label' => esc_html__('Normal', 'elementskit-lite'), |
| 2565 | ] |
| 2566 | ); |
| 2567 | |
| 2568 | $this->add_group_control( |
| 2569 | Group_Control_Background::get_type(), |
| 2570 | [ |
| 2571 | 'name' => 'ekit_blog_posts_border_highlight_bg_color', |
| 2572 | 'label' => esc_html__('Separator Color', 'elementskit-lite'), |
| 2573 | 'types' => ['classic', 'gradient'], |
| 2574 | 'selector' => '{{WRAPPER}} .elementskit-post-body.ekit-highlight-border:before', |
| 2575 | ] |
| 2576 | ); |
| 2577 | |
| 2578 | $this->end_controls_tab(); |
| 2579 | |
| 2580 | $this->start_controls_tab( |
| 2581 | 'ekit_blog_posts_border_highlight_color_hover_tab', |
| 2582 | [ |
| 2583 | 'label' => esc_html__('Hover', 'elementskit-lite'), |
| 2584 | ] |
| 2585 | ); |
| 2586 | |
| 2587 | $this->add_group_control( |
| 2588 | Group_Control_Background::get_type(), |
| 2589 | [ |
| 2590 | 'name' => 'ekit_blog_posts_border_highlight_bg_color_hover', |
| 2591 | 'label' => esc_html__('Separator Color', 'elementskit-lite'), |
| 2592 | 'types' => ['classic', 'gradient'], |
| 2593 | 'selector' => '{{WRAPPER}} .elementskit-post-body.ekit-highlight-border:hover:before', |
| 2594 | ] |
| 2595 | ); |
| 2596 | |
| 2597 | $this->add_control( |
| 2598 | 'ekit_blog_posts_content_highlight_border_transition', |
| 2599 | [ |
| 2600 | 'label' => esc_html__('Transition', 'elementskit-lite'), |
| 2601 | 'type' => Controls_Manager::SLIDER, |
| 2602 | 'size_units' => ['s'], |
| 2603 | 'range' => [ |
| 2604 | 's' => [ |
| 2605 | 'min' => .1, |
| 2606 | 'max' => 5, |
| 2607 | 'step' => .1, |
| 2608 | ], |
| 2609 | |
| 2610 | ], |
| 2611 | 'default' => [ |
| 2612 | 'unit' => 's', |
| 2613 | 'size' => 0, |
| 2614 | ], |
| 2615 | 'selectors' => [ |
| 2616 | '{{WRAPPER}} .elementskit-post-body.ekit-highlight-border:before' => '-webkit-transition: all {{SIZE}}{{UNIT}}; -o-transition: all {{SIZE}}{{UNIT}}; transition: all {{SIZE}}{{UNIT}};', |
| 2617 | ], |
| 2618 | 'condition' => [ |
| 2619 | 'ekit_blog_posts_content_highlight_border' => 'yes' |
| 2620 | ] |
| 2621 | ] |
| 2622 | ); |
| 2623 | |
| 2624 | $this->end_controls_tab(); |
| 2625 | $this->end_controls_tabs(); |
| 2626 | |
| 2627 | $this->end_controls_section(); |
| 2628 | |
| 2629 | |
| 2630 | // Author Image Styles |
| 2631 | $this->start_controls_section( |
| 2632 | 'ekit_blog_posts_author_img_style', |
| 2633 | [ |
| 2634 | 'label' => esc_html__('Author Image', 'elementskit-lite'), |
| 2635 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2636 | 'condition' => [ |
| 2637 | 'ekit_blog_posts_author_image' => 'yes', |
| 2638 | ], |
| 2639 | ] |
| 2640 | ); |
| 2641 | |
| 2642 | $this->add_control( |
| 2643 | 'ekit_blog_posts_author_img_size_width', |
| 2644 | [ |
| 2645 | 'label' => esc_html__('Image Width', 'elementskit-lite'), |
| 2646 | 'type' => Controls_Manager::SLIDER, |
| 2647 | 'size_units' => ['px', '%'], |
| 2648 | 'range' => [ |
| 2649 | 'px' => [ |
| 2650 | 'min' => 30, |
| 2651 | 'max' => 200, |
| 2652 | 'step' => 1, |
| 2653 | ], |
| 2654 | '%' => [ |
| 2655 | 'min' => 0, |
| 2656 | 'max' => 100, |
| 2657 | ], |
| 2658 | ], |
| 2659 | 'default' => [ |
| 2660 | 'unit' => 'px', |
| 2661 | 'size' => 30, |
| 2662 | ], |
| 2663 | 'selectors' => [ |
| 2664 | '{{WRAPPER}} .elementskit-post-body .meta-author .author-img' => 'width: {{SIZE}}{{UNIT}};', |
| 2665 | ], |
| 2666 | ] |
| 2667 | ); |
| 2668 | |
| 2669 | $this->add_control( |
| 2670 | 'ekit_blog_posts_author_img_size_height', |
| 2671 | [ |
| 2672 | 'label' => esc_html__('Image Height', 'elementskit-lite'), |
| 2673 | 'type' => Controls_Manager::SLIDER, |
| 2674 | 'size_units' => ['px', '%'], |
| 2675 | 'range' => [ |
| 2676 | 'px' => [ |
| 2677 | 'min' => 30, |
| 2678 | 'max' => 200, |
| 2679 | 'step' => 1, |
| 2680 | ], |
| 2681 | '%' => [ |
| 2682 | 'min' => 0, |
| 2683 | 'max' => 100, |
| 2684 | ], |
| 2685 | ], |
| 2686 | 'default' => [ |
| 2687 | 'unit' => 'px', |
| 2688 | 'size' => 30, |
| 2689 | ], |
| 2690 | 'selectors' => [ |
| 2691 | '{{WRAPPER}} .elementskit-post-body .meta-author .author-img' => 'height: {{SIZE}}{{UNIT}};', |
| 2692 | ], |
| 2693 | ] |
| 2694 | ); |
| 2695 | |
| 2696 | $this->add_group_control( |
| 2697 | Group_Control_Box_Shadow::get_type(), |
| 2698 | [ |
| 2699 | 'name' => 'ekit_blog_posts_author_img_shadow', |
| 2700 | 'selector' => '{{WRAPPER}} .elementskit-post-body .author-img', |
| 2701 | ] |
| 2702 | ); |
| 2703 | |
| 2704 | $this->add_group_control( |
| 2705 | Group_Control_Border::get_type(), |
| 2706 | [ |
| 2707 | 'name' => 'ekit_blog_posts_author_img_border', |
| 2708 | 'label' => esc_html__('Border', 'elementskit-lite'), |
| 2709 | 'selector' => '{{WRAPPER}} .elementskit-post-body .author-img', |
| 2710 | ] |
| 2711 | ); |
| 2712 | |
| 2713 | $this->add_control( |
| 2714 | 'ekit_blog_posts_author_img_margin', |
| 2715 | [ |
| 2716 | 'label' => esc_html__('Margin', 'elementskit-lite'), |
| 2717 | 'type' => Controls_Manager::DIMENSIONS, |
| 2718 | 'size_units' => ['px', '%', 'em'], |
| 2719 | 'default' => [ |
| 2720 | 'top' => '0', |
| 2721 | 'right' => '15', |
| 2722 | 'bottom' => '0', |
| 2723 | 'left' => '0', |
| 2724 | 'isLinked' => false, |
| 2725 | ], |
| 2726 | 'selectors' => [ |
| 2727 | '{{WRAPPER}} .elementskit-post-body .author-img' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2728 | ], |
| 2729 | ] |
| 2730 | ); |
| 2731 | |
| 2732 | $this->add_responsive_control( |
| 2733 | 'ekit_blog_posts_author_img_radius', |
| 2734 | [ |
| 2735 | 'label' => esc_html__('Radius', 'elementskit-lite'), |
| 2736 | 'type' => Controls_Manager::DIMENSIONS, |
| 2737 | 'size_units' => ['px', '%', 'em'], |
| 2738 | 'separator' => 'after', |
| 2739 | 'selectors' => [ |
| 2740 | '{{WRAPPER}} .elementskit-post-body .author-img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2741 | ], |
| 2742 | ] |
| 2743 | ); |
| 2744 | |
| 2745 | $this->end_controls_section(); |
| 2746 | |
| 2747 | |
| 2748 | |
| 2749 | |
| 2750 | // Button |
| 2751 | $this->start_controls_section( |
| 2752 | 'ekit_blog_posts_btn_section_style', |
| 2753 | [ |
| 2754 | 'label' => esc_html__('Button', 'elementskit-lite'), |
| 2755 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2756 | 'condition' => ['ekit_blog_posts_read_more' => 'yes', 'ekit_blog_posts_layout_style!' => 'elementskit-blog-block-post'] |
| 2757 | ] |
| 2758 | ); |
| 2759 | |
| 2760 | $this->add_responsive_control( |
| 2761 | 'ekit_blog_posts_btn_text_padding', |
| 2762 | [ |
| 2763 | 'label' => esc_html__('Padding', 'elementskit-lite'), |
| 2764 | 'type' => Controls_Manager::DIMENSIONS, |
| 2765 | 'size_units' => ['px', 'em', '%'], |
| 2766 | 'selectors' => [ |
| 2767 | '{{WRAPPER}} .elementskit-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2768 | ], |
| 2769 | ] |
| 2770 | ); |
| 2771 | |
| 2772 | $this->add_responsive_control( |
| 2773 | 'ekit_blog_posts_btn_normal_icon_font_size', |
| 2774 | array( |
| 2775 | 'label' => esc_html__('Icon Font Size', 'elementskit-lite'), |
| 2776 | 'type' => Controls_Manager::SLIDER, |
| 2777 | 'size_units' => array( |
| 2778 | 'px', |
| 2779 | 'em', |
| 2780 | 'rem', |
| 2781 | ), |
| 2782 | 'range' => array( |
| 2783 | 'px' => array( |
| 2784 | 'min' => 1, |
| 2785 | 'max' => 100, |
| 2786 | ), |
| 2787 | ), |
| 2788 | 'selectors' => array( |
| 2789 | '{{WRAPPER}} .elementskit-btn :is(i, svg)' => 'font-size: {{SIZE}}{{UNIT}};', |
| 2790 | ), |
| 2791 | ) |
| 2792 | ); |
| 2793 | |
| 2794 | $this->add_group_control( |
| 2795 | Group_Control_Typography::get_type(), |
| 2796 | [ |
| 2797 | 'name' => 'ekit_blog_posts_btn_typography', |
| 2798 | 'label' => esc_html__('Typography', 'elementskit-lite'), |
| 2799 | 'selector' => '{{WRAPPER}} .elementskit-btn', |
| 2800 | ] |
| 2801 | ); |
| 2802 | |
| 2803 | $this->start_controls_tabs('ekit_blog_posts_btn_tabs_style'); |
| 2804 | |
| 2805 | $this->start_controls_tab( |
| 2806 | 'ekit_blog_posts_btn_tabnormal', |
| 2807 | [ |
| 2808 | 'label' => esc_html__('Normal', 'elementskit-lite'), |
| 2809 | ] |
| 2810 | ); |
| 2811 | |
| 2812 | $this->add_control( |
| 2813 | 'ekit_blog_posts_btn_text_color', |
| 2814 | [ |
| 2815 | 'label' => esc_html__('Text Color', 'elementskit-lite'), |
| 2816 | 'type' => Controls_Manager::COLOR, |
| 2817 | 'default' => '', |
| 2818 | 'selectors' => [ |
| 2819 | '{{WRAPPER}} .elementskit-btn' => 'color: {{VALUE}}; fill: {{VALUE}};', |
| 2820 | ], |
| 2821 | ] |
| 2822 | ); |
| 2823 | $this->add_group_control( |
| 2824 | Group_Control_Background::get_type(), |
| 2825 | array( |
| 2826 | 'name' => 'ekit_blog_posts_btn_bg_color', |
| 2827 | 'selector' => '{{WRAPPER}} .elementskit-btn', |
| 2828 | ) |
| 2829 | ); |
| 2830 | |
| 2831 | $this->end_controls_tab(); |
| 2832 | |
| 2833 | $this->start_controls_tab( |
| 2834 | 'ekit_blog_posts_btn_tab_button_hover', |
| 2835 | [ |
| 2836 | 'label' => esc_html__('Hover', 'elementskit-lite'), |
| 2837 | ] |
| 2838 | ); |
| 2839 | |
| 2840 | $this->add_control( |
| 2841 | 'ekit_blog_posts_btn_hover_color', |
| 2842 | [ |
| 2843 | 'label' => esc_html__('Text Color', 'elementskit-lite'), |
| 2844 | 'type' => Controls_Manager::COLOR, |
| 2845 | 'default' => '#ffffff', |
| 2846 | 'selectors' => [ |
| 2847 | '{{WRAPPER}} .elementskit-btn:hover' => 'color: {{VALUE}}; fill: {{VALUE}};', |
| 2848 | ], |
| 2849 | ] |
| 2850 | ); |
| 2851 | |
| 2852 | $this->add_group_control( |
| 2853 | Group_Control_Background::get_type(), |
| 2854 | array( |
| 2855 | 'name' => 'ekit_blog_posts_btn_bg_hover_color', |
| 2856 | 'selector' => '{{WRAPPER}} .elementskit-btn:hover', |
| 2857 | ) |
| 2858 | ); |
| 2859 | |
| 2860 | $this->end_controls_tab(); |
| 2861 | $this->end_controls_tabs(); |
| 2862 | |
| 2863 | $this->add_control( |
| 2864 | 'ekit_blog_posts_btn_border_style', |
| 2865 | [ |
| 2866 | 'label' => esc_html_x('Border Type', 'Border Control', 'elementskit-lite'), |
| 2867 | 'type' => Controls_Manager::SELECT, |
| 2868 | 'options' => [ |
| 2869 | '' => esc_html__('None', 'elementskit-lite'), |
| 2870 | 'solid' => esc_html_x('Solid', 'Border Control', 'elementskit-lite'), |
| 2871 | 'double' => esc_html_x('Double', 'Border Control', 'elementskit-lite'), |
| 2872 | 'dotted' => esc_html_x('Dotted', 'Border Control', 'elementskit-lite'), |
| 2873 | 'dashed' => esc_html_x('Dashed', 'Border Control', 'elementskit-lite'), |
| 2874 | 'groove' => esc_html_x('Groove', 'Border Control', 'elementskit-lite'), |
| 2875 | ], |
| 2876 | 'selectors' => [ |
| 2877 | '{{WRAPPER}} .elementskit-btn' => 'border-style: {{VALUE}};', |
| 2878 | ], |
| 2879 | ] |
| 2880 | ); |
| 2881 | $this->add_control( |
| 2882 | 'ekit_blog_posts_btn_border_dimensions', |
| 2883 | [ |
| 2884 | 'label' => esc_html_x('Width', 'Border Control', 'elementskit-lite'), |
| 2885 | 'type' => Controls_Manager::DIMENSIONS, |
| 2886 | 'selectors' => [ |
| 2887 | '{{WRAPPER}} .elementskit-btn' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2888 | ], |
| 2889 | 'condition' => [ |
| 2890 | 'ekit_blog_posts_btn_border_style!' => '' |
| 2891 | ] |
| 2892 | ] |
| 2893 | ); |
| 2894 | $this->start_controls_tabs('xs_tabs_button_border_style'); |
| 2895 | $this->start_controls_tab( |
| 2896 | 'ekit_blog_posts_btn_tab_border_normal', |
| 2897 | [ |
| 2898 | 'label' => esc_html__('Normal', 'elementskit-lite'), |
| 2899 | 'condition' => [ |
| 2900 | 'ekit_blog_posts_btn_border_style!' => '' |
| 2901 | ] |
| 2902 | ] |
| 2903 | ); |
| 2904 | |
| 2905 | $this->add_control( |
| 2906 | 'ekit_blog_posts_btn_border_color', |
| 2907 | [ |
| 2908 | 'label' => esc_html_x('Color', 'Border Control', 'elementskit-lite'), |
| 2909 | 'type' => Controls_Manager::COLOR, |
| 2910 | 'default' => '', |
| 2911 | 'selectors' => [ |
| 2912 | '{{WRAPPER}} .elementskit-btn' => 'border-color: {{VALUE}};', |
| 2913 | ], |
| 2914 | 'condition' => [ |
| 2915 | 'ekit_blog_posts_btn_border_style!' => '' |
| 2916 | ] |
| 2917 | ] |
| 2918 | ); |
| 2919 | $this->end_controls_tab(); |
| 2920 | |
| 2921 | $this->start_controls_tab( |
| 2922 | 'ekit_blog_posts_btn_tab_button_border_hover', |
| 2923 | [ |
| 2924 | 'label' => esc_html__('Hover', 'elementskit-lite'), |
| 2925 | 'condition' => [ |
| 2926 | 'ekit_blog_posts_btn_border_style!' => '' |
| 2927 | ] |
| 2928 | ] |
| 2929 | ); |
| 2930 | $this->add_control( |
| 2931 | 'ekit_blog_posts_btn_hover_border_color', |
| 2932 | [ |
| 2933 | 'label' => esc_html_x('Color', 'Border Control', 'elementskit-lite'), |
| 2934 | 'type' => Controls_Manager::COLOR, |
| 2935 | 'default' => '', |
| 2936 | 'selectors' => [ |
| 2937 | '{{WRAPPER}} .elementskit-btn:hover' => 'border-color: {{VALUE}};', |
| 2938 | ], |
| 2939 | 'condition' => [ |
| 2940 | 'ekit_blog_posts_btn_border_style!' => '' |
| 2941 | ] |
| 2942 | ] |
| 2943 | ); |
| 2944 | $this->end_controls_tab(); |
| 2945 | $this->end_controls_tabs(); |
| 2946 | $this->add_responsive_control( |
| 2947 | 'ekit_blog_posts_btn_border_radius', |
| 2948 | [ |
| 2949 | 'label' => esc_html__('Border Radius', 'elementskit-lite'), |
| 2950 | 'type' => Controls_Manager::DIMENSIONS, |
| 2951 | 'size_units' => ['px'], |
| 2952 | 'default' => [ |
| 2953 | 'top' => '', |
| 2954 | 'right' => '', |
| 2955 | 'bottom' => '', |
| 2956 | 'left' => '', |
| 2957 | ], |
| 2958 | 'selectors' => [ |
| 2959 | '{{WRAPPER}} .elementskit-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2960 | ], |
| 2961 | ] |
| 2962 | ); |
| 2963 | |
| 2964 | $this->add_group_control( |
| 2965 | Group_Control_Box_Shadow::get_type(), |
| 2966 | [ |
| 2967 | 'name' => 'ekit_blog_posts_btn_box_shadow_group', |
| 2968 | 'selector' => '{{WRAPPER}} .elementskit-btn', |
| 2969 | ] |
| 2970 | ); |
| 2971 | |
| 2972 | |
| 2973 | $this->end_controls_section(); |
| 2974 | |
| 2975 | $this->insert_pro_message(); |
| 2976 | } |
| 2977 | |
| 2978 | protected function render() |
| 2979 | { |
| 2980 | echo '<div class="ekit-wid-con" >'; |
| 2981 | $this->render_raw(); |
| 2982 | echo '</div>'; |
| 2983 | } |
| 2984 | |
| 2985 | protected function render_raw() |
| 2986 | { |
| 2987 | $settings = $this->get_settings(); |
| 2988 | extract($settings); |
| 2989 | |
| 2990 | $highlight_border = $ekit_blog_posts_content_highlight_border == 'yes' ? 'ekit-highlight-border' : ''; |
| 2991 | $ekit_blog_posts_offset = ($ekit_blog_posts_offset == '') ? 0 : $ekit_blog_posts_offset; |
| 2992 | |
| 2993 | $default = [ |
| 2994 | 'orderby' => array($ekit_blog_posts_order_by => $ekit_blog_posts_sort), |
| 2995 | 'posts_per_page' => $ekit_blog_posts_num, |
| 2996 | 'offset' => $ekit_blog_posts_offset, |
| 2997 | 'post_status' => 'publish' |
| 2998 | ]; |
| 2999 | |
| 3000 | if ($ekit_blog_posts_is_manual_selection === 'yes') { |
| 3001 | $default = \ElementsKit_Lite\Utils::array_push_assoc( |
| 3002 | $default, |
| 3003 | 'post__in', |
| 3004 | (!empty($ekit_blog_posts_manual_selection && count($ekit_blog_posts_manual_selection) > 0)) ? $ekit_blog_posts_manual_selection : [-1] |
| 3005 | ); |
| 3006 | } |
| 3007 | |
| 3008 | if ($ekit_blog_posts_is_manual_selection == '' && $ekit_blog_posts_cats != '') { |
| 3009 | $default = \ElementsKit_Lite\Utils::array_push_assoc( |
| 3010 | $default, |
| 3011 | 'category__in', |
| 3012 | $ekit_blog_posts_cats |
| 3013 | ); |
| 3014 | } |
| 3015 | |
| 3016 | // Post Items |
| 3017 | $post_items_class = 'ekit-row post-items'; |
| 3018 | |
| 3019 | if ($grid_masonry === 'yes') { |
| 3020 | $post_items_class .= ' ekit-blog-post-masonry-active'; |
| 3021 | } else { |
| 3022 | $post_items_class .= ' ekit-blog-post-masonry-inactive'; |
| 3023 | } |
| 3024 | |
| 3025 | $this->add_render_attribute( |
| 3026 | 'post_items', |
| 3027 | [ |
| 3028 | 'id' => 'post-items--' . $this->get_id(), |
| 3029 | 'class' => $post_items_class, |
| 3030 | ] |
| 3031 | ); |
| 3032 | |
| 3033 | $masonry_columns = $this->get_masonry_columns($settings); |
| 3034 | $masonry = [ |
| 3035 | 'gutterX' => $masonry_column_gap['size'] ?? 10, |
| 3036 | 'gutterY' => $masonry_row_gap['size'] ?? 10, |
| 3037 | 'columns' => $masonry_columns, |
| 3038 | 'responsive' => [ |
| 3039 | ['maxWidth' => 1024, 'columns' => min($masonry_columns, 3)], |
| 3040 | ['maxWidth' => 767, 'columns' => min($masonry_columns, 2)], |
| 3041 | ['maxWidth' => 480, 'columns' => 1], |
| 3042 | ], |
| 3043 | ]; |
| 3044 | |
| 3045 | if ($grid_masonry === 'yes'): |
| 3046 | $this->add_render_attribute('post_items', 'data-masonry-config', 'true'); |
| 3047 | $this->add_render_attribute('post_items', 'data-masonry-lib-config', wp_json_encode($masonry)); |
| 3048 | endif; |
| 3049 | |
| 3050 | // Post Query |
| 3051 | $post_query = new \WP_Query($default); |
| 3052 | |
| 3053 | ?> |
| 3054 | <div <?php echo $this->get_render_attribute_string('post_items'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Already escaped by elementor |
| 3055 | ?>> |
| 3056 | <?php if ('elementskit-blog-block-post' == $ekit_blog_posts_layout_style) { |
| 3057 | $ekit_blog_posts_column = 'ekit-col-12'; |
| 3058 | } |
| 3059 | $column_size = 'ekit-col-12'; |
| 3060 | $img_order = 'order-1'; |
| 3061 | $content_order = 'order-2'; |
| 3062 | |
| 3063 | if ('right' == $ekit_blog_posts_feature_img_float) { |
| 3064 | $img_order = 'order-2'; |
| 3065 | $content_order = 'order-1'; |
| 3066 | } |
| 3067 | while ($post_query->have_posts()) : $post_query->the_post(); |
| 3068 | if ( |
| 3069 | 'yes' == $ekit_blog_posts_feature_img |
| 3070 | && has_post_thumbnail() |
| 3071 | && ('yes' == $ekit_blog_posts_title |
| 3072 | || 'yes' == $ekit_blog_posts_content |
| 3073 | || 'yes' == $ekit_blog_posts_meta |
| 3074 | || 'yes' == $ekit_blog_posts_author) |
| 3075 | ) { |
| 3076 | $column_size = 'ekit-col-6'; |
| 3077 | } |
| 3078 | |
| 3079 | ob_start(); ?> |
| 3080 | <h2 class="entry-title"> |
| 3081 | <a href="<?php the_permalink(); ?>"> |
| 3082 | <?php if ($ekit_blog_posts_title_trim != '' || $ekit_blog_posts_title_trim > 0): |
| 3083 | echo esc_html(wp_trim_words(get_the_title(), $ekit_blog_posts_title_trim)); |
| 3084 | else: |
| 3085 | the_title(); |
| 3086 | endif; ?> |
| 3087 | </a> |
| 3088 | </h2> |
| 3089 | <?php $title_html = ob_get_clean(); |
| 3090 | |
| 3091 | $meta_data_html = ''; |
| 3092 | if ('yes' == $ekit_blog_posts_meta): |
| 3093 | ob_start(); ?> |
| 3094 | <?php if ($ekit_blog_posts_meta == 'yes' && $ekit_blog_posts_meta_select != '') : ?> |
| 3095 | <div class="post-meta-list"> |
| 3096 | <?php foreach ($ekit_blog_posts_meta_select as $meta): ?> |
| 3097 | <?php if ($meta == 'author'): ?> |
| 3098 | <span class="meta-author"> |
| 3099 | <?php if ('yes' == $ekit_blog_posts_author_image): ?> |
| 3100 | <span class="author-img"> |
| 3101 | <?php echo get_avatar(get_the_author_meta("ID")); ?> |
| 3102 | </span> |
| 3103 | <?php else: ?> |
| 3104 | <?php Icons_Manager::render_icon($settings['ekit_blog_posts_meta_author_icons'], ['aria-hidden' => 'true']); ?> |
| 3105 | <?php endif; ?> |
| 3106 | <a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>" class="author-name"><?php the_author_meta('display_name'); ?></a> |
| 3107 | </span> |
| 3108 | <?php endif; ?> |
| 3109 | <?php if ($meta == 'date'): ?> |
| 3110 | <span class="meta-date"> |
| 3111 | <?php Icons_Manager::render_icon($settings['ekit_blog_posts_meta_date_icons'], ['aria-hidden' => 'true']); ?> |
| 3112 | <span class="meta-date-text"> |
| 3113 | <?php echo esc_html(get_the_date()); ?> |
| 3114 | </span> |
| 3115 | </span> |
| 3116 | <?php endif; ?> |
| 3117 | <?php if ($meta == 'category'): ?> |
| 3118 | <span class="post-cat"> |
| 3119 | <?php Icons_Manager::render_icon($settings['ekit_blog_posts_meta_category_icons'], ['aria-hidden' => 'true']); ?> |
| 3120 | <?php echo get_the_category_list(' | '); // phpcs:ignore WordPress.Security.EscapeOutput -- Already escaped by WordPress |
| 3121 | ?> |
| 3122 | </span> |
| 3123 | <?php endif; ?> |
| 3124 | <?php if ($meta == 'comment'): ?> |
| 3125 | <span class="post-comment"> |
| 3126 | <?php Icons_Manager::render_icon($settings['ekit_blog_posts_meta_comment_icons'], ['aria-hidden' => 'true']); ?> |
| 3127 | <a href="<?php comments_link(); ?>"><?php echo esc_html(get_comments_number()); ?></a> |
| 3128 | </span> |
| 3129 | <?php endif; ?> |
| 3130 | <?php endforeach; ?> |
| 3131 | </div> |
| 3132 | <?php endif; |
| 3133 | $meta_data_html .= ob_get_clean(); |
| 3134 | endif; |
| 3135 | |
| 3136 | // $column_size = self::format_colname($column_size); |
| 3137 | // $ekit_blog_posts_column = self::format_colname($ekit_blog_posts_column); |
| 3138 | ?> |
| 3139 | <div class="post-item <?php echo esc_attr($ekit_blog_posts_column); ?>"> |
| 3140 | |
| 3141 | <?php if ('elementskit-blog-block-post' == $ekit_blog_posts_layout_style): ?> |
| 3142 | <div class="<?php echo esc_attr($ekit_blog_posts_layout_style); ?>"> |
| 3143 | <div class="row no-gutters"> |
| 3144 | <?php if ('yes' == $ekit_blog_posts_feature_img && has_post_thumbnail()): ?> |
| 3145 | <div class="<?php echo esc_attr($column_size . ' ' . $img_order); ?>"> |
| 3146 | <a href="<?php the_permalink(); ?>" class="elementskit-entry-thumb"> |
| 3147 | <img src="<?php the_post_thumbnail_url(esc_attr($ekit_blog_posts_feature_img_size_size)); ?>" alt="<?php the_title(); ?>"> |
| 3148 | </a><!-- .elementskit-entry-thumb END --> |
| 3149 | </div> |
| 3150 | <?php endif; ?> |
| 3151 | |
| 3152 | <div class="<?php echo esc_attr($column_size . ' ' . $content_order); ?>"> |
| 3153 | <div class="elementskit-post-body <?php echo esc_attr($highlight_border); ?>"> |
| 3154 | <div class="elementskit-entry-header"> |
| 3155 | <?php if ('yes' == $ekit_blog_posts_title && 'before_meta' == $ekit_blog_posts_title_position): ?> |
| 3156 | <?php echo wp_kses($title_html, \ElementsKit_Lite\Utils::get_kses_array()); ?> |
| 3157 | <?php endif; ?> |
| 3158 | |
| 3159 | <?php if ('after_content' != $ekit_blog_posts_title_position): ?> |
| 3160 | <?php echo $meta_data_html; // phpcs:ignore WordPress.Security.EscapeOutput -- Buffering output line number 2972 |
| 3161 | ?> |
| 3162 | <?php endif; ?> |
| 3163 | |
| 3164 | <?php if ('yes' == $ekit_blog_posts_title && 'after_content' == $ekit_blog_posts_title_position): ?> |
| 3165 | <?php echo wp_kses($title_html, \ElementsKit_Lite\Utils::get_kses_array()); ?> |
| 3166 | <?php endif; ?> |
| 3167 | |
| 3168 | <?php if ('yes' == $ekit_blog_posts_title && 'after_meta' == $ekit_blog_posts_title_position): ?> |
| 3169 | <?php echo wp_kses($title_html, \ElementsKit_Lite\Utils::get_kses_array()); ?> |
| 3170 | <?php endif; ?> |
| 3171 | </div><!-- .elementskit-entry-header END --> |
| 3172 | |
| 3173 | <?php if ('yes' == $ekit_blog_posts_content): ?> |
| 3174 | <div class="elementskit-post-footer"> |
| 3175 | <?php if ($ekit_blog_posts_content_trim != '' || $ekit_blog_posts_content_trim > 0): ?> |
| 3176 | <p><?php echo esc_html(wp_trim_words(get_the_excerpt(), $ekit_blog_posts_content_trim)); ?></p> |
| 3177 | <?php else: ?> |
| 3178 | <?php the_excerpt(); ?> |
| 3179 | <?php endif; ?> |
| 3180 | <?php if ('after_content' == $ekit_blog_posts_title_position): ?> |
| 3181 | <?php echo $meta_data_html; // phpcs:ignore WordPress.Security.EscapeOutput -- Buffering output line number 2972 |
| 3182 | ?> |
| 3183 | <?php endif; ?> |
| 3184 | </div><!-- .elementskit-post-footer END --> |
| 3185 | <?php endif; ?> |
| 3186 | </div><!-- .elementskit-post-body END --> |
| 3187 | </div> |
| 3188 | </div> |
| 3189 | </div><!-- .elementskit-blog-block-post .radius .gradient-bg END --> |
| 3190 | <?php else: ?> |
| 3191 | <div class="<?php echo esc_attr($ekit_blog_posts_layout_style); ?>"> |
| 3192 | <div class="elementskit-entry-header"> |
| 3193 | <?php if ('elementskit-post-image-card' == $ekit_blog_posts_layout_style && 'yes' == $ekit_blog_posts_feature_img && has_post_thumbnail()): ?> |
| 3194 | <a href="<?php the_permalink(); ?>" class="elementskit-entry-thumb"> |
| 3195 | <img src="<?php the_post_thumbnail_url(esc_attr($ekit_blog_posts_feature_img_size_size)); ?>" alt="<?php the_title(); ?>"> |
| 3196 | </a><!-- .elementskit-entry-thumb END --> |
| 3197 | <?php if ('yes' == $settings['ekit_blog_posts_floating_date']) : ?> |
| 3198 | <?php if ($ekit_blog_posts_floating_date_style == 'style1'): ?> |
| 3199 | <div class="elementskit-meta-lists"> |
| 3200 | <div class="elementskit-single-meta"><span class="elementskit-meta-wraper"><strong><?php echo get_the_date('d'); ?></strong><?php echo get_the_date('M'); ?></span></div> |
| 3201 | </div> |
| 3202 | <?php elseif ($ekit_blog_posts_floating_date_style == 'style2'): ?> |
| 3203 | <div class="elementskit-meta-lists elementskit-style-tag"> |
| 3204 | <div class="elementskit-single-meta <?php echo esc_attr($settings['ekit_blog_posts_floating_date_triangle_position_alignment']); ?>"><span class="elementskit-meta-wraper"><strong><?php echo get_the_date('d'); ?></strong><?php echo get_the_date('M'); ?></span></div> |
| 3205 | </div> |
| 3206 | <?php endif; ?> |
| 3207 | <?php endif; ?> |
| 3208 | <?php endif; ?> |
| 3209 | |
| 3210 | <?php if ('yes' == $settings['ekit_blog_posts_floating_category']) : ?> |
| 3211 | <div class="elementskit-meta-categories"> |
| 3212 | <span class="elementskit-meta-wraper"> |
| 3213 | <span><?php echo get_the_category_list('</span><span>'); // phpcs:ignore WordPress.Security.EscapeOutput -- Already escaped by WordPress |
| 3214 | ?></span> |
| 3215 | </span> |
| 3216 | </div> |
| 3217 | <?php endif; ?> |
| 3218 | |
| 3219 | <?php if ('elementskit-post-card' == $ekit_blog_posts_layout_style) : |
| 3220 | if ('yes' == $ekit_blog_posts_title && 'before_meta' == $ekit_blog_posts_title_position): ?> |
| 3221 | <?php echo wp_kses($title_html, \ElementsKit_Lite\Utils::get_kses_array()); ?> |
| 3222 | |
| 3223 | <?php if ('yes' == $ekit_blog_posts_title_separator): ?> |
| 3224 | <span class="elementskit-border-hr"></span> |
| 3225 | <?php endif; ?> |
| 3226 | <?php endif; ?> |
| 3227 | |
| 3228 | <?php if ('after_content' != $ekit_blog_posts_title_position): ?> |
| 3229 | <?php echo $meta_data_html; // phpcs:ignore WordPress.Security.EscapeOutput -- Buffering output line number 2972 |
| 3230 | ?> |
| 3231 | <?php endif; ?> |
| 3232 | |
| 3233 | <?php if ('yes' == $ekit_blog_posts_title && 'after_content' == $ekit_blog_posts_title_position): ?> |
| 3234 | <?php echo wp_kses($title_html, \ElementsKit_Lite\Utils::get_kses_array()); ?> |
| 3235 | |
| 3236 | <?php if ('yes' == $ekit_blog_posts_title_separator): ?> |
| 3237 | <span class="elementskit-border-hr"></span> |
| 3238 | <?php endif; ?> |
| 3239 | <?php endif; ?> |
| 3240 | |
| 3241 | <?php if ('yes' == $ekit_blog_posts_title && 'after_meta' == $ekit_blog_posts_title_position): ?> |
| 3242 | <?php echo wp_kses($title_html, \ElementsKit_Lite\Utils::get_kses_array()); ?> |
| 3243 | |
| 3244 | <?php if ('yes' == $ekit_blog_posts_title_separator): ?> |
| 3245 | <span class="elementskit-border-hr"></span> |
| 3246 | <?php endif; ?> |
| 3247 | <?php endif; ?> |
| 3248 | <?php endif; ?> |
| 3249 | </div><!-- .elementskit-entry-header END --> |
| 3250 | |
| 3251 | <div class="elementskit-post-body <?php echo esc_attr($highlight_border); ?>"> |
| 3252 | <?php if ('elementskit-post-image-card' == $ekit_blog_posts_layout_style): |
| 3253 | if ('yes' == $ekit_blog_posts_title && 'before_meta' == $ekit_blog_posts_title_position): ?> |
| 3254 | <?php echo wp_kses($title_html, \ElementsKit_Lite\Utils::get_kses_array()); ?> |
| 3255 | <?php endif; ?> |
| 3256 | |
| 3257 | <?php if ('after_content' != $ekit_blog_posts_title_position): ?> |
| 3258 | <?php echo $meta_data_html; // phpcs:ignore WordPress.Security.EscapeOutput -- Buffering output line number 2972 |
| 3259 | ?> |
| 3260 | <?php endif; ?> |
| 3261 | |
| 3262 | <?php if ('yes' == $ekit_blog_posts_title && 'after_content' == $ekit_blog_posts_title_position): ?> |
| 3263 | <?php echo wp_kses($title_html, \ElementsKit_Lite\Utils::get_kses_array()); ?> |
| 3264 | <?php endif; ?> |
| 3265 | |
| 3266 | <?php if ('yes' == $ekit_blog_posts_title && 'after_meta' == $ekit_blog_posts_title_position): ?> |
| 3267 | <?php echo wp_kses($title_html, \ElementsKit_Lite\Utils::get_kses_array()); ?> |
| 3268 | <?php endif; ?> |
| 3269 | <?php endif; ?> |
| 3270 | <?php if ('yes' == $ekit_blog_posts_content): ?> |
| 3271 | <?php if ($ekit_blog_posts_content_trim != '' || $ekit_blog_posts_content_trim > 0): ?> |
| 3272 | <p><?php echo esc_html(wp_trim_words(get_the_excerpt(), $ekit_blog_posts_content_trim)); ?></p> |
| 3273 | <?php else: ?> |
| 3274 | <?php the_excerpt(); ?> |
| 3275 | <?php endif; ?> |
| 3276 | <?php endif; ?> |
| 3277 | <?php if ('after_content' == $ekit_blog_posts_title_position): ?> |
| 3278 | <?php echo $meta_data_html; // phpcs:ignore WordPress.Security.EscapeOutput -- Buffering output line number 2972 |
| 3279 | ?> |
| 3280 | <?php endif; ?> |
| 3281 | <?php |
| 3282 | if ($ekit_blog_posts_read_more == 'yes') : |
| 3283 | $post_id = get_the_ID(); |
| 3284 | $btn_text = $settings['ekit_blog_posts_btn_text']; |
| 3285 | $icon_align = $settings['ekit_blog_posts_btn_icon_align']; |
| 3286 | |
| 3287 | $this->add_render_attribute('read_more_link' . $post_id, 'class', 'elementskit-btn'); |
| 3288 | if (!empty($settings['ekit_blog_posts_btn_class'])) { |
| 3289 | $this->add_render_attribute('read_more_link' . $post_id, 'class', $settings['ekit_blog_posts_btn_class']); |
| 3290 | } |
| 3291 | $this->add_render_attribute('read_more_link' . $post_id, 'class', 'whitespace--normal'); |
| 3292 | $this->add_render_attribute('read_more_link' . $post_id, 'id', $settings['ekit_blog_posts_btn_id']); |
| 3293 | $this->add_render_attribute('read_more_link' . $post_id, 'href', get_the_permalink()); |
| 3294 | ?> |
| 3295 | <div class="btn-wraper"> |
| 3296 | <?php if ($icon_align == 'right') : ?> |
| 3297 | <a <?php $this->print_render_attribute_string('read_more_link' . $post_id); ?>> |
| 3298 | <?php echo esc_html($btn_text); ?> |
| 3299 | <?php if ($settings['ekit_blog_posts_btn_icons__switch'] === 'yes') : |
| 3300 | Icons_Manager::render_icon($settings['ekit_blog_posts_btn_icons'], ['aria-hidden' => 'true']); |
| 3301 | endif; ?> |
| 3302 | </a> |
| 3303 | <?php endif; ?> |
| 3304 | |
| 3305 | <?php if ($icon_align == 'left'): ?> |
| 3306 | <a <?php $this->print_render_attribute_string('read_more_link' . $post_id); ?>> |
| 3307 | <?php if ($settings['ekit_blog_posts_btn_icons__switch'] === 'yes') : |
| 3308 | Icons_Manager::render_icon($settings['ekit_blog_posts_btn_icons'], ['aria-hidden' => 'true']); |
| 3309 | endif; ?> |
| 3310 | <?php echo esc_html($btn_text); ?> |
| 3311 | </a> |
| 3312 | <?php endif; ?> |
| 3313 | </div> |
| 3314 | <?php endif; ?> |
| 3315 | </div><!-- .elementskit-post-body END --> |
| 3316 | </div> |
| 3317 | <?php endif; ?> |
| 3318 | |
| 3319 | </div> |
| 3320 | <?php endwhile; ?> |
| 3321 | </div> |
| 3322 | <?php |
| 3323 | wp_reset_postdata(); |
| 3324 | } |
| 3325 | |
| 3326 | protected function get_masonry_columns($settings) |
| 3327 | { |
| 3328 | $columns = 3; |
| 3329 | |
| 3330 | if (! empty($settings['grid_masonry']) && $settings['grid_masonry'] === 'yes') { |
| 3331 | $column_class = $settings['ekit_blog_posts_column'] ?? ''; |
| 3332 | $columns = [ |
| 3333 | 'ekit-col-12' => 1, |
| 3334 | 'ekit-col-6' => 2, |
| 3335 | 'ekit-col-4' => 3, |
| 3336 | 'ekit-col-3' => 4, |
| 3337 | 'ekit-col-2' => 6, |
| 3338 | ][$column_class] ?? 3; |
| 3339 | } |
| 3340 | |
| 3341 | return $columns; |
| 3342 | } |
| 3343 | } |
| 3344 |