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