theme-elements
6 months ago
accordion.php
6 months ago
audio.php
6 months ago
before-after.php
6 months ago
button.php
6 months ago
carousel-navigation.php
6 months ago
circle-chart.php
6 months ago
contact-box.php
6 months ago
contact-form.php
6 months ago
custom-list.php
6 months ago
divider.php
6 months ago
gallery.php
6 months ago
gmap.php
1 week ago
heading-modern.php
5 months ago
icon.php
6 months ago
image.php
6 months ago
mailchimp.php
6 months ago
modern-button.php
6 months ago
products-grid.php
6 months ago
quote.php
6 months ago
recent-comments.php
6 months ago
recent-posts-grid-carousel.php
2 months ago
recent-posts-land-style.php
6 months ago
recent-posts-masonry.php
6 months ago
recent-posts-tiles-carousel.php
6 months ago
recent-posts-tiles.php
6 months ago
recent-posts-timeline.php
6 months ago
recent-products.php
6 months ago
responsive-table.php
6 months ago
search.php
6 months ago
staff.php
6 months ago
svg.php
6 months ago
tabs.php
6 months ago
testimonial.php
6 months ago
text.php
6 months ago
touch-slider.php
6 months ago
video.php
6 months ago
recent-posts-tiles-carousel.php
757 lines
| 1 | <?php |
| 2 | namespace Auxin\Plugin\CoreElements\Elementor\Elements; |
| 3 | |
| 4 | use Elementor\Plugin; |
| 5 | use Elementor\Widget_Base; |
| 6 | use Elementor\Controls_Manager; |
| 7 | use Elementor\Group_Control_Typography; |
| 8 | use Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 9 | |
| 10 | |
| 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 12 | exit; // Exit if accessed directly. |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * Elementor 'RecentPostsTilesCarousel' widget. |
| 17 | * |
| 18 | * Elementor widget that displays an 'RecentPostsTilesCarousel' with lightbox. |
| 19 | * |
| 20 | * @since 1.0.0 |
| 21 | */ |
| 22 | class RecentPostsTilesCarousel extends Widget_Base { |
| 23 | |
| 24 | /** |
| 25 | * Get widget name. |
| 26 | * |
| 27 | * Retrieve 'RecentPostsTilesCarousel' widget name. |
| 28 | * |
| 29 | * @since 1.0.0 |
| 30 | * @access public |
| 31 | * |
| 32 | * @return string Widget name. |
| 33 | */ |
| 34 | public function get_name() { |
| 35 | return 'aux_recent_posts_tiles_carousel'; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Get widget title. |
| 40 | * |
| 41 | * Retrieve 'RecentPostsTilesCarousel' widget title. |
| 42 | * |
| 43 | * @since 1.0.0 |
| 44 | * @access public |
| 45 | * |
| 46 | * @return string Widget title. |
| 47 | */ |
| 48 | public function get_title() { |
| 49 | return __('Tiles Carousel Posts', 'auxin-elements' ); |
| 50 | } |
| 51 | |
| 52 | public function has_widget_inner_wrapper(): bool { |
| 53 | return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); |
| 54 | } |
| 55 | |
| 56 | |
| 57 | /** |
| 58 | * Get widget icon. |
| 59 | * |
| 60 | * Retrieve 'RecentPostsTilesCarousel' widget icon. |
| 61 | * |
| 62 | * @since 1.0.0 |
| 63 | * @access public |
| 64 | * |
| 65 | * @return string Widget icon. |
| 66 | */ |
| 67 | public function get_icon() { |
| 68 | return 'eicon-posts-carousel auxin-badge'; |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Get widget categories. |
| 73 | * |
| 74 | * Retrieve 'RecentPostsTilesCarousel' widget icon. |
| 75 | * |
| 76 | * @since 1.0.0 |
| 77 | * @access public |
| 78 | * |
| 79 | * @return string Widget icon. |
| 80 | */ |
| 81 | public function get_categories() { |
| 82 | return array( 'auxin-dynamic' ); |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Retrieve the terms in a given taxonomy or list of taxonomies. |
| 87 | * |
| 88 | * Retrieve 'RecentPostsTilesCarousel' widget icon. |
| 89 | * |
| 90 | * @since 1.0.0 |
| 91 | * @access public |
| 92 | * |
| 93 | * @return string Widget icon. |
| 94 | */ |
| 95 | public function get_terms() { |
| 96 | $terms = get_terms([ |
| 97 | 'taxonomy' => 'category', |
| 98 | 'orderby' => 'count', |
| 99 | 'hide_empty' => false, |
| 100 | ]); |
| 101 | |
| 102 | $list = array( ' ' => __('All Categories', 'auxin-elements' ) ) ; |
| 103 | foreach ( $terms as $key => $value ) { |
| 104 | $list[$value->term_id] = $value->name; |
| 105 | } |
| 106 | |
| 107 | return $list; |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * Register 'RecentPostsTilesCarousel' widget controls. |
| 112 | * |
| 113 | * Adds different input fields to allow the user to change and customize the widget settings. |
| 114 | * |
| 115 | * @since 1.0.0 |
| 116 | * @access protected |
| 117 | */ |
| 118 | protected function register_controls() { |
| 119 | |
| 120 | /*-----------------------------------------------------------------------------------*/ |
| 121 | /* layout_section |
| 122 | /*-----------------------------------------------------------------------------------*/ |
| 123 | |
| 124 | $this->start_controls_section( |
| 125 | 'layout_section', |
| 126 | array( |
| 127 | 'label' => __('Layout', 'auxin-elements' ), |
| 128 | 'tab' => Controls_Manager::TAB_LAYOUT |
| 129 | ) |
| 130 | ); |
| 131 | |
| 132 | $this->add_control( |
| 133 | 'tile_style_pattern', |
| 134 | array( |
| 135 | 'label' => __('Post Tile styles','auxin-elements' ), |
| 136 | 'type' => 'aux-visual-select', |
| 137 | 'default' => 'default', |
| 138 | 'options' => array( |
| 139 | 'default' => array( |
| 140 | 'label' => __( 'Default', 'auxin-elements' ), |
| 141 | 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-5.svg' |
| 142 | ), |
| 143 | 'pattern-1' => array( |
| 144 | 'label' => __( 'Pattern 1', 'auxin-elements' ), |
| 145 | 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-3.svg' |
| 146 | ), |
| 147 | 'pattern-2' => array( |
| 148 | 'label' => __( 'Pattern 2', 'auxin-elements' ), |
| 149 | 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-6.svg' |
| 150 | ), |
| 151 | 'pattern-3' => array( |
| 152 | 'label' => __( 'Pattern 3', 'auxin-elements' ), |
| 153 | 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-7.svg' |
| 154 | ), |
| 155 | 'pattern-4' => array( |
| 156 | 'label' => __( 'Pattern 4', 'auxin-elements' ), |
| 157 | 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-8.svg' |
| 158 | ), |
| 159 | 'pattern-5' => array( |
| 160 | 'label' => __( 'Pattern 5', 'auxin-elements' ), |
| 161 | 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-4.svg' |
| 162 | ), |
| 163 | 'pattern-6' => array( |
| 164 | 'label' => __('Pattern 6', 'auxin-elements' ), |
| 165 | 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-1.svg' |
| 166 | ), |
| 167 | 'pattern-7' => array( |
| 168 | 'label' => __('Pattern 7', 'auxin-elements' ), |
| 169 | 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-2.svg' |
| 170 | ) |
| 171 | ) |
| 172 | ) |
| 173 | ); |
| 174 | |
| 175 | $this->add_control( |
| 176 | 'tile_style', |
| 177 | array( |
| 178 | 'label' => __('Post tile style','auxin-elements' ), |
| 179 | 'type' => 'aux-visual-select', |
| 180 | 'default' => '', |
| 181 | 'options' => array( |
| 182 | '' => array( |
| 183 | 'label' => __('Standard', 'auxin-elements' ), |
| 184 | 'image' => AUXIN_URL . 'images/visual-select/button-normal.svg' |
| 185 | ), |
| 186 | 'aux-overlay' => array( |
| 187 | 'label' => __('Dark', 'auxin-elements' ), |
| 188 | 'image' => AUXIN_URL . 'images/visual-select/button-curved.svg' |
| 189 | ) |
| 190 | ) |
| 191 | ) |
| 192 | ); |
| 193 | |
| 194 | $this->end_controls_section(); |
| 195 | |
| 196 | /*-----------------------------------------------------------------------------------*/ |
| 197 | /* carousel_section |
| 198 | /*-----------------------------------------------------------------------------------*/ |
| 199 | |
| 200 | $this->start_controls_section( |
| 201 | 'carousel_section', |
| 202 | array( |
| 203 | 'label' => __('Carousel', 'auxin-elements' ), |
| 204 | 'tab' => Controls_Manager::TAB_LAYOUT |
| 205 | ) |
| 206 | ); |
| 207 | |
| 208 | $this->add_control( |
| 209 | 'carousel_navigation_control', |
| 210 | array( |
| 211 | 'label' => __('Navigation control', 'auxin-elements'), |
| 212 | 'type' => Controls_Manager::SELECT, |
| 213 | 'default' => 'bullets', |
| 214 | 'options' => array( |
| 215 | '' => __('None', 'auxin-elements'), |
| 216 | 'arrows' => __('Arrows', 'auxin-elements'), |
| 217 | 'bullets' => __('Bullets', 'auxin-elements') |
| 218 | ) |
| 219 | ) |
| 220 | ); |
| 221 | |
| 222 | $this->add_control( |
| 223 | 'button_style', |
| 224 | array( |
| 225 | 'label' => __('Button Navigation Style','auxin-elements' ), |
| 226 | 'type' => 'aux-visual-select', |
| 227 | 'default' => 'pattern-1', |
| 228 | 'options' => array( |
| 229 | 'pattern-1' => array( |
| 230 | 'label' => __('Pattern 1', 'auxin-elements' ), |
| 231 | 'image' => AUXIN_URL . 'images/visual-select/button-normal.svg' |
| 232 | ), |
| 233 | 'pattern-2' => array( |
| 234 | 'label' => __('Pattern 2', 'auxin-elements' ), |
| 235 | 'image' => AUXIN_URL . 'images/visual-select/button-curved.svg' |
| 236 | ) |
| 237 | ), |
| 238 | 'condition' => array( |
| 239 | 'carousel_navigation_control' => array( 'arrows' ), |
| 240 | ) |
| 241 | ) |
| 242 | ); |
| 243 | |
| 244 | $this->add_control( |
| 245 | 'carousel_navigation', |
| 246 | array( |
| 247 | 'label' => __('Navigation type', 'auxin-elements'), |
| 248 | 'type' => Controls_Manager::SELECT, |
| 249 | 'default' => 'peritem', |
| 250 | 'options' => array( |
| 251 | 'peritem' => __('Move per column', 'auxin-elements'), |
| 252 | 'perpage' => __('Move per page', 'auxin-elements'), |
| 253 | 'scroll' => __('Smooth scroll', 'auxin-elements') |
| 254 | ) |
| 255 | ) |
| 256 | ); |
| 257 | |
| 258 | $this->add_control( |
| 259 | 'carousel_loop', |
| 260 | array( |
| 261 | 'label' => __('Loop navigation','auxin-elements' ), |
| 262 | 'type' => Controls_Manager::SWITCHER, |
| 263 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 264 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 265 | 'return_value' => 'yes', |
| 266 | 'default' => 'yes' |
| 267 | ) |
| 268 | ); |
| 269 | |
| 270 | $this->add_control( |
| 271 | 'carousel_autoplay', |
| 272 | array( |
| 273 | 'label' => __('Autoplay carousel','auxin-elements' ), |
| 274 | 'type' => Controls_Manager::SWITCHER, |
| 275 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 276 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 277 | 'return_value' => 'yes', |
| 278 | 'default' => 'no' |
| 279 | ) |
| 280 | ); |
| 281 | |
| 282 | $this->add_control( |
| 283 | 'carousel_autoplay_delay', |
| 284 | array( |
| 285 | 'label' => __( 'Autoplay delay', 'auxin-elements' ), |
| 286 | 'description' => __('Specifies the delay between auto-forwarding in seconds.', 'auxin-elements' ), |
| 287 | 'type' => Controls_Manager::NUMBER, |
| 288 | 'default' => '2' |
| 289 | ) |
| 290 | ); |
| 291 | |
| 292 | $this->end_controls_section(); |
| 293 | |
| 294 | /*-----------------------------------------------------------------------------------*/ |
| 295 | /* display_section |
| 296 | /*-----------------------------------------------------------------------------------*/ |
| 297 | |
| 298 | $this->start_controls_section( |
| 299 | 'display_section', |
| 300 | array( |
| 301 | 'label' => __('Display', 'auxin-elements' ), |
| 302 | 'tab' => Controls_Manager::TAB_LAYOUT |
| 303 | ) |
| 304 | ); |
| 305 | |
| 306 | $this->add_control( |
| 307 | 'display_title', |
| 308 | array( |
| 309 | 'label' => __('Display post title', 'auxin-elements' ), |
| 310 | 'type' => Controls_Manager::SWITCHER, |
| 311 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 312 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 313 | 'return_value' => 'yes', |
| 314 | 'default' => 'yes' |
| 315 | ) |
| 316 | ); |
| 317 | |
| 318 | $this->add_control( |
| 319 | 'show_info', |
| 320 | array( |
| 321 | 'label' => __('Display post info','auxin-elements' ), |
| 322 | 'type' => Controls_Manager::SWITCHER, |
| 323 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 324 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 325 | 'return_value' => 'yes', |
| 326 | 'default' => 'yes' |
| 327 | ) |
| 328 | ); |
| 329 | |
| 330 | $this->end_controls_section(); |
| 331 | |
| 332 | /*-----------------------------------------------------------------------------------*/ |
| 333 | /* query_section |
| 334 | /*-----------------------------------------------------------------------------------*/ |
| 335 | |
| 336 | $this->start_controls_section( |
| 337 | 'query_section', |
| 338 | array( |
| 339 | 'label' => __('Query', 'auxin-elements' ), |
| 340 | ) |
| 341 | ); |
| 342 | |
| 343 | $this->add_control( |
| 344 | 'cat', |
| 345 | array( |
| 346 | 'label' => __('Categories', 'auxin-elements'), |
| 347 | 'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ), |
| 348 | 'type' => Controls_Manager::SELECT2, |
| 349 | 'multiple' => true, |
| 350 | 'options' => $this->get_terms(), |
| 351 | 'default' => array( ' ' ), |
| 352 | ) |
| 353 | ); |
| 354 | |
| 355 | $this->add_control( |
| 356 | 'num', |
| 357 | array( |
| 358 | 'label' => __('Number of posts to show', 'auxin-elements'), |
| 359 | 'label_block' => true, |
| 360 | 'type' => Controls_Manager::NUMBER, |
| 361 | 'default' => '8', |
| 362 | 'min' => 1, |
| 363 | 'step' => 1 |
| 364 | ) |
| 365 | ); |
| 366 | |
| 367 | $this->add_control( |
| 368 | 'exclude_without_media', |
| 369 | array( |
| 370 | 'label' => __('Exclude posts without media','auxin-elements' ), |
| 371 | 'type' => Controls_Manager::SWITCHER, |
| 372 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 373 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 374 | 'return_value' => 'yes', |
| 375 | 'default' => 'no' |
| 376 | ) |
| 377 | ); |
| 378 | |
| 379 | $this->add_control( |
| 380 | 'exclude_custom_post_formats', |
| 381 | array( |
| 382 | 'label' => __('Exclude custom post formats','auxin-elements' ), |
| 383 | 'type' => Controls_Manager::SWITCHER, |
| 384 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 385 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 386 | 'return_value' => 'yes', |
| 387 | 'default' => 'no', |
| 388 | ) |
| 389 | ); |
| 390 | |
| 391 | $this->add_control( |
| 392 | 'exclude_quote_link', |
| 393 | array( |
| 394 | 'label' => __('Exclude quote and link post formats','auxin-elements' ), |
| 395 | 'type' => Controls_Manager::SWITCHER, |
| 396 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 397 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 398 | 'return_value' => 'yes', |
| 399 | 'default' => 'no', |
| 400 | 'condition' => array( |
| 401 | 'exclude_custom_post_formats' => 'yes', |
| 402 | ) |
| 403 | ) |
| 404 | ); |
| 405 | |
| 406 | $this->add_control( |
| 407 | 'order_by', |
| 408 | array( |
| 409 | 'label' => __('Order by', 'auxin-elements'), |
| 410 | 'type' => Controls_Manager::SELECT, |
| 411 | 'default' => 'date', |
| 412 | 'options' => array( |
| 413 | 'date' => __('Date', 'auxin-elements'), |
| 414 | 'menu_order date' => __('Menu Order', 'auxin-elements'), |
| 415 | 'title' => __('Title', 'auxin-elements'), |
| 416 | 'ID' => __('ID', 'auxin-elements'), |
| 417 | 'rand' => __('Random', 'auxin-elements'), |
| 418 | 'comment_count' => __('Comments', 'auxin-elements'), |
| 419 | 'modified' => __('Date Modified', 'auxin-elements'), |
| 420 | 'author' => __('Author', 'auxin-elements'), |
| 421 | 'post__in' => __('Inserted Post IDs', 'auxin-elements') |
| 422 | ), |
| 423 | ) |
| 424 | ); |
| 425 | |
| 426 | $this->add_control( |
| 427 | 'order', |
| 428 | array( |
| 429 | 'label' => __('Order', 'auxin-elements'), |
| 430 | 'type' => Controls_Manager::SELECT, |
| 431 | 'default' => 'DESC', |
| 432 | 'options' => array( |
| 433 | 'DESC' => __('Descending', 'auxin-elements'), |
| 434 | 'ASC' => __('Ascending', 'auxin-elements'), |
| 435 | ), |
| 436 | ) |
| 437 | ); |
| 438 | |
| 439 | $this->add_control( |
| 440 | 'only_posts__in', |
| 441 | array( |
| 442 | 'label' => __('Only posts','auxin-elements' ), |
| 443 | 'description' => __('If you intend to display ONLY specific posts, you should specify the posts here. You have to insert the post IDs that are separated by comma (eg. 53,34,87,25).', 'auxin-elements' ), |
| 444 | 'type' => Controls_Manager::TEXT |
| 445 | ) |
| 446 | ); |
| 447 | |
| 448 | $this->add_control( |
| 449 | 'include', |
| 450 | array( |
| 451 | 'label' => __('Include posts','auxin-elements' ), |
| 452 | 'description' => __('If you intend to include additional posts, you should specify the posts here. You have to insert the Post IDs that are separated by comma (eg. 53,34,87,25)', 'auxin-elements' ), |
| 453 | 'type' => Controls_Manager::TEXT |
| 454 | ) |
| 455 | ); |
| 456 | |
| 457 | $this->add_control( |
| 458 | 'exclude', |
| 459 | array( |
| 460 | 'label' => __('Exclude posts','auxin-elements' ), |
| 461 | 'description' => __('If you intend to exclude specific posts from result, you should specify the posts here. You have to insert the Post IDs that are separated by comma (eg. 53,34,87,25)', 'auxin-elements' ), |
| 462 | 'type' => Controls_Manager::TEXT |
| 463 | ) |
| 464 | ); |
| 465 | |
| 466 | $this->add_control( |
| 467 | 'offset', |
| 468 | array( |
| 469 | 'label' => __('Start offset','auxin-elements' ), |
| 470 | 'description' => __('Number of post to displace or pass over.', 'auxin-elements' ), |
| 471 | 'type' => Controls_Manager::NUMBER |
| 472 | ) |
| 473 | ); |
| 474 | |
| 475 | $this->end_controls_section(); |
| 476 | |
| 477 | |
| 478 | /*-----------------------------------------------------------------------------------*/ |
| 479 | /* title_style_section |
| 480 | /*-----------------------------------------------------------------------------------*/ |
| 481 | |
| 482 | $this->start_controls_section( |
| 483 | 'title_style_section', |
| 484 | array( |
| 485 | 'label' => __( 'Title', 'auxin-elements' ), |
| 486 | 'tab' => Controls_Manager::TAB_STYLE, |
| 487 | 'condition' => array( |
| 488 | 'display_title' => 'yes', |
| 489 | ), |
| 490 | ) |
| 491 | ); |
| 492 | |
| 493 | $this->start_controls_tabs( 'title_colors' ); |
| 494 | |
| 495 | $this->start_controls_tab( |
| 496 | 'title_color_normal', |
| 497 | array( |
| 498 | 'label' => __( 'Normal' , 'auxin-elements' ), |
| 499 | 'condition' => array( |
| 500 | 'display_title' => 'yes', |
| 501 | ), |
| 502 | ) |
| 503 | ); |
| 504 | |
| 505 | $this->add_control( |
| 506 | 'title_color', |
| 507 | array( |
| 508 | 'label' => __( 'Color', 'auxin-elements' ), |
| 509 | 'type' => Controls_Manager::COLOR, |
| 510 | 'selectors' => array( |
| 511 | '{{WRAPPER}} .entry-title a' => 'color: {{VALUE}};', |
| 512 | ), |
| 513 | 'condition' => array( |
| 514 | 'display_title' => 'yes', |
| 515 | ), |
| 516 | ) |
| 517 | ); |
| 518 | |
| 519 | $this->end_controls_tab(); |
| 520 | |
| 521 | $this->start_controls_tab( |
| 522 | 'title_color_hover', |
| 523 | array( |
| 524 | 'label' => __( 'Hover' , 'auxin-elements' ), |
| 525 | 'condition' => array( |
| 526 | 'display_title' => 'yes', |
| 527 | ), |
| 528 | ) |
| 529 | ); |
| 530 | |
| 531 | $this->add_control( |
| 532 | 'title_hover_color', |
| 533 | array( |
| 534 | 'label' => __( 'Color', 'auxin-elements' ), |
| 535 | 'type' => Controls_Manager::COLOR, |
| 536 | 'selectors' => array( |
| 537 | '{{WRAPPER}} .entry-title a:hover' => 'color: {{VALUE}};', |
| 538 | ), |
| 539 | 'condition' => array( |
| 540 | 'display_title' => 'yes', |
| 541 | ), |
| 542 | ) |
| 543 | ); |
| 544 | |
| 545 | $this->end_controls_tab(); |
| 546 | |
| 547 | $this->end_controls_tabs(); |
| 548 | |
| 549 | $this->add_group_control( |
| 550 | Group_Control_Typography::get_type(), |
| 551 | array( |
| 552 | 'name' => 'title_typography', |
| 553 | 'global' => [ |
| 554 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 555 | ], |
| 556 | 'selector' => '{{WRAPPER}} .entry-title', |
| 557 | 'condition' => array( |
| 558 | 'display_title' => 'yes', |
| 559 | ), |
| 560 | ) |
| 561 | ); |
| 562 | |
| 563 | $this->add_responsive_control( |
| 564 | 'title_margin_bottom', |
| 565 | array( |
| 566 | 'label' => __( 'Bottom space', 'auxin-elements' ), |
| 567 | 'type' => Controls_Manager::SLIDER, |
| 568 | 'range' => array( |
| 569 | 'px' => array( |
| 570 | 'max' => 100, |
| 571 | ), |
| 572 | ), |
| 573 | 'selectors' => array( |
| 574 | '{{WRAPPER}} .entry-title' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 575 | ), |
| 576 | 'condition' => array( |
| 577 | 'display_title' => 'yes', |
| 578 | ), |
| 579 | ) |
| 580 | ); |
| 581 | |
| 582 | $this->end_controls_section(); |
| 583 | |
| 584 | /*-----------------------------------------------------------------------------------*/ |
| 585 | /* info_style_section |
| 586 | /*-----------------------------------------------------------------------------------*/ |
| 587 | |
| 588 | $this->start_controls_section( |
| 589 | 'info_style_section', |
| 590 | array( |
| 591 | 'label' => __( 'Post Info', 'auxin-elements' ), |
| 592 | 'tab' => Controls_Manager::TAB_STYLE, |
| 593 | 'condition' => array( |
| 594 | 'show_info' => 'yes', |
| 595 | ), |
| 596 | ) |
| 597 | ); |
| 598 | |
| 599 | $this->start_controls_tabs( 'info_colors' ); |
| 600 | |
| 601 | $this->start_controls_tab( |
| 602 | 'info_color_normal', |
| 603 | array( |
| 604 | 'label' => __( 'Normal' , 'auxin-elements' ), |
| 605 | 'condition' => array( |
| 606 | 'show_info' => 'yes', |
| 607 | ), |
| 608 | ) |
| 609 | ); |
| 610 | |
| 611 | $this->add_control( |
| 612 | 'info_color', |
| 613 | array( |
| 614 | 'label' => __( 'Color', 'auxin-elements' ), |
| 615 | 'type' => Controls_Manager::COLOR, |
| 616 | 'selectors' => array( |
| 617 | '{{WRAPPER}} .entry-info a, {{WRAPPER}} .entry-info' => 'color: {{VALUE}};', |
| 618 | ), |
| 619 | 'condition' => array( |
| 620 | 'show_info' => 'yes', |
| 621 | ), |
| 622 | ) |
| 623 | ); |
| 624 | |
| 625 | $this->end_controls_tab(); |
| 626 | |
| 627 | $this->start_controls_tab( |
| 628 | 'info_color_hover', |
| 629 | array( |
| 630 | 'label' => __( 'Hover' , 'auxin-elements' ), |
| 631 | 'condition' => array( |
| 632 | 'show_info' => 'yes', |
| 633 | ), |
| 634 | ) |
| 635 | ); |
| 636 | |
| 637 | $this->add_control( |
| 638 | 'info_hover_color', |
| 639 | array( |
| 640 | 'label' => __( 'Color', 'auxin-elements' ), |
| 641 | 'type' => Controls_Manager::COLOR, |
| 642 | 'selectors' => array( |
| 643 | '{{WRAPPER}} .entry-info a:hover' => 'color: {{VALUE}};', |
| 644 | ), |
| 645 | 'condition' => array( |
| 646 | 'show_info' => 'yes', |
| 647 | ), |
| 648 | ) |
| 649 | ); |
| 650 | |
| 651 | $this->end_controls_tab(); |
| 652 | |
| 653 | $this->end_controls_tabs(); |
| 654 | |
| 655 | $this->add_group_control( |
| 656 | Group_Control_Typography::get_type(), |
| 657 | array( |
| 658 | 'name' => 'info_typography', |
| 659 | 'global' => [ |
| 660 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 661 | ], |
| 662 | 'selector' => '{{WRAPPER}} .entry-info, {{WRAPPER}} .entry-info a', |
| 663 | 'condition' => array( |
| 664 | 'show_info' => 'yes', |
| 665 | ), |
| 666 | ) |
| 667 | ); |
| 668 | |
| 669 | $this->add_responsive_control( |
| 670 | 'info_margin_bottom', |
| 671 | array( |
| 672 | 'label' => __( 'Bottom space', 'auxin-elements' ), |
| 673 | 'type' => Controls_Manager::SLIDER, |
| 674 | 'range' => array( |
| 675 | 'px' => array( |
| 676 | 'max' => 100 |
| 677 | ) |
| 678 | ), |
| 679 | 'selectors' => array( |
| 680 | '{{WRAPPER}} .entry-info' => 'margin-bottom: {{SIZE}}{{UNIT}};' |
| 681 | ), |
| 682 | 'condition' => array( |
| 683 | 'show_info' => 'yes' |
| 684 | ) |
| 685 | ) |
| 686 | ); |
| 687 | |
| 688 | $this->add_responsive_control( |
| 689 | 'info_spacing_between', |
| 690 | array( |
| 691 | 'label' => __( 'Space between metas', 'auxin-elements' ), |
| 692 | 'type' => Controls_Manager::SLIDER, |
| 693 | 'range' => array( |
| 694 | 'px' => array( |
| 695 | 'max' => 30 |
| 696 | ) |
| 697 | ), |
| 698 | 'selectors' => array( |
| 699 | '{{WRAPPER}} .entry-info [class^="entry-"] + [class^="entry-"]:before, {{WRAPPER}} .entry-info .entry-tax a:after' => |
| 700 | 'margin-right: {{SIZE}}{{UNIT}}; margin-left: {{SIZE}}{{UNIT}};' |
| 701 | ), |
| 702 | 'condition' => array( |
| 703 | 'show_info' => 'yes' |
| 704 | ) |
| 705 | ) |
| 706 | ); |
| 707 | |
| 708 | $this->end_controls_section(); |
| 709 | } |
| 710 | |
| 711 | /** |
| 712 | * Render image box widget output on the frontend. |
| 713 | * |
| 714 | * Written in PHP and used to generate the final HTML. |
| 715 | * |
| 716 | * @since 1.0.0 |
| 717 | * @access protected |
| 718 | */ |
| 719 | protected function render() { |
| 720 | |
| 721 | $settings = $this->get_settings_for_display(); |
| 722 | |
| 723 | $args = array( |
| 724 | // Display Section |
| 725 | 'display_title' => $settings['display_title'], |
| 726 | 'show_info' => $settings['show_info'], |
| 727 | |
| 728 | // Layout section |
| 729 | 'tile_style_pattern' => $settings['tile_style_pattern'], |
| 730 | 'tile_style' => $settings['tile_style'], |
| 731 | 'carousel_navigation' => $settings['carousel_navigation'], |
| 732 | 'button_style' => $settings['button_style'], |
| 733 | 'carousel_navigation_control' => $settings['carousel_navigation_control'], |
| 734 | 'carousel_loop' => $settings['carousel_loop'], |
| 735 | 'carousel_autoplay' => $settings['carousel_autoplay'], |
| 736 | 'carousel_autoplay_delay' => $settings['carousel_autoplay_delay'], |
| 737 | |
| 738 | // Query Section |
| 739 | 'cat' => $settings['cat'], |
| 740 | 'num' => $settings['num'], |
| 741 | 'exclude_without_media' => $settings['exclude_without_media'], |
| 742 | 'exclude_custom_post_formats' => $settings['exclude_custom_post_formats'], |
| 743 | 'exclude_quote_link' => $settings['exclude_quote_link'], |
| 744 | 'order_by' => $settings['order_by'], |
| 745 | 'order' => $settings['order'], |
| 746 | 'only_posts__in' => $settings['only_posts__in'], |
| 747 | 'include' => $settings['include'], |
| 748 | 'exclude' => $settings['exclude'], |
| 749 | 'offset' => $settings['offset'] |
| 750 | ); |
| 751 | |
| 752 | // get the shortcode base blog page |
| 753 | echo auxin_widget_recent_posts_tiles_carousel_callback( $args ); |
| 754 | } |
| 755 | |
| 756 | } |
| 757 |