'', 'img_size' => '800x600', 'image_type' => 'image', 'image_bg_position' => 'center', 'height' => 300, 'link' => '', 'text_alignment' => 'left', 'vertical_alignment' => 'top', 'horizontal_alignment' => 'left', 'style' => '', 'hover' => 'zoom', 'increase_spaces' => '', 'woodmart_color_scheme' => 'light', 'content_width' => '100', // Button 'btn_text' => '', 'btn_position' => 'hover', 'btn_color' => 'default', 'btn_style' => 'default', 'btn_shape' => 'rectangle', 'btn_size' => 'default', 'hide_btn_tablet' => 'no', 'hide_btn_mobile' => 'no', // Title 'custom_title_color' => '', 'title' => '', 'title_tag' => 'h4', 'title_size' => 'default', 'font_weight' => '', 'title_font' => '', // Subtitle 'subtitle' => '', 'subtitle_color' => 'default', 'custom_subtitle_color' => '', 'custom_subtitle_bg_color' => '', 'subtitle_style' => 'default', 'subtitle_font_weight' => '', 'subtitle_font' => '', // Text 'custom_text_color' => '', 'content_text_size' => 'default', // Old custom sizes 'title_desktop_text_size' => '', 'subtitle_desktop_text_size' => '', 'title_tablet_text_size' => '', 'subtitle_tablet_text_size' => '', 'title_mobile_text_size' => '', 'subtitle_mobile_text_size' => '', // Extra 'woodmart_css_id' => '', 'css_animation' => 'none', 'el_class' => '', ), $atts ) ); if ( ! $woodmart_css_id ) { $woodmart_css_id = uniqid(); } $id = 'wd-' . $woodmart_css_id; $class .= ' banner-' . $style; $class .= ' banner-hover-' . $hover; $class .= ' color-scheme-' . $woodmart_color_scheme; $class .= ' banner-btn-size-' . $btn_size; $class .= ' banner-btn-style-' . $btn_style; $class .= ' wd-display-' . $image_type; $class .= woodmart_get_css_animation( $css_animation ); $banner_image_classes .= ' wd-bg-position-' . $image_bg_position; if ( ! $custom_subtitle_color && ! $custom_subtitle_bg_color ) { $subtitle_class .= ' subtitle-color-' . $subtitle_color; } $subtitle_class .= ' subtitle-style-' . $subtitle_style; $subtitle_class .= ' ' . woodmart_get_new_size_classes( 'banner', $title_size, 'subtitle' ); $title_wrap_class .= woodmart_get_old_classes( ' banner-title-' . $title_size ); $title_class .= ' wd-font-weight-' . $font_weight; if ( $title_font ) { $title_class .= ' font-' . $title_font; } $title_class .= ' ' . woodmart_get_new_size_classes( 'banner', $title_size, 'title' ); $subtitle_class .= ' wd-font-weight-' . $subtitle_font_weight; if ( $subtitle_font ) { $subtitle_class .= ' font-' . $subtitle_font; } $content_banner .= ' text-' . $text_alignment; if ( $style == 'content-background' ) { $btn_position = 'static'; $content_wrap_classes .= ' wd-width-' . $content_width; } else { $content_banner .= ' wd-width-' . $content_width; } $content_wrap_classes .= ' wd-items-' . $vertical_alignment; $content_wrap_classes .= ' wd-justify-' . $horizontal_alignment; $class .= woodmart_get_old_classes( ' banner-vr-align-' . $vertical_alignment ); $class .= woodmart_get_old_classes( ' banner-hr-align-' . $horizontal_alignment ); $inner_class .= ' ' . woodmart_get_new_size_classes( 'banner', $content_text_size, 'content' ); if ( $increase_spaces == 'yes' ) { $class .= ' banner-increased-padding'; } $class .= ' ' . $el_class; if ( strrpos( $link, '|' ) || strrpos( $link, 'rl:' ) ) { $attributes = woodmart_vc_get_link_attr( $link ); } else { $attributes = array( 'target' => '', 'url' => $link, ); } if ( ! empty( $btn_text ) ) { $class .= ' with-btn'; $class .= ' banner-btn-position-' . $btn_position; } if ( isset( $attributes['target'] ) && $attributes['target'] == ' _blank' || $attributes['target'] == '_blank' ) { $onclick = 'window.open(\'' . esc_url( $attributes['url'] ) . '\',\'_blank\')'; } elseif ( isset( $attributes['url'] ) ) { $onclick = 'window.location.href=\'' . esc_url( $attributes['url'] ) . '\''; } if ( $hover == 'parallax' ) { woodmart_enqueue_js_library( 'panr-parallax-bundle' ); woodmart_enqueue_js_script( 'banner-element' ); } if ( $link && $attributes['url'] ) { $class .= ' cursor-pointer'; } // Button $btn_wrapper_classes .= ( $hide_btn_tablet == 'yes' ) ? ' banner-hide-btn-tablet' : ''; $btn_wrapper_classes .= ( $hide_btn_mobile == 'yes' ) ? ' banner-hide-btn-mobile' : ''; // Image settings. $image_url = ''; if ( function_exists( 'wpb_getImageBySize' ) ) { $img = wpb_getImageBySize( array( 'attach_id' => $image, 'thumb_size' => $img_size, 'class' => 'promo-banner-image', ) ); $image_output = $img['thumbnail']; if ( $image ) { $image_url = woodmart_get_image_src( $image, $img_size ); } } elseif ( function_exists( 'woodmart_get_image_url' ) ) { $image_url = woodmart_get_image_url( $image, 'image', array( 'image_size' => $img_size, 'image' => array( 'id' => $image, ), ) ); $image_output = woodmart_get_image_html( // phpcs:ignore array( 'image_size' => $img_size, 'image' => array( 'id' => $image, ), ), 'image' ); } woodmart_enqueue_inline_style( 'banner' ); ob_start(); ?>
>
'; } if ( ! empty( $title ) ) { echo '<' . $title_tag . ' class="banner-title' . esc_attr( $title_class ) . '">' . $title . ''; } ?>
'; echo woodmart_shortcode_button( array( 'title' => $btn_text, 'color' => $btn_color, 'style' => $btn_style, 'size' => $btn_size, 'align' => $text_alignment, 'shape' => $btn_shape, ) ); echo '
'; } ?>
30, 'dragEndSpeed' => 600, 'scroll_carousel_init' => 'no', 'el_class' => '', ) ), $atts ); extract( $parsed_atts ); $custom_sizes = apply_filters( 'woodmart_promo_banner_shortcode_custom_sizes', false ); $class .= ' ' . $el_class; $class .= ' ' . woodmart_owl_items_per_slide( $slides_per_view, array(), false, false, $custom_sizes ); $carousel_id = 'carousel-' . rand( 100, 999 ); $parsed_atts['custom_sizes'] = $custom_sizes; if ( $scroll_carousel_init == 'yes' ) { woodmart_enqueue_js_library( 'waypoints' ); $wrapper_classes .= ' scroll-init'; } if ( woodmart_get_opt( 'disable_owl_mobile_devices' ) ) { $wrapper_classes .= ' disable-owl-mobile'; } $wrapper_classes .= ' wd-carousel-spacing-' . $slider_spacing; woodmart_enqueue_inline_style( 'owl-carousel' ); ob_start(); ?>