Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2022
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.21 KB | None | 0 0
  1.  
  2. add_action( 'ava_after_main_title', 'ava_header_banner_slider_func', 10 );
  3.  
  4. function ava_header_banner_slider_func ()
  5. {
  6.     $output = "";
  7.     $acfheaderimage = get_field( "header_image" );
  8.     $acfheaderslider = get_field( "header_slider" );
  9.  
  10.     if(wp_is_mobile()) return;
  11.  
  12.     if($acfheaderimage) {
  13.         $output = "<div class='testclass'>";
  14.         $output .= "[av_slideshow_full size='no scaling' stretch='' animation='slide' autoplay='false' interval='5' control_layout='av-control-default' src='' attachment='' attachment_size='' position='top left' repeat='no-repeat' attach='scroll' av_uid='av-41ebxqf']
  15. [av_slide_full slide_type='image' id='" . $acfheaderimage . "' video='http://' mobile_image='' video_format='' video_ratio='16:9' title='' custom_title_size='' custom_content_size='' caption_pos='caption_bottom' link_apply='' link='lightbox' link_target='' button_label='Click me' button_color='light' link1='manually,http://' link_target1='' button_label2='Click me' button_color2='light' link2='manually,http://' link_target2='' font_color='' custom_title='' custom_content='' overlay_opacity='0.5' overlay_color='' overlay_pattern='' overlay_custom_pattern='' av_uid='av-3yhbprr'][/av_slide_full][/av_slideshow_full]";
  16.         $output .= "</div>";
  17.     }
  18.        
  19.     if($acfheaderslider) {
  20.         $pattern = '/\[layerslider id=\"\d+\"\]/i';
  21.        
  22.         if(preg_match($pattern, $acfheaderslider)) {
  23.             $output = "[av_section min_height='' min_height_pc='25' min_height_px='500px' padding='small' margin='aviaTBmargin' custom_margin='0px,10px' color='alternate_color' background='bg_color' custom_bg='' background_gradient_color1='' background_gradient_color2='' background_gradient_direction='vertical' src='' attachment='' attachment_size='' attach='scroll' position='top left' repeat='no-repeat' video='' video_ratio='16:9' overlay_opacity='0.5' overlay_color='' overlay_pattern='' overlay_custom_pattern='' shadow='no-border-styling' bottom_border='no-border-styling' bottom_border_diagonal_color='#333333' bottom_border_diagonal_direction='' bottom_border_style='' custom_arrow_bg='' id='fullwidth-slider' custom_class='fullwidth-container' aria_label='' av_element_hidden_in_editor='0' av_uid='av-36lxf2'][av_one_full first min_height='' vertical_alignment='av-align-top' space='' row_boxshadow_color='' row_boxshadow_width='10' margin='0px' margin_sync='true' mobile_breaking='' border='' border_color='' radius='0px' radius_sync='true' padding='0px,0px,0px,0px' column_boxshadow_color='' column_boxshadow_width='10' background='bg_color' background_color='' background_gradient_color1='' background_gradient_color2='' background_gradient_direction='vertical' src='' attachment='' attachment_size='' background_position='top left' background_repeat='no-repeat' highlight_size='1.1' animation='' link='' linktarget='' link_hover='' title_attr='' alt_attr='' mobile_display='' id='' custom_class='' aria_label='' av_uid='av-243ywq'][av_textblock size='' av-medium-font-size='' av-small-font-size='' av-mini-font-size='' font_color='' color='' id='' custom_class='' av_uid='av-k7l5vuhy' admin_preview_bg='']{$acfheaderslider}[/av_textblock][/av_one_full][/av_section]";
  24.         }
  25.     }
  26.  
  27.     echo do_shortcode($output);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement