Created
June 9, 2016 21:07
-
-
Save atwellpub/eb2a7fcf76821c8e783d581079dbd85f to your computer and use it in GitHub Desktop.
Lime App Landing Page 1.0.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Template Name: Lime App | |
* @package WordPress Landing Pages | |
* @author Inbound Template Generator | |
*/ | |
/* Declare Template Key */ | |
$key = basename(dirname(__FILE__)); | |
/* discover the absolute path of where this template is located. Core templates are loacted in /wp-content/plugins/landing-pages/templates/ while custom templates belong in /wp-content/uploads/landing-pages/tempaltes/ */ | |
$path = LANDINGPAGES_UPLOADS_PATH . "$key/"; | |
$urlpath = LANDINGPAGES_UPLOADS_URLPATH . "$key/"; | |
/* Include ACF Field Definitions */ | |
include_once($path .'config.php'); | |
/* Enqueue Styles and Scripts */ | |
function lime_app_enqueue_scripts() { | |
$key = basename(dirname(__FILE__)); | |
$urlpath = LANDINGPAGES_UPLOADS_URLPATH . "$key/"; | |
wp_enqueue_script( 'jquery' ); | |
wp_enqueue_script( 'lime-app-bootstrap-js', $urlpath . 'assets/js/bootstrap.min.js', '','', true ); | |
wp_enqueue_script( 'lime-app-retina-js', $urlpath . 'assets/js/retina-1.1.0.js', '','', true ); | |
wp_enqueue_script( 'lime-app-ie-bug-js', $urlpath . 'assets/js/ie10-viewport-bug-workaround.js', '','', true ); | |
wp_enqueue_style( 'lime-app-bootstrap-css', $urlpath . 'assets/css/bootstrap.css' ); | |
wp_enqueue_style( 'lime-app-css', $urlpath . 'assets/css/style.css' ); | |
} | |
add_action('wp_head', 'lime_app_enqueue_scripts'); | |
/** | |
* Converts a hexadecimal color into hue, saturation, and luminance. | |
* Source: http://www.mfwebservices.com/help-and-resources/php/custom-scripts/function/hexhsl.php | |
* | |
* @param string $HexColor color in hexadecimal value. Can include the '#' sign or not, but must have either 3 digits or 6. Anything between 3 and 6 digits will have an unexpected result. | |
* @return array containing hue, saturation and luminance | |
*/ | |
function HexToHsl( $HexColor ) { | |
$HexColor = str_replace( '#', '', $HexColor ); | |
if( strlen( $HexColor ) < 3 ) str_pad( $HexColor, 3 - strlen( $HexColor ), '0' ); | |
$Add = strlen( $HexColor ) == 6 ? 2 : 1; | |
$AA = 0; | |
$AddOn = $Add == 1 ? ( $AA = 16 - 1 ) + 1 : 1; | |
$Red = round( ( hexdec( substr( $HexColor, 0, $Add ) ) * $AddOn + $AA ) / 255, 6 ); | |
$Green = round( ( hexdec( substr( $HexColor, $Add, $Add ) ) * $AddOn + $AA ) / 255, 6 ); | |
$Blue = round( ( hexdec( substr( $HexColor, ( $Add + $Add ) , $Add ) ) * $AddOn + $AA ) / 255, 6 ); | |
$HSLColor = array( 'Hue' => 0, 'Saturation' => 0, 'Luminance' => 0 ); | |
$Minimum = min( $Red, $Green, $Blue ); | |
$Maximum = max( $Red, $Green, $Blue ); | |
$Chroma = $Maximum - $Minimum; | |
$HSLColor['Luminance'] = ( $Minimum + $Maximum ) / 2; | |
if( $Chroma == 0 ) { | |
$HSLColor['Luminance'] = round( $HSLColor['Luminance'] * 100, 0 ); | |
return $HSLColor; | |
} | |
$Range = $Chroma * 6; | |
$HSLColor['Saturation'] = $HSLColor['Luminance'] <= 0.5 ? $Chroma / ( $HSLColor['Luminance'] * 2 ) : $Chroma / ( 2 - ( $HSLColor['Luminance'] * 2 ) ); | |
if( $Red <= 0.004 || $Green <= 0.004 || $Blue <= 0.004 ) { | |
$HSLColor['Saturation'] = 1; | |
} | |
if( $Maximum == $Red ) { | |
$HSLColor['Hue'] = round( ( $Blue > $Green ? 1 - ( abs( $Green - $Blue ) / $Range ) : ( $Green - $Blue ) / $Range ) * 255, 0 ); | |
} else if( $Maximum == $Green ) { | |
$HSLColor['Hue'] = round( ( $Red > $Blue ? abs( 1 - ( 4 / 3 ) + ( abs ( $Blue - $Red ) / $Range ) ) : ( 1 / 3 ) + ( $Blue - $Red ) / $Range ) * 255, 0 ); | |
} else { | |
$HSLColor['Hue'] = round( ( $Green < $Red ? 1 - 2 / 3 + abs( $Red - $Green ) / $Range : 2 / 3 + ( $Red - $Green ) / $Range ) * 255, 0 ); | |
} | |
$HSLColor['Saturation'] = round( $HSLColor['Saturation'] * 100, 0 ); | |
$HSLColor['Luminance'] = round( $HSLColor['Luminance'] * 100, 0 ); | |
return $HSLColor; | |
} | |
/* Define Landing Pages's custom pre-load hook for 3rd party plugin integration */ | |
do_action('wp_head'); | |
if (have_posts()) : while (have_posts()) : the_post(); | |
$post_id = get_the_ID(); | |
?> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"> | |
<title><?php wp_title(); ?></title> | |
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> | |
<!--[if lt IE 9]> | |
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> | |
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> | |
<![endif]--> | |
<?php | |
$add_navbar = get_field("add_navbar", $post_id); | |
$navbar_color = get_field("navbar_color", $post_id); | |
$logo = get_field("logo", $post_id); | |
$statement_count = 0; | |
$promotion_count = 0; | |
$feature_count = 0; | |
$testimonials_count = 0; | |
$subscribe_count = 0; | |
?> | |
<?php | |
/* Start navitagion_links Repeater Output */ | |
if ( have_rows( "navitagion_links" ) ) { ?> | |
<?php while ( have_rows( "navitagion_links" ) ) : the_row(); | |
$nav_link_color = get_sub_field("nav_link_color"); | |
$nav_anchor_text = get_sub_field("nav_anchor_text"); | |
$nav_url = get_sub_field("nav_url"); | |
?> | |
<?php endwhile; ?> | |
<?php } /* end if have_rows(navitagion_links) */ | |
/* End navitagion_links Repeater Output */ | |
?> | |
<?php | |
$hero_bg_image = get_field("hero_bg_image", $post_id); | |
$hero_title = get_field("hero_title", $post_id); | |
$hero_title_color = get_field("hero_title_color", $post_id); | |
$hero_image = get_field("hero_image", $post_id); | |
/* Start body_sections Flexible Content Area Output */ | |
if(function_exists('have_rows')) : | |
if(have_rows('body_sections')) : | |
while(have_rows('body_sections')) : the_row(); | |
switch(get_sub_field('acf_fc_layout')) : | |
/* start layout statement_section */ | |
case 'statement_section' : | |
$statement_bg_color = get_sub_field("statement_bg_color"); | |
$statement_text = get_sub_field("statement_text"); | |
$statement_text_color = get_sub_field("statement_text_color"); | |
$statement_add_button = get_sub_field("statement_add_button"); | |
$button_text = get_sub_field("button_text"); | |
$button_text_color = get_sub_field("button_text_color"); | |
$button_text_hover_color = get_sub_field("button_text_hover_color"); | |
$button_hover_color = get_sub_field("button_hover_color"); | |
$statement_count += 1; | |
?> | |
<?php break; | |
/* start layout promotion_section */ | |
case 'promotion_section' : | |
$promotion_bg_color = get_sub_field("promotion_bg_color"); | |
$promotion_add_title = get_sub_field("promotion_add_title"); | |
$promotion_title = get_sub_field("promotion_title"); | |
$promotion_title_color = get_sub_field("promotion_title_color"); | |
$promotion_count += 1; | |
$promotion_boxes[$promotion_count] = 0; | |
?> | |
<?php | |
/* Start promotion_box Repeater Output */ | |
if ( have_rows( "promotion_box" ) ) { ?> | |
<?php while ( have_rows( "promotion_box" ) ) : the_row(); | |
$promotion_icon = get_sub_field("promotion_icon"); | |
$promotion_icon_color = get_sub_field("promotion_icon_color"); | |
$promotion_title = get_sub_field("promotion_title"); | |
$promotion_title_color = get_sub_field("promotion_title_color"); | |
$promotion_text = get_sub_field("promotion_text"); | |
$promotion_text_color = get_sub_field("promotion_text_color"); | |
$promotion_boxes[$promotion_count] += 1; | |
?> | |
<?php endwhile; ?> | |
<?php } /* end if have_rows(promotion_box) */ | |
/* End promotion_box Repeater Output */ | |
$promotion_add_image = get_sub_field("promotion_add_image"); | |
$promotion_hero_image = get_sub_field("promotion_hero_image"); | |
$promotion_description = get_sub_field("promotion_description"); | |
$promotion_description_color = get_sub_field("promotion_description_color"); | |
?> | |
<?php break; | |
/* start layout feature_section */ | |
case 'feature_section' : | |
$feature_bg_color = get_sub_field("feature_bg_color"); | |
$feature_media_side = get_sub_field("feature_media_side"); | |
$feature_media_type = get_sub_field("feature_media_type"); | |
$feature_image = get_sub_field("feature_image"); | |
$feature_video = get_sub_field("feature_video"); | |
$feature_video_width = get_sub_field("feature_video_width"); | |
$feature_video_height = get_sub_field("feature_video_height"); | |
$feature_description_text = get_sub_field("feature_description_text"); | |
$feature_description_text_color = get_sub_field("feature_description_text_color"); | |
$feature_add_button = get_sub_field("feature_add_button"); | |
$feature_button_text = get_sub_field("feature_button_text"); | |
$feature_button_text_color = get_sub_field("feature_button_text_color"); | |
$feature_button_text_hover_color = get_sub_field("feature_button_text_hover_color"); | |
$feature_button_hover_color = get_sub_field("feature_button_hover_color"); | |
$feature_button_url = get_sub_field("feature_button_url"); | |
$feature_count += 1; | |
?> | |
<?php break; | |
/* start layout testimonials_section */ | |
case 'testimonials_section' : | |
$testimonials_bg_color = get_sub_field("testimonials_bg_color"); | |
$testimonials_add_title = get_sub_field("testimonials_add_title"); | |
$testimonials_title = get_sub_field("testimonials_title"); | |
$testimonials_title_color = get_sub_field("testimonials_title_color"); | |
$testimonials_count += 1; | |
?> | |
<?php | |
/* Start testimonial Repeater Output */ | |
if ( have_rows( "testimonial" ) ) { ?> | |
<?php while ( have_rows( "testimonial" ) ) : the_row(); | |
$testimonial_image = get_sub_field("testimonial_image"); | |
$testimonial_text = get_sub_field("testimonial_text"); | |
$testimonial_text_color = get_sub_field("testimonial_text_color"); | |
$testimonial_name = get_sub_field("testimonial_name"); | |
$testimonial_name_color = get_sub_field("testimonial_name_color"); | |
?> | |
<?php endwhile; ?> | |
<?php } /* end if have_rows(testimonial) */ | |
/* End testimonial Repeater Output */ | |
?> | |
<?php break; | |
/* start layout subscription_section */ | |
case 'subscription_section' : | |
$subscription_bg_color = get_sub_field("subscription_bg_color"); | |
$subscribe_title = get_sub_field("subscribe_title"); | |
$subscribe_title_color = get_sub_field("subscribe_title_color"); | |
$subscribe_subtitle = get_sub_field("subscribe_subtitle"); | |
$subscribe_subtitle_color = get_sub_field("subscribe_subtitle_color"); | |
$form_shortcode = get_sub_field("form_shortcode"); | |
$form_fields_bg_color = get_sub_field("form_fields_bg_color"); | |
$form_submit_button_color = get_sub_field("form_submit_button_color"); | |
$form_button_text_color = get_sub_field("form_button_text_color"); | |
$form_labels_color = get_sub_field("form_labels_color"); | |
$subscribe_count += 1; | |
/** | |
* calculating colors and adding dynamic variations | |
*/ | |
$hsl = HexToHsl($form_submit_button_color); | |
if ( $hsl['Luminance'] > 50 ) { | |
$luminance = $hsl['Luminance'] - 30; | |
} else { | |
$luminance = $hsl['Luminance'] + 30; | |
} | |
$placeholder_hsl = HexToHsl($form_fields_bg_color); | |
if ( $placeholder_hsl['Luminance'] > 50 ) { | |
$placeholder_luminance = $placeholder_hsl['Luminance'] - 40; | |
} else { | |
$placeholder_luminance = $placeholder_hsl['Luminance'] + 40; | |
} | |
?> | |
<style> | |
.subscribe-<?php echo $subscribe_count ?> #inbound-form-wrapper button { | |
border-radius: 0px !important; | |
color: <?php echo $form_button_text_color; ?> !important; | |
background: <?php echo $form_submit_button_color; ?> none repeat scroll 0 0 !important; | |
border: 2px solid transparent !important; | |
padding: 10px 16px; | |
font-size: 18px; | |
line-height: 1.33; | |
margin-bottom: 0; | |
text-align: center; | |
vertical-align: middle; | |
white-space: nowrap; | |
cursor: pointer; | |
width: 100%; | |
} | |
.subscribe-<?php echo $subscribe_count ?> #inbound-form-wrapper button:hover { | |
background-color: hsl(<?php echo $hsl['Hue'] ?>, <?php echo $hsl['Saturation'] . '%' ?>, <?php echo $luminance . '%' ?>) !important; | |
color: <?php echo $form_submit_button_color; ?> !important; | |
} | |
.subscribe-<?php echo $subscribe_count ?> #inbound-form-wrapper label, | |
.subscribe-<?php echo $subscribe_count ?> #inbound-form-wrapper .radio-inbound-label-top, | |
.subscribe-<?php echo $subscribe_count ?> #inbound-form-wrapper .label-inbound-label-top { | |
color: <?php echo $form_labels_color; ?>; | |
text-align: left; | |
} | |
.subscribe-<?php echo $subscribe_count ?> #inbound-form-wrapper input, | |
.subscribe-<?php echo $subscribe_count ?> #inbound-form-wrapper textarea, | |
.subscribe-<?php echo $subscribe_count ?> #inbound-form-wrapper select { | |
font-size: 18px; | |
min-height: 40px; | |
line-height: 20px; | |
padding: 11px 10px 12px; | |
border: none; | |
margin-bottom: 10px; | |
background-color: <?php echo $form_fields_bg_color; ?>; | |
-webkit-transition: background-color 0.2s; | |
transition: background-color 0.2s; | |
text-align: left; | |
margin-right: 2px; | |
color: hsl(<?php echo $placeholder_hsl['Hue'] ?>, <?php echo $placeholder_hsl['Saturation'] . '%' ?>, <?php echo $placeholder_luminance . '%' ?>); | |
} | |
.subscribe-<?php echo $subscribe_count ?> #inbound-form-wrapper input, | |
.subscribe-<?php echo $subscribe_count ?> #inbound-form-wrapper textarea { | |
border-radius: 0px; | |
} | |
.subscribe-<?php echo $subscribe_count ?> #inbound-form-wrapper select { | |
border-top-left-radius: 0px; | |
border-bottom-left-radius: 0px; | |
} | |
.subscribe-<?php echo $subscribe_count ?> #inbound-form-wrapper textarea:placeholder { | |
color: hsl(<?php echo $placeholder_hsl['Hue'] ?>, <?php echo $placeholder_hsl['Saturation'] . '%' ?>, <?php echo $placeholder_luminance . '%' ?>) !important; | |
} | |
.subscribe-<?php echo $subscribe_count ?> #inbound-form-wrapper input:not(.checkbox-inbound-vertical) { | |
width: 100%; | |
} | |
</style> | |
<?php break; | |
endswitch; /* end switch statement */ | |
endwhile; /* end while statement */ | |
endif; /* end have_rows */ | |
endif; /* end function_exists */ | |
/* End body_sections Flexible Content Area Output */ | |
$footer_bg_color = get_field("footer_bg_color", $post_id); | |
$copyright_line = get_field("copyright_line", $post_id); | |
$copyright_line_color = get_field("copyright_line_color", $post_id); | |
?> | |
</head> | |
<body> | |
<?php | |
$add_navbar = get_field("add_navbar", $post_id); | |
$navbar_color = get_field("navbar_color", $post_id); | |
$logo = get_field("logo", $post_id); | |
$statement_count = 0; | |
$promotion_count = 0; | |
$feature_count = 0; | |
$testimonials_count = 0; | |
$subscribe_count = 0; | |
if ( $add_navbar ) { | |
?> | |
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation" style="background-color:<?php echo $navbar_color ?>"> | |
<div class="container"> | |
<div class="navbar-header"> | |
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> | |
<span class="sr-only">Toggle navigation</span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
</button> | |
<a class="navbar-brand" href="#"> | |
<?php if ( ! $logo ) { ?> | |
<img src="<?php echo $urlpath . 'assets/img/logo-wide-3.png'; ?>" class="img-responsive alignleft" style="width:300px; padding-bottom: 5px;" alt=""> | |
<?php } else { ?> | |
<img src="<?php echo $logo ?>" class="img-responsive alignleft" style="max-width:300px; padding-bottom: 5px;" alt=""> | |
<?php } ?> | |
</a> | |
</div> | |
<?php | |
/* Start navitagion_links Repeater Output */ | |
if ( have_rows( "navitagion_links" ) ) { ?> | |
<div class="collapse navbar-collapse"> | |
<ul class="nav navbar-nav navbar-right"> | |
<?php while ( have_rows( "navitagion_links" ) ) : the_row(); | |
$nav_link_color = get_sub_field("nav_link_color"); | |
$nav_anchor_text = get_sub_field("nav_anchor_text"); | |
$nav_url = get_sub_field("nav_url"); | |
?> | |
<li><a href="<?php echo $nav_url ?>" style="color:<?php echo $nav_link_color ?>"><?php echo $nav_anchor_text ?></a></li> | |
<?php endwhile; ?> | |
</ul> | |
</div><!--/.nav-collapse --> | |
<?php } /* end if have_rows(navitagion_links) */ | |
/* End navitagion_links Repeater Output */ | |
?> | |
</div> | |
</div> | |
<?php } /* end if ( $add_navbar ) */ ?> | |
<?php | |
$hero_bg_image = get_field("hero_bg_image", $post_id); | |
$hero_title = get_field("hero_title", $post_id); | |
$hero_title_color = get_field("hero_title_color", $post_id); | |
$hero_image = get_field("hero_image", $post_id); | |
if ( ! $hero_bg_image ) { | |
?> | |
<div id="h" style="background: rgba(0, 0, 0, 0) url('<?php echo $urlpath . 'assets/img/header-bg.jpg'; ?>') no-repeat scroll center center / cover ;"> | |
<?php | |
} else { | |
?> | |
<div id="h" style="background: rgba(0, 0, 0, 0) url('<?php echo $hero_bg_image; ?>') no-repeat scroll center center / cover ;"> | |
<?php | |
} ?> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-6 col-md-offset-3"> | |
<h1 style="color:<?php echo $hero_title_color ?>"><?php echo $hero_title ?></h1> | |
<hr class="aligncenter" style="border-color : <?php echo $hero_title_color ?>;"> | |
<?php if ( ! $hero_image ) { ?> | |
<img src="<?php echo $urlpath . 'assets/img/app-front.png'; ?>" class="img-responsive aligncenter" height="600" alt=""> | |
<?php } else { ?> | |
<img src="<?php echo $hero_image ?>" class="img-responsive aligncenter" style="max-width:100%; max-height:6000px;" alt=""> | |
<?php } ?> | |
</div> | |
</div> | |
</div><!-- /.container --> | |
</div><!--/H --> | |
<?php | |
/* Start body_sections Flexible Content Area Output */ | |
if(function_exists('have_rows')) : | |
if(have_rows('body_sections')) : | |
while(have_rows('body_sections')) : the_row(); | |
switch(get_sub_field('acf_fc_layout')) : | |
/* start layout statement_section */ | |
case 'statement_section' : | |
$statement_bg_color = get_sub_field("statement_bg_color"); | |
$statement_text = get_sub_field("statement_text"); | |
$statement_text_color = get_sub_field("statement_text_color"); | |
$statement_add_button = get_sub_field("statement_add_button"); | |
$button_text = get_sub_field("button_text"); | |
$button_text_color = get_sub_field("button_text_color"); | |
$button_text_hover_color = get_sub_field("button_text_hover_color"); | |
$button_hover_color = get_sub_field("button_hover_color"); | |
$button_url = get_sub_field("button_url"); | |
$statement_count += 1; | |
?> | |
<div id="statement-<?php echo $statement_count ?>" style="background-color:<?php echo $statement_bg_color ?>"> | |
<div class="container"> | |
<div class="row mtb"> | |
<div class="col-lg-8 col-lg-offset-2 centered"> | |
<p style="color:<?php echo $statement_text_color ?>"><?php echo $statement_text ?></p> | |
<?php | |
if ($statement_add_button) { | |
?> | |
<p class="mt"> | |
<a href="<?php echo $button_url; ?>" class="btn btn-lg btn-transparent" style="color:<?php echo $button_text_color; ?>; border: 2px solid <?php echo $button_text_color; ?>;" | |
onmouseover="this.style.color = '<?php echo $button_text_hover_color ?>'; | |
this.style.border = '2px solid <?php echo $button_hover_color ?>'; | |
this.style.background = '<?php echo $button_hover_color ?>';" | |
onmouseout="this.style.color = '<?php echo $button_text_color ?>'; | |
this.style.border = '2px solid <?php echo $button_text_color ?>'; | |
this.style.background = 'transparent';"> | |
<?php echo $button_text; ?> | |
</a> | |
</p> | |
<?php | |
} | |
?> | |
</div> | |
</div><!--/row --> | |
<hr> | |
</div><!--/container --> | |
</div> | |
<?php break; | |
/* start layout promotion_section */ | |
case 'promotion_section' : | |
$promotion_bg_color = get_sub_field("promotion_bg_color"); | |
$promotion_add_title = get_sub_field("promotion_add_title"); | |
$promotion_title = get_sub_field("promotion_title"); | |
$promotion_title_color = get_sub_field("promotion_title_color"); | |
$promotion_count += 1; | |
$promotion_blocks = 0; | |
if ( 1 == $promotion_boxes[$promotion_count] ) { | |
$offset = ' col-md-offset-4'; | |
} else if ( 2 == $promotion_boxes[$promotion_count] ) { | |
$offset = ' col-md-offset-2'; | |
} else { | |
$offset = ''; | |
} | |
?> | |
<div id="promotion-<?php echo $promotion_count ?>" style="background-color:<?php echo $promotion_bg_color ?>"> | |
<div class="container"> | |
<div class="row mtb centered"> | |
<?php if ( $promotion_add_title ) { ?> | |
<h2 class="theme mb" style="color:<?php echo $promotion_title_color ?>"><?php echo $promotion_title ?></h2> | |
<?php } ?> | |
<?php | |
/* Start promotion_box Repeater Output */ | |
if ( have_rows( "promotion_box" ) ) { ?> | |
<?php while ( have_rows( "promotion_box" ) ) : the_row(); | |
$promotion_icon = get_sub_field("promotion_icon"); | |
$promotion_icon_color = get_sub_field("promotion_icon_color"); | |
$promotion_title = get_sub_field("promotion_title"); | |
$promotion_title_color = get_sub_field("promotion_title_color"); | |
$promotion_text = get_sub_field("promotion_text"); | |
$promotion_text_color = get_sub_field("promotion_text_color"); | |
?> | |
<div class="col-md-4<?php echo $offset ?>"> | |
<p><i class="fa theme x2 <?php echo $promotion_icon ?>" style="color:<?php echo $promotion_icon_color ?>"></i></p> | |
<h4 style="color:<?php echo $promotion_title_color ?>"><?php echo $promotion_title ?></h4> | |
<p class="ts" style="color:<?php echo $promotion_text_color ?>"><?php echo $promotion_text ?></p> | |
</div><!--/col-md-4 --> | |
<?php $offset = '' ?> | |
<?php endwhile; ?> | |
</div><!--/row --> | |
<?php } /* end if have_rows(promotion_box) */ | |
/* End promotion_box Repeater Output */ | |
$promotion_add_image = get_sub_field("promotion_add_image"); | |
$promotion_hero_image = get_sub_field("promotion_hero_image"); | |
$promotion_description = get_sub_field("promotion_description"); | |
$promotion_description_color = get_sub_field("promotion_description_color"); | |
if ( $promotion_add_image || $promotion_description ) { | |
?> | |
<div class="row mtb"> | |
<div class="col-lg-10 col-lg-offset-1"> | |
<?php if ( $promotion_add_image ) { ?> | |
<?php if ( ! $promotion_hero_image ) { ?> | |
<img src="<?php echo $urlpath . 'assets/img/panoramic.jpg'; ?>" class="img-responsive aligncenter" alt=""> | |
<?php } else { ?> | |
<img src="<?php echo $promotion_hero_image ?>" class="img-responsive aligncenter" style="max-width:100%;" alt=""> | |
<?php } ?> | |
<?php } ?> | |
<p class="mtb centered" style="color:<?php echo $promotion_description_color ?>"><?php echo $promotion_description ?></p> | |
</div> | |
</div><!--/row --> | |
<?php } ?> | |
</div><!--/container --> | |
</div><!--/promotion --> | |
<?php break; | |
/* start layout feature_section */ | |
case 'feature_section' : | |
$feature_bg_color = get_sub_field("feature_bg_color"); | |
$feature_media_side = get_sub_field("feature_media_side"); | |
$feature_media_type = get_sub_field("feature_media_type"); | |
$feature_image = get_sub_field("feature_image"); | |
$feature_video = get_sub_field("feature_video"); | |
$feature_video_width = get_sub_field("feature_video_width"); | |
$feature_video_height = get_sub_field("feature_video_height"); | |
$feature_description_text = get_sub_field("feature_description_text"); | |
$feature_description_text_color = get_sub_field("feature_description_text_color"); | |
$feature_add_button = get_sub_field("feature_add_button"); | |
$feature_button_text = get_sub_field("feature_button_text"); | |
$feature_button_text_color = get_sub_field("feature_button_text_color"); | |
$feature_button_text_hover_color = get_sub_field("feature_button_text_hover_color"); | |
$feature_button_hover_color = get_sub_field("feature_button_hover_color"); | |
$feature_button_url = get_sub_field("feature_button_url"); | |
$feature_count += 1; | |
?> | |
<div id="info-<?php echo $feature_count ?>" class="info" style="background-color:<?php echo $feature_bg_color ?>"> | |
<div class="container"> | |
<div class="row "> | |
<?php if ( 'Left' == $feature_media_side ) { ?> | |
<div class="fs col-md-6"> | |
<?php | |
if ( 'Image' == $feature_media_type) { | |
if ( ! $feature_image ) { | |
echo '<img class="img-responsive aligncenter" width="320" alt="" src="' . $urlpath . 'assets/img/double.png">'; | |
} else { | |
echo '<img class="img-responsive aligncenter" style="max-width: 100%; max-height:100%;" alt="" src="'. $feature_image .'">'; | |
} | |
} else { | |
echo $feature_video; | |
} ?> | |
</div> | |
<?php } ?> | |
<div class="col-md-6"> | |
<p style="color:<?php echo $feature_description_text_color ?>"><?php echo $feature_description_text ?></p> | |
<p class="mt"> | |
<a href="<?php echo $feature_button_url ?>" class="btn btn-conf" style="color:<?php echo $feature_button_text_color; ?>; border: 2px solid <?php echo $feature_button_text_color; ?>;" | |
onmouseover = "this.style.color = '<?php echo $feature_button_text_hover_color ?>'; | |
this.style.border = '2px solid <?php echo $feature_button_hover_color ?>'; | |
this.style.background = '<?php echo $feature_button_hover_color ?>';" | |
onmouseout = "this.style.color = '<?php echo $feature_button_text_color ?>'; | |
this.style.border = '2px solid <?php echo $feature_button_text_color ?>'; | |
this.style.background = 'transparent';"> | |
<?php echo $feature_button_text; ?> | |
</a> | |
</p> | |
</div> | |
<?php if ( 'Right' == $feature_media_side ) { ?> | |
<div class="fs col-md-6"> | |
<?php | |
if ( 'Image' == $feature_media_type) { | |
if ( ! $feature_image ) { | |
echo '<img class="img-responsive aligncenter" width="320" alt="" src="' . $urlpath . 'assets/img/double.png">'; | |
} else { | |
echo '<img class="img-responsive aligncenter" style="max-width: 100%; max-height:100%;" alt="" src="'. $feature_image .'">'; | |
} | |
} else { | |
echo $feature_video; | |
} ?> | |
</div> | |
<?php } ?> | |
</div><!--/row --> | |
</div><!--/container--> | |
</div> | |
<script type="text/javascript"> | |
jQuery(document).ready(function() { | |
jQuery('.fs').find('iframe').attr('height', '<?php echo $feature_video_height; ?>px'); | |
jQuery('.fs').find('iframe').attr('width', '<?php echo $feature_video_width; ?>px'); | |
}); | |
</script> | |
<?php break; | |
/* start layout testimonials_section */ | |
case 'testimonials_section' : | |
$testimonials_bg_color = get_sub_field("testimonials_bg_color"); | |
$testimonials_add_title = get_sub_field("testimonials_add_title"); | |
$testimonials_title = get_sub_field("testimonials_title"); | |
$testimonials_title_color = get_sub_field("testimonials_title_color"); | |
$testimonials_count += 1; | |
$active = ' active'; | |
?> | |
<div id="testimonials-<?php echo $testimonials_count ?>" style="background-color:<?php echo $testimonials_bg_color ?>"> | |
<div class="container"> | |
<div class="row mt"> | |
<div class="col-lg-8 col-lg-offset-2 testimonials"> | |
<?php if ( $testimonials_add_title ) { ?> | |
<h2 class="theme" style="color:<?php echo $testimonials_title_color ?>"><?php echo $testimonials_title ?></h2> | |
<?php } ?> | |
<!-- Carousel | |
================================================== --> | |
<div id="myCarousel" class="carousel slide" data-ride="carousel"> | |
<div class="carousel-inner"> | |
<?php | |
/* Start testimonial Repeater Output */ | |
if ( have_rows( "testimonial" ) ) { ?> | |
<?php while ( have_rows( "testimonial" ) ) : the_row(); | |
$testimonial_image = get_sub_field("testimonial_image"); | |
$testimonial_text = get_sub_field("testimonial_text"); | |
$testimonial_text_color = get_sub_field("testimonial_text_color"); | |
$testimonial_name = get_sub_field("testimonial_name"); | |
$testimonial_name_color = get_sub_field("testimonial_name_color"); | |
?> | |
<div class="item<?php echo $active ?>"> | |
<?php if ( ! $testimonial_image ) { ?> | |
<img src="<?php echo $urlpath . 'assets/img/ui-01.jpg'; ?>" class="img-circle aligncenter" style="width:80px;" alt=""> | |
<?php } else { ?> | |
<img src="<?php echo $testimonial_image ?>" class="img-circle aligncenter" style="width:80px;" alt=""> | |
<?php } ?> | |
<h3 style="color:<?php echo $testimonial_name_color ?>"><?php echo $testimonial_name ?></h3> | |
<p class="ts" style="color:<?php echo $testimonial_text_color ?>"><?php echo $testimonial_text ?></p> | |
</div> | |
<?php $active = ''; ?> | |
<?php endwhile; ?> | |
<?php } /* end if have_rows(testimonial) */ | |
/* End testimonial Repeater Output */ | |
?> | |
</div> | |
</div><!-- /.carousel --> | |
</div><!--/col-lg-8--> | |
</div><!--/row --> | |
</div><!--/container --> | |
</div><!--/testimonials --> | |
<?php break; | |
/* start layout subscription_section */ | |
case 'subscription_section' : | |
$subscribe_bg_color = get_sub_field("subscription_bg_color"); | |
$subscribe_title = get_sub_field("subscribe_title"); | |
$subscribe_title_color = get_sub_field("subscribe_title_color"); | |
$subscribe_subtitle = get_sub_field("subscribe_subtitle"); | |
$subscribe_subtitle_color = get_sub_field("subscribe_subtitle_color"); | |
$form_shortcode = get_sub_field("form_shortcode"); | |
$form_fields_bg_color = get_sub_field("form_fields_bg_color"); | |
$form_submit_button_color = get_sub_field("form_submit_button_color"); | |
$form_button_text_color = get_sub_field("form_button_text_color"); | |
$form_labels_color = get_sub_field("form_labels_color"); | |
$subscribe_count += 1; | |
?> | |
<div id="f-<?php echo $subscribe_count; ?>" class="f subscribe-<?php echo $subscribe_count; ?>" style="background-color:<?php echo $subscribe_bg_color ?>"> | |
<div class="container"> | |
<div class="row mtb centered"> | |
<h2 style="color:<?php echo $subscribe_title_color ?>"><?php echo $subscribe_title ?></h2> | |
<p style="color:<?php echo $subscribe_subtitle_color ?>"><?php echo $subscribe_subtitle ?></p> | |
<div class="col-lg-6 col-lg-offset-3 mt"> | |
<?php echo $form_shortcode; ?> | |
</div> | |
</div><!--/row --> | |
</div><!--/container--> | |
</div><!--/Footer --> | |
<?php break; | |
endswitch; /* end switch statement */ | |
endwhile; /* end while statement */ | |
endif; /* end have_rows */ | |
endif; /* end function_exists */ | |
/* End body_sections Flexible Content Area Output */ | |
$footer_bg_color = get_field("footer_bg_color", $post_id); | |
$copyright_line = get_field("copyright_line", $post_id); | |
$copyright_line_color = get_field("copyright_line_color", $post_id); | |
?> | |
<div id="copyright" style="background-color:<?php echo $footer_bg_color ?>"> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-6 col-md-offset-3 centered"> | |
<h6 style="color:<?php echo $copyright_line_color ?>"><?php echo $copyright_line ?></h6> | |
</div> | |
</div> | |
</div> | |
</div><!--/copyright --> | |
<?php | |
do_action('lp_footer'); | |
do_action('wp_footer'); | |
?> | |
</body> | |
</html> | |
<?php | |
endwhile; endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment