Skip to content

Instantly share code, notes, and snippets.

@atwellpub
Created April 14, 2016 22:15
Show Gist options
  • Save atwellpub/afde038a241fb69f9102bc9575087847 to your computer and use it in GitHub Desktop.
Save atwellpub/afde038a241fb69f9102bc9575087847 to your computer and use it in GitHub Desktop.
<?php
/**
* Template Name: DSC-LP Template
*
* @package WordPress Landing Pages
* @author CCB Creative
* @link http://www.ccbcreative.com
* @version 1.1
*/
/* 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(LANDINGPAGES_UPLOADS_PATH.$key.'/config.php');
/* Define Landing Pages's custom pre-load hook for 3rd party plugin integration */
do_action('lp_init');
/* Load Regular WordPress $post data and start the loop */
if (have_posts()) : while (have_posts()) : the_post();
/* load ACF Input values */
$mainheading = get_field( 'main_heading', $post->ID , false );
$maincontent = get_field( 'maincontent', $post->ID , false );
$mainimage = get_field( 'main_image', $post->ID , false );
$conversionarea = get_field( 'conversionarea', $post->ID , false );
$footerheadinga = get_field( 'footer_subheading_a',$post->ID , false );
$footerimagea = get_field( 'footer_image_a',$post->ID , false );
$footertexta = get_field( 'footer_text_a',$post->ID , false );
$footerheadingb = get_field( 'footer_subheading_b',$post->ID , false );
$footerimageb = get_field( 'footer_image_b',$post->ID , false );
$footertextb = get_field( 'footer_text_b',$post->ID , false );
$footerheadingc = get_field( 'footer_subheading_c',$post->ID , false );
$footerimagec = get_field( 'footer_image_c',$post->ID , false );
$footertextc = get_field( 'footer_text_c',$post->ID , false );
$footerlinka = get_field( 'footer_link_a',$post->ID , false );
$footerlinkb = get_field( 'footer_link_b',$post->ID , false );
$footerlinkc = get_field( 'footer_link_c',$post->ID , false );
?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<?php if (is_search()) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>
<title><?php wp_title(''); ?></title>
<link rel="shortcut icon" href="<?php bloginfo('template_url'); ?>/favicon.ico">
<!-- Included CSS Files -->
<link rel="stylesheet" href="<?php echo $path; ?>assets/css/style.css">
<!-- Included JS Files -->
<script src="<?php echo $path; ?>assets/js/modernizr.js"></script>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
<?php
/* Load Normal WordPress wp_head() function */
wp_head();
/* Load Landing Pages's custom pre-load hook for 3rd party plugin integration */
do_action('lp_head');
?>
</head>
<body <?php body_class(); ?>>
<div id="wrap">
<div id="top-wrap">
<div class="top-menu clearfix">
<div class="banner clearfix">
<!-- Logo -->
<div class="logo">
<a href="<?php echo get_option('home'); ?>/"><img src="<?php bloginfo('template_url'); ?>/images/logo.png" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('name'); ?>" border="0" /></a>
</div>
<!-- /Logo -->
</div><!-- /banner -->
<!-- /Social -->
</div><!-- /top-menu -->
</div><!-- /top-wrap -->
<header class="header_bg clearfix">
<div class="container clearfix">&nbsp;</div>
</header>
<!-- /Header -->
<div class="clear"></div>
<!-- START CONTENT -->
<section class="container clearfix">
<div class="clear padding10"></div>
<header class="container page_info clearfix">
<h1 class="regular brown bottom_line"><?php echo $mainheading; ?></h1>
<div class="clear"></div>
</header>
<div class="col_1_2">
<p><?php echo $maincontent ?></p>
<p><?php echo do_shortcode( '[contact-form-7 id="498" title="Landing Page Call-to-Action Form"]' ); ?></p>
</div>
<div class="col_1_2 last">
<p><img alt="" src="<?php the_field('main_image'); ?>"></p>
</div>
<div class="clear padding20"></div>
<div class="col_1_3">
<h3 class="red"><?php echo $footerheadinga ?></h3>
<p><img style="width:50px; display:inline-block; float:left; clear:none; margin-right:10px;" alt="" src="<?php the_field('footer_image_a'); ?>"><?php echo $footertexta; ?></p>
<p> <a href="<?php the_field('footer_link_a'); ?>">Find out more.</a></p>
</div>
<div class="col_1_3">
<h3 class="red"><?php echo $footerheadingb; ?></h3>
<p><img style="width:50px; display:inline-block; float:left; clear:none; margin-right:10px;" alt="" src="<?php the_field('footer_image_b'); ?>"><?php the_field($footertextb); ?></p>
<p> <a href="<?php the_field('footer_link_b'); ?>">Find out more.</a></p>
</div>
<div class="col_1_3 last">
<h3 class="red"><?php echo $footerheadingc; ?></h3>
<p><img style="width:50px; display:inline-block; float:left; clear:none; margin-right:10px;" alt="" src="<?php the_field('footer_image_c'); ?>"><?php the_field($footertextc); ?></p>
<p> <a href="<?php the_field('footer_link_c'); ?>">Find out more.</a></p>
</div>
<div class="clear padding20"></div>
</section>
<!-- END CONTENT -->
<?php
break;
endwhile; endif;
?>
<!-- footer -->
<footer class="footer_bg_bottom clearfix">
<div class="footer_bottom container">
<div class="footer-copy">
&copy;<?php echo date("Y"); echo " "; bloginfo('name'); ?>
</div>
<div class="clear padding20"></div>
</div>
</footer>
<!-- /footer -->
</div>
<!--wrapper end-->
<?php
/* Load custom landing footer hook for 3rd party extensions */
do_action('lp_footer');
/* Load normal wordpress footer */
do_action('wp_footer');
?>
<!-- footer scripts here -->
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment