Instantly share code, notes, and snippets.

Embed
What would you like to do?
ACF Extras Page Builder - Views files
<section class="mpu mpu-3 <?php if ($mpu_3_box_css):echo $mpu_3_box_css; endif;?>">
<div class="container">
<div class="row <?php if (!empty($mpu_3_collapse)): echo 'no-gutters'; endif; ?>">
<?php if($mpu_3_title): echo '<h3 class="mpu-title">' . $mpu_3_title . '</h3>'; endif; ?>
<div class="col-md-4 mpu-flex box1">
<div class="mpu-item-wrap">
<?php if ($mpu_3_box_1_title):echo '<h3>' . $mpu_3_box_1_title . '</h3>'; endif;?>
<div class="mpu-item-content-wrap">
<?php $image_att = wp_get_attachment_image_src( $mpu_3_box_1_image, $mpu_3_size ); ?>
<?php if ($mpu_3_box_1_image): echo '<div style="background-image: url( '. $image_att[0] . ')" class="mpu-header-image"></div>'; endif; ?>
<div class="mpu-item-text-btn-wrap">
<?php if( $mpu_3_box_1_text ): echo $mpu_3_box_1_text; endif; ?>
<?php if( $mpu_3_box_1_button ){
echo '<a href="' . $mpu_3_box_1_button['url'] . '" class="btn btn-color2">' . $mpu_3_box_1_button['text'] . '</a>';
}
?>
</div>
</div>
</div>
</div>
<div class="col-md-4 mpu-flex box2">
<div class="mpu-item-wrap">
<?php if ($mpu_3_box_2_title):echo '<h3>' . $mpu_3_box_2_title . '</h3>'; endif;?>
<div class="mpu-item-content-wrap">
<?php $image_att = wp_get_attachment_image_src( $mpu_3_box_2_image, $mpu_3_size ); ?>
<?php if ($mpu_3_box_2_image): echo '<div style="background-image: url( '. $image_att[0] . ')" class="mpu-header-image"></div>'; endif; ?>
<div class="mpu-item-text-btn-wrap">
<?php if( $mpu_3_box_2_text ): echo $mpu_3_box_2_text; endif; ?>
<?php if( $mpu_3_box_2_button ){
echo '<a href="' . $mpu_3_box_2_button['url'] . '" class="btn btn-color2">' . $mpu_3_box_2_button['text'] . '</a>';
}
?>
</div>
</div>
</div>
</div>
<div class="col-md-4 mpu-flex box3">
<div class="mpu-item-wrap">
<?php if ($mpu_3_box_3_title):echo '<h3>' . $mpu_3_box_3_title . '</h3>'; endif;?>
<div class="mpu-item-content-wrap">
<?php $image_att = wp_get_attachment_image_src( $mpu_3_box_3_image, $mpu_3_size ); ?>
<?php if ($mpu_3_box_3_image): echo '<div style="background-image: url( '. $image_att[0] . ')" class="mpu-header-image"></div>'; endif; ?>
<div class="mpu-item-text-btn-wrap">
<?php if( $mpu_3_box_3_text ): echo $mpu_3_box_3_text; endif; ?>
<?php if( $mpu_3_box_3_button ){
echo '<a href="' . $mpu_3_box_3_button['url'] . '" class="btn btn-color2">' . $mpu_3_box_3_button['text'] . '</a>';
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="mpu mpu-4 <?php if ($mpu_4_box_css):echo $mpu_4_box_css; endif;?>">
<div class="container">
<div class="row <?php if (!empty($mpu_4_collapse)): echo 'no-gutters'; endif; ?>">
<?php if($mpu_4_title): echo '<h3 class="mpu-title">' . $mpu_4_title . '</h3>'; endif; ?>
<div class="col-md-3 col-sm-6 mpu-flex box1">
<div class="mpu-item-wrap">
<?php if ($mpu_4_box_1_title):echo '<h3>' . $mpu_4_box_1_title . '</h3>'; endif;?>
<div class="mpu-item-content-wrap">
<?php $image_att = wp_get_attachment_image_src( $mpu_4_box_1_image, $mpu_4_size ); ?>
<?php if ($mpu_4_box_1_image): echo '<div style="background-image: url( '. $image_att[0] . ')" class="mpu-header-image"></div>'; endif; ?>
<div class="mpu-item-text-btn-wrap">
<?php if( $mpu_4_box_1_text ): echo $mpu_4_box_1_text; endif; ?>
<?php if( $mpu_4_box_1_button ){
echo '<a href="' . $mpu_4_box_1_button['url'] . '" class="btn">' . $mpu_4_box_1_button['text'] . '</a>';
}
?>
</div>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 mpu-flex box2">
<div class="mpu-item-wrap">
<?php if ($mpu_4_box_2_title):echo '<h3>' . $mpu_4_box_2_title . '</h3>'; endif;?>
<div class="mpu-item-content-wrap">
<?php $image_att = wp_get_attachment_image_src( $mpu_4_box_2_image, $mpu_4_size ); ?>
<?php if ($mpu_4_box_2_image): echo '<div style="background-image: url( '. $image_att[0] . ')" class="mpu-header-image"></div>'; endif; ?>
<div class="mpu-item-text-btn-wrap">
<?php if( $mpu_4_box_2_text ): echo $mpu_4_box_2_text; endif; ?>
<?php if( $mpu_4_box_2_button ){
echo '<a href="' . $mpu_4_box_2_button['url'] . '" class="btn">' . $mpu_4_box_2_button['text'] . '</a>';
}
?>
</div>
</div>
</div>
</div>
<!-- Add the extra clearfix for only the small devices so content splits cleanly into two rows -->
<div class="clearfix visible-sm-block"></div>
<div class="col-md-3 col-sm-6 mpu-flex box3">
<div class="mpu-item-wrap">
<?php if ($mpu_4_box_3_title):echo '<h3>' . $mpu_4_box_3_title . '</h3>'; endif;?>
<div class="mpu-item-content-wrap">
<?php $image_att = wp_get_attachment_image_src( $mpu_4_box_3_image, $mpu_4_size ); ?>
<?php if ($mpu_4_box_3_image): echo '<div style="background-image: url( '. $image_att[0] . ')" class="mpu-header-image"></div>'; endif; ?>
<div class="mpu-item-text-btn-wrap">
<?php if( $mpu_4_box_3_text ): echo $mpu_4_box_3_text; endif; ?>
<?php if( $mpu_4_box_3_button ){
echo '<a href="' . $mpu_4_box_3_button['url'] . '" class="btn">' . $mpu_4_box_3_button['text'] . '</a>';
}
?>
</div>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 mpu-flex box4">
<div class="mpu-item-wrap">
<?php if ($mpu_4_box_4_title):echo '<h3>' . $mpu_4_box_4_title . '</h3>'; endif;?>
<div class="mpu-item-content-wrap">
<?php $image_att = wp_get_attachment_image_src( $mpu_4_box_4_image, $mpu_4_size ); ?>
<?php if ($mpu_4_box_4_image): echo '<div style="background-image: url( '. $image_att[0] . ')" class="mpu-header-image"></div>'; endif; ?>
<div class="mpu-item-text-btn-wrap">
<?php if( $mpu_4_box_4_text ): echo $mpu_4_box_4_text; endif; ?>
<?php if( $mpu_4_box_4_button ){
echo '<a href="' . $mpu_4_box_4_button['url'] . '" class="btn">' . $mpu_4_box_4_button['text'] . '</a>';
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<?php
$wysi_flex_wrap_css = get_sub_field('flex_wysi_wrap_css_class');
$count = count( get_sub_field( 'flexbox_wysi_repeater' ) );
?>
<section class="flexbox-wysi-row clearfix <?php if($wysi_flex_wrap_css): echo $wysi_flex_wrap_css; endif;?>">
<?php
echo'<div class="container"><div class="row"><div class="col-md-12 wysi-flex-wrap box-count-' . $count . '">';
if ( have_rows( 'flexbox_wysi_repeater' ) ) :
while ( have_rows( 'flexbox_wysi_repeater' ) ) : the_row();
// Variables - need to be listed inside 'while have rows'
$wysi_flex_content = get_sub_field('flexbox_wysi_content');
$wysi_flex_bg = get_sub_field('flexbox_wysi_bg');
$wysi_flex_css = get_sub_field('flexbox_wysi_css_class');
?>
<div class="wysi-flex-box <?php if($wysi_flex_css): echo $wysi_flex_css; endif;?> <?php if($wysi_flex_bg): echo $wysi_flex_bg; endif;?>">
<div class="flex-pad">
<?php if($wysi_flex_content): echo $wysi_flex_content; endif; ?>
</div>
</div>
<?php
endwhile;
endif;
echo '</div></div></div>';
echo '</section>';
<section class="hero-image" style="background-image: url(<?php echo $hero_size; ?>);">
<div class="dark-overlay">
<div class="container clearfix">
<div class="hero-image-caption fadeInUp caption-<?php echo $caption_position;?>">
<?php if($hero_title): echo '<h2 class="title-' . $hero_title_size . '">' . $hero_title . '</h2>'; endif; ?>
<div class="hero-text-wrap">
<?php if ($hero_caption):echo $hero_caption; endif;
if( $hero_display_button ) { ?>
<a href="<?php echo $hero_button['url'] ?>" <?php if($hero_lightbox):echo 'data-featherlight="iframe" data-featherlight-iframe-width="853" data-featherlight-iframe-height="480"'; endif;?> class="btn"><?php echo $hero_button['text'];?></a>
</div>
<?php } ?>
</div>
</div>
</div>
</section>
<?php
echo '<section class="hero-slider-row">';
echo '<div class="container">';
echo '<div class="slick-slider clearfix">';
if ( have_rows( 'slides' ) ) :
while ( have_rows( 'slides' ) ) : the_row();
// Repeater Variables - need to be listed inside 'while have rows'
$slides = get_sub_field('slides');
$hero_slider_image = get_sub_field('hero_slider_image');
$hero_slider_image_url = $hero_slider_image['sizes']['hero-slide']; // Use custom image size
$hero_slider_caption = get_sub_field('hero_slider_caption');
$hero_slider_button = get_sub_field('hero_slider_button');
$hero_slider_caption_position = get_sub_field('hero_slider_caption_position');
$hero_slider_lightbox = get_sub_field('hero_slider_lightbox');
echo '<div class="hero-slide">';
// printf( '<img src="%s" />', $hero_slider_image_url );
printf( '<img data-lazy="%s" />', $hero_slider_image_url );
if ($hero_slider_caption){
?>
<div class="hero-slider-caption hero-caption-<?php echo $hero_slider_caption_position;?>">
<?php
echo $hero_slider_caption;
if($hero_slider_button){
?>
<a href="<?php echo $hero_slider_button["url"];?>" <?php if($hero_slider_lightbox):echo 'data-featherlight="iframe" data-featherlight-iframe-width="853" data-featherlight-iframe-height="480"'; endif;?>class="btn"><?php echo $hero_slider_button['text'];?></a>
<?php }
?>
</div>
<?php }
?>
</div>
<?php
endwhile;
endif;
echo '</div>';
echo '</div>';
echo '</section>';
<section class="image-text <?php if ($i_t_class):echo $i_t_class; endif;?>">
<div class="container">
<div class="row no-gutters">
<div class="col-md-<?php echo $i_t_left_size;?> r-l-image"><?php echo wp_get_attachment_image( $i_t_left_image, 'full' ); ?></div>
<div class="col-md-<?php echo $i_t_right_size;?>"><div class="right-text-wrap"><?php echo $i_t_right_text; ?></div></div>
</div>
</div>
</section>
<?php
echo '<section class="logo-row clearfix">';
echo'<div class="container"><div class="row">';
echo '<h3>' . $logo_title . '</h3>';
echo '<div class="col-md-12">';
if ( have_rows( 'acf_home_logo_images' ) ) :
while ( have_rows( 'acf_home_logo_images' ) ) : the_row();
// Variables - need to be listed inside 'while have rows'
$logo = get_sub_field('acf_home_logo_image');
$logo_url = $logo['sizes']['medium'];
echo '<img src="' . $logo_url . '" class="home-logo-image">';
endwhile;
endif;
echo '</div>';
echo '</div>';
echo '</div>';
echo '</section>';
<section class="promo-bar <?php if ($promo_bar_css_class):echo $promo_bar_css_class; endif;?>" style="background-color: <?php echo $promo_bg_color; ?>; color:<?php echo $promo_text_color; ?>">
<div class="container">
<div class="promo-bar-wrap clearfix">
<div class="promo-content">
<?php if ($promo_title):echo '<h2 style="color:' . $promo_text_color . '">' . $promo_title . '</h2>'; endif;
if ($promo_text):echo $promo_text; endif;
?>
</div>
<div class="promo-button-wrap">
<?php
if ($promo_button): echo '<a href="' . $promo_button['url'] . '" class="btn" style="background-color:' . $promo_text_color . '; color:' . $promo_bg_color . '; border:double ' . $promo_bg_color . '">' . $promo_button['text'] . '</a>'; endif;
?>
</div>
</div>
</div>
</section>
<section class="strapline-bar">
<div class="container">
<div class="row no-gutters">
<div class="strapline-bar-wrap <?php if($strap_quotes): echo 'fancy-quotes'; endif;?> clearfix">
<?php if($strapline): echo '<h3>' . $strapline . '</h3>'; endif;?>
</div>
</div>
</div>
</section>
<?php
echo '<section class="testimonial-row clearfix">';
echo'<div class="container"><div class="row">';
echo '<h3>' . $testimonial_title . '</h3>';
echo '<div class="col-md-1 col-md-offset-1 test-quot-mark-left hidden-sm hidden-xs">&ldquo;</div>';
echo '<div class="col-md-8">';
echo '<div class="testimonial-slider clearfix">';
if ( have_rows( 'quotes' ) ) :
while ( have_rows( 'quotes' ) ) : the_row();
// Variables - need to be listed inside 'while have rows'
$show_slider = get_sub_field('show_hero_slider');
$quotes = get_sub_field('quotes');
$test_quote = get_sub_field('acf_flexible_layout_testimonial_quote');
$test_quote_source = get_sub_field('acf_flexible_layout_testimonial_source');
echo '<div class="testimonial-slide">';
if($test_quote):echo $test_quote; endif;
if($test_quote_source): echo '<div class="testimonial-source">&mdash; ' . $test_quote_source . '</div>'; endif;
echo '</div>';
endwhile;
endif;
echo '</div>';
echo '</div>';
echo '<div class="col-md-1 test-quot-mark-right hidden-sm hidden-xs">&rdquo;</div>';
echo '</div></div>';
echo '</section>';
<section class="text-image <?php if ($t_i_class):echo $t_i_class; endif;?>">
<div class="container">
<div class="row no-gutters">
<div class="col-md-<?php echo $t_i_left_size;?>"><div class="left-text-wrap"><?php echo $t_i_left_text; ?></div></div>
<div class="col-md-<?php echo $t_i_right_size;?> r-l-image"><?php echo wp_get_attachment_image( $t_i_right_image, 'full' ); ?>
</div>
</div>
</div>
</section>
<section class="home-builder-widget-1">
<div class="container">
<div class="row no-gutters">
<?php dynamic_sidebar( 'home-builder-1' ); ?>
</div>
</div>
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment