windhamdavid 6 years ago
parent
commit
4514ea35ff
6 changed files with 787 additions and 0 deletions
  1. 236 0
      estimate-request.php
  2. 49 0
      footer.php
  3. 309 0
      functions.php
  4. 68 0
      header.php
  5. 79 0
      image.php
  6. 46 0
      index.php

+ 236 - 0
estimate-request.php

@@ -0,0 +1,236 @@
+<?php
+//Send Confirmation Email
+
+$confirmtext="<p>Thank you for contacting Uni-Serve Air Conditioning. We have received your communication and will get back to you as soon as possible.</p>
+<p><strong>Uni-Serve Air Conditioning</strong><br>
+2723 Cedarville Drive<br />
+Kingwood, Texas 77345<br />
+Kingwood: (281) 360-9898<br />
+Pasadena/Charlotte: (281) 998-9168<br />
+</p>";
+$confirmemail='noreply@uniserveair.com';
+$confirmname='Uni-Serve Air Conditioning';
+$confirmsubject='Uni-Serve Air Conditioning Contact Form Confirmation';
+
+// L10Fm - v1.3 (11/10/06) (patched for XSS)
+// requirements for session data -
+//	1. LevelTen Hit Counter PHP v3.15 rel 3
+//	2. L10HC_API.php v3.15 v1.0 rel 1
+//
+
+//////////////////////////////////////////////////////////////////////////////////////
+//
+// configuration variables
+//
+//////////////////////////////////////////////////////////////////////////////////////
+
+// List all domains, including posible subdomains (e.g. www.) that are allowed to submit
+// requests to this script and the domains of any posible recipient email address.
+
+$validReferrers = array('www.climategreenwood.com','climategreenwood.com','gmail.com','www.gmail.com');
+
+// Use the this array (or create new arrays with a different association) to replace
+// setting fields in the form. Don't delete the 'default' array.
+
+$formAction['default'] = array(
+	'recipient' => 'jodi@climategreenwood.com',
+	'recipient_cc' => '',
+	'recipient_bcc' => '',
+	'subject' => 'Estimate Request Form | Climate Control Systems of Greenwood Inc',
+	'redirect' => 'http://climategreenwood.com/thank-you/',
+	'email' => '',
+	'realname' => '',
+	'required' => 'Name,Email,Home_Phone',
+	'format' => 'html',
+	'sesrep_max_items' => '10',
+);
+
+// If set to 0, the form can set the email recipient. For security reasons you should
+// always set this variable to 1.
+
+define('DISABLE_FORM_RECIPIENTS', 1);
+
+//////////////////////////////////////////////////////////////////////////////////////
+//
+// Start of code
+// Don't edit below this line
+//
+//////////////////////////////////////////////////////////////////////////////////////
+
+$pageHdr = "<html><head><style>td {font: x-small, verdana, arial, helvetica, sans-serif;} h1 {font-size: medium;} .err {color: #EE0000; font-weight: bold;}</style></head><body bgcolor=#FFFFFF><table width='500' align=center><tr><td>";
+$pageFtr = "</td></tr>\n</body></html>";
+
+$L10_LIBLoaded = 0;
+if(file_exists("L10_LIB.php")) {
+	include_once("L10_LIB.php");
+	$L10_LIBLoaded = 1;
+}
+
+$http_ref = $_SERVER['HTTP_REFERER'];
+$array = parse_url($http_ref);
+$a = $array['host'];
+
+if(!in_array($a,$validReferrers)) {
+	print "$pageHdr<p class=err>Invalid Referrer '$a'</p><p>Referrer does not have permission to access this LevelTen Formmail script.<p>For help on this issue, see <a href='http://www.leveltendesign.com/L10Apps/Fm/help_troubleshooting.php#invalidReferrer?hct=L10Fm-ErrMsg' target=_blank>LevelTen Formmail troubleshooting</a>$pageFtr";
+	exit;
+}
+
+if(! $_POST['form_action'] or ! $formAction[$_POST['form_action']]['recipient']) {
+	$fAIndex = 'default';
+} else {
+	$fAIndex = $_POST['form_action'];
+}
+
+$recipient  = (! DISABLE_FORM_RECIPIENTS && ($_POST['recipient'] != '')) ? $_POST['recipient'] : $formAction[$fAIndex]['recipient'];
+$subject  = ($_POST['subject'] != '') ? $_POST['subject'] : $formAction[$fAIndex]['subject'];
+$redirect = ($_POST['redirect'] != '') ? $_POST['redirect'] : $formAction[$fAIndex]['redirect'];
+$email = ($_POST['email'] != '') ? $_POST['email'] : $formAction[$fAIndex]['email'];
+$realname = ($_POST['realname']) ? $_POST['realname'] : $formAction[$fAIndex]['realname'];
+$recipient_cc  = (! DISABLE_FORM_RECIPIENTS && ($_POST['recipient_cc'] != '')) ? $_POST['recipient_cc'] : $formAction[$fAIndex]['recipient_cc'];
+$recipient_bcc  = (! DISABLE_FORM_RECIPIENTS && ($_POST['recipient_bcc'] != '')) ? $_POST['recipient_bcc'] : $formAction[$fAIndex]['recipient_bcc'];
+$format = ($_POST['format'] != '') ? $_POST['format'] : $formAction[$fAIndex]['format'];
+$required  = ($_POST['required'] != '') ? $_POST['required'] : $formAction[$fAIndex]['required'];
+$sesrep_max_items  = ($_POST['sesrep_max_items'] != '') ? $_POST['sesrep_max_items'] : $formAction[$fAIndex]['sesrep_max_items'];
+$recipient_secured  = ($_POST['recipient_secured'] != '') ? $_POST['recipient_secured'] : $formAction[$fAIndex]['recipient_secured'];
+
+$a = explode("@",$recipient);
+$a = array_pop($a);
+if(!in_array($a,$validReferrers)) {
+	print "$pageHdr<p class=err>Invalid Recipient '$recipient'</p><p> Email address does not have permission to relay through this LevelTen Formmail script.<p>For help on this issue, see <a href='http://www.leveltendesign.com/L10Apps/Fm/help_troubleshooting.php#invalidReferrer?hct=L10Fm-ErrMsg' target=_blank>LevelTen Formmail troubleshooting</a>$pageFtr";
+	exit;
+}
+
+$rccArray = explode(",",$recipient_cc);
+$recipient_cc = '';
+if($rccArray[0] != '') {
+	foreach($rccArray as $rcc) {
+		$a = explode("@",$rcc);
+		$a = array_pop($a);
+		if(in_array($a,$validReferrers)) {
+			$recipient_cc .= "$rcc,";
+		}
+	}
+}
+$recipient_cc = substr($recipient_cc,0,-1);
+
+$rbccArray = explode(",",$recipient_bcc);
+$recipient_bcc = '';
+if($rbccArray[0] != '') {
+	foreach($rbccArray as $rbcc) {
+		$a = explode("@",$rbcc);
+		$a = array_pop($a);
+		if(in_array($a,$validReferrers)) {
+			$recipient_bcc .= "$rbcc,";
+		}
+	}
+}
+$recipient_bcc = substr($recipient_bcc,0,-1);
+
+$a = explode(",",$required);
+if($a[0] != '') {
+	foreach($a as $req) {
+		if($_POST[$req] == '') {
+			print "$pageHdr<p class=err>Required Field '$req' is missing!</p><p> You must input a value for this field before submitting<p align=center><a href='javascript: history.back(-1)'>back to form</a>$pageFtr";
+			exit;
+		}
+	}
+}
+
+
+$htmlFormat = (strtolower(substr($format,0,1)) == 'h');
+
+$msg = '';
+if($htmlFormat) {
+	$msg = "<html><head><style>td {font: x-small, verdana, arial, helvetica, sans-serif;} .fldname {font-weight:bold;font-size:x-small;} .flddata {font-size:x-small;} .tblhdr { font-size:x-small;font-weight:bold;color:#FFFFFF;background-color=#000088}</style></head><body>\n";
+	$msg .= "<table border=0 cellspacing=0 cellpadding=0 width=640>\n";
+	$msg .= "<tr><td colspan=3 class='tblhdr'>Form Data</td></tr>\n";
+} else {
+	$msg = "Form data\n\n";
+}
+
+$bl0 = '';
+$bl1 = '';
+$ld = ' ';
+$el = "\n\n";
+
+$creditStrAdd = '';
+
+if($htmlFormat) {
+	$bl0 = '<tr bgcolor=#E8E8FF><td class="fldname" valign=top>';
+	$bl1 = '<tr bgcolor=#FFFFFF><td class="fldname" valign=top>';
+	$ld = '</td><td> &nbsp; </td><td width=80% class="flddata">';
+	$el = "</td></tr>\n";
+}
+$i = 0;
+foreach($_POST as $k => $v) {
+	if($htmlFormat) {
+		$v = str_replace("\n","<br>\n",$v);
+	}
+	if($i) {
+		$msg .= "$bl0$k:$ld$v$el";
+	} else {
+		$msg .= "$bl1$k:$ld$v$el";
+	}
+	$i = !$i;
+}
+
+if(file_exists("L10HC_API.php")) {
+	include("L10HC_API.php");
+	$vID = getVID();
+	if($htmlFormat) {
+		$msg .= "<tr><td colspan=3><br>&nbsp;<br></td></tr>\n<tr><td colspan=3 border=1>";
+		$creditStrAdd = ' &amp; LevelTen Hit Counter';
+	} else {
+		$msg .= "\n\n";
+		$creditStrAdd = ' & LevelTen Hit Counter';
+	}
+	$msg .= getSessions($vID,$max_sessions,$recipient_secured,$htmlFormat+1);
+	if($htmlFormat) {
+		$msg .= "</td></tr>\n";
+	} else {
+
+	}
+}
+
+if($htmlFormat) {
+	$msg .= "<tr><td colspan=3>&nbsp;</td></tr><tr><td colspan=3 align=center>Generated by<br>LevelTen Formmail$creditStrAdd<td></tr></table></body></html>\n";
+} else {
+	$msg .= "\n\nGenerated by LevelTen Formmail$creditStrAdd\n";
+}
+
+
+
+if (! preg_match("/^[^@\s]+@([-a-z0-9]+\.)+[a-z]{2,}$/i", $recipient, $result)) {echo "Invalid recipient"; exit;}
+if (strlen($recipient) > 80 or strlen($recipient_cc) > 200 or strlen($recipient_bcc) > 200) {echo "Possible hack attempt"; exit;}
+if(stristr($subject, "Bcc:") or stristr($subject, "cc:") or stristr($subject, "to:")) {echo "Invalid content in subject"; exit;}
+if(stristr($msg, "Bcc:") or stristr($msg, "cc:") or stristr($msg, "to:")) {echo "Invalid content in message"; exit;}
+if(stristr($realname, "Bcc:") or stristr($realname, "cc:") or stristr($realname, "to:") or stristr($realname, "Content-type")) {echo "Invalid content"; exit;}
+if(stristr($email, "Bcc:") or stristr($email, "cc:") or stristr($email, "to:")) {echo "Invalid content"; exit;}
+
+
+$extraHeaders = "";
+if($email) { $extraHeaders .= "From: \"". $realname ."\" <". trim($email) .">\r\n"; }
+if($email) { $extraHeaders .= "Return-Path: ". trim($email) ."\r\n"; }
+if($email) { $extraHeaders .= "Reply-To: ". trim($email) ."\r\n"; }
+if($htmlFormat == 'h') { $extraHeaders .= "Content-type: text/html\r\n"; }
+if($recipient_cc != '') { $extraHeaders .= "Cc: ". trim($recipient_cc) ."\r\n"; }
+if($recipient_bcc != '') { $extraHeaders .= "Bcc: ". trim($recipient_bcc) ."\r\n"; }
+
+$confirmfrom = "";
+$confirmfrom .= "From: \"". $confirmname ."\" <". trim($confirmemail) .">\r\n";
+$confirmfrom .= "Return-Path: ". trim($confirmemail) ."\r\n";
+$confirmfrom .= "Reply-To: ". trim($confirmemail) ."\r\n";
+$confirmfrom .= "Content-type: text/html\r\n";
+
+$success = 1;
+$success = mail($recipient,$subject,$msg,$extraHeaders);
+//$success = mail($_POST['email'],$confirmsubject,$confirmtext,$confirmfrom);
+if(!$success && $L10_LIBLoaded) {
+	log_event("Unsuccesful Email Attempt: $recipient");
+}
+
+//print "mail($recipient,$subject,$msg,$extraHeaders)";
+//print "$msg";
+
+header("Location: $redirect");
+?>

+ 49 - 0
footer.php

@@ -0,0 +1,49 @@
+<?php
+/**
+ * The template for displaying the footer
+ *
+ * Contains footer content and the closing of the #main and #page div elements.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Fourteen
+ * @since Twenty Fourteen 1.0
+ */
+?>
+
+		</div><!-- #main -->
+	</div><!-- #page -->
+	<footer id="colophon" class="site-footer" role="contentinfo">
+		<div class="inner-wrapper">
+			<nav id="footer-navigation" class="site-navigation footer-navigation" role="navigation">
+				<div class="inner-wrapper">
+					<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
+				</div>
+			</nav>
+			<div class="footer-left">
+				<?php echo str_replace( '[date]', date("Y"), get_field('footer_left', 'options') ); ?>
+			</div>
+			<div class="footer-right">
+				<?php echo str_replace( '[date]', date("Y"), get_field('footer_right', 'options') ); ?>
+			</div>
+		</div>
+	</footer><!-- #colophon -->
+	
+	
+
+	<?php wp_footer(); ?>
+
+
+
+
+<script>
+  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+  ga('create', 'UA-47188539-9', 'climategreenwood.com');
+  ga('send', 'pageview');
+</script>
+
+</body>
+</html>

+ 309 - 0
functions.php

@@ -0,0 +1,309 @@
+<?php
+/**
+ * Twenty Fourteen functions and definitions
+ * Set up the theme and provides some helper functions, which are used in the
+ * theme as custom template tags. Others are attached to action and filter
+ * hooks in WordPress to change core functionality.
+ * When using a child theme you can override certain functions (those wrapped
+ * in a function_exists() call) by defining them first in your child theme's
+ * functions.php file. The child theme's functions.php file is included before
+ * the parent theme's file, so the child theme functions would be used.
+ * @link http://codex.wordpress.org/Theme_Development
+ * @link http://codex.wordpress.org/Child_Themes
+ * Functions that are not pluggable (not wrapped in function_exists()) are
+ * instead attached to a filter or action hook.
+ * For more information on hooks, actions, and filters,
+ * @link http://codex.wordpress.org/Plugin_API
+ * @package WordPress
+ * @subpackage Twenty_Fourteen
+ * @since Twenty Fourteen 1.0
+ */
+
+/**
+ * Set up the content width value based on the theme's design.
+ * @see twentyfourteen_content_width()
+ * @since Twenty Fourteen 1.0
+ */
+if ( ! isset( $content_width ) ) {
+	$content_width = 474;
+}
+
+if ( ! function_exists( 'twentyfourteen_setup' ) ) :
+/**
+ * Twenty Fourteen setup.
+ * Set up theme defaults and registers support for various WordPress features.
+ * Note that this function is hooked into the after_setup_theme hook, which
+ * runs before the init hook. The init hook is too late for some features, such
+ * as indicating support post thumbnails.
+ * @since Twenty Fourteen 1.0
+ */
+function twentyfourteen_setup() {
+
+	// Add RSS feed links to <head> for posts and comments.
+	add_theme_support( 'automatic-feed-links' );
+
+	// Enable support for Post Thumbnails, and declare two sizes.
+	add_theme_support( 'post-thumbnails' );
+	set_post_thumbnail_size( 672, 372, true );
+	add_image_size( 'twentyfourteen-full-width', 1038, 576, true );
+
+	// This theme uses wp_nav_menu() in two locations.
+	register_nav_menus( array(
+		'primary'   => __( 'Top primary menu', 'twentyfourteen' ),
+		'secondary' => __( 'Secondary menu in left sidebar', 'twentyfourteen' ),
+	) );
+
+	/*
+	 * Switch default core markup for search form, comment form, and comments
+	 * to output valid HTML5.
+	 */
+	add_theme_support( 'html5', array(
+		'search-form',
+		'comment-form',
+		'comment-list',
+	) );
+}
+endif; // twentyfourteen_setup
+add_action( 'after_setup_theme', 'twentyfourteen_setup' );
+
+/**
+ * Enqueue scripts and styles for the front end.
+ * @since Twenty Fourteen 1.0
+ * @return void
+ */
+function twentyfourteen_scripts() {
+	// Load our main stylesheet.
+	wp_enqueue_style( 'twentyfourteen-style', get_stylesheet_uri() );
+	// Load the Internet Explorer specific stylesheet.
+	wp_enqueue_style( 'twentyfourteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfourteen-style' ), '20131205' );
+	wp_style_add_data( 'twentyfourteen-ie', 'conditional', 'lt IE 9' );
+	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); }
+	wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20131209', true );
+}
+add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' );
+
+/**
+ * Extend the default WordPress body classes.
+ * Adds body classes to denote:
+ * 1. Single or multiple authors.
+ * 2. Presence of header image.
+ * 3. Index views.
+ * 4. Full-width content layout.
+ * 5. Presence of footer widgets.
+ * 6. Single views.
+ * 7. Featured content layout.
+ * @since Twenty Fourteen 1.0
+ * @param array $classes A list of existing body class values.
+ * @return array The filtered body class list.
+ */
+function twentyfourteen_body_classes( $classes ) {
+	if ( is_multi_author() ) {
+		$classes[] = 'group-blog';
+	}
+
+	if ( is_archive() || is_search() || is_home() ) {
+		$classes[] = 'list-view';
+	}
+
+	if ( is_singular() && ! is_front_page() ) {
+		$classes[] = 'singular';
+	}
+
+	return $classes;
+}
+add_filter( 'body_class', 'twentyfourteen_body_classes' );
+
+/**
+ * Extend the default WordPress post classes.
+ * Adds a post class to denote:
+ * Non-password protected page with a post thumbnail.
+ * @since Twenty Fourteen 1.0
+ * @param array $classes A list of existing post class values.
+ * @return array The filtered post class list.
+ */
+function twentyfourteen_post_classes( $classes ) {
+	if ( ! post_password_required() && has_post_thumbnail() ) {
+		$classes[] = 'has-post-thumbnail';
+	}
+
+	return $classes;
+}
+add_filter( 'post_class', 'twentyfourteen_post_classes' );
+
+/**
+ * Create a nicely formatted and more specific title element text for output
+ * in head of document, based on current view.
+ * @since Twenty Fourteen 1.0
+ * @param string $title Default title text for current view.
+ * @param string $sep Optional separator.
+ * @return string The filtered title.
+ */
+function twentyfourteen_wp_title( $title, $sep ) {
+	global $paged, $page;
+
+	if ( is_feed() ) {
+		return $title;
+	}
+
+	// Add the site name.
+	$title .= get_bloginfo( 'name' );
+
+	// Add the site description for the home/front page.
+	$site_description = get_bloginfo( 'description', 'display' );
+	if ( $site_description && ( is_home() || is_front_page() ) ) {
+		$title = "$title $sep $site_description";
+	}
+
+	// Add a page number if necessary.
+	if ( $paged >= 2 || $page >= 2 ) {
+		$title = "$title $sep " . sprintf( __( 'Page %s', 'twentyfourteen' ), max( $paged, $page ) );
+	}
+
+	return $title;
+}
+add_filter( 'wp_title', 'twentyfourteen_wp_title', 10, 2 );
+
+function basic_template_scripts() {
+    wp_deregister_script( 'jquery' ); // jQuery
+    wp_register_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js' );
+    wp_enqueue_script( 'jquery' );
+    wp_deregister_script( 'jquery-ui' ); // jQuery UI
+    wp_register_script( 'jquery-ui', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', array( 'jquery' ) );
+    wp_enqueue_script( 'jquery-ui' );
+    wp_deregister_script( 'nivoslider' ); // nivoSlider
+    wp_register_script( 'nivoslider', get_bloginfo('template_directory') . '/js/jquery.nivo.slider.pack.js', array( 'jquery' ) );
+    wp_enqueue_script( 'nivoslider' );
+    wp_deregister_script( 'climatecontrol-js' ); // Example
+    wp_register_script( 'climatecontrol-js', get_bloginfo('template_directory') . '/js/climatecontrol.js', array( 'jquery' ) );
+    wp_enqueue_script( 'climatecontrol-js' );
+	wp_register_style('nivoslider-css', get_bloginfo('template_directory') . '/css/nivo-slider.css');
+	wp_enqueue_style('nivoslider-css');
+}    
+add_action('wp_enqueue_scripts', 'basic_template_scripts');
+
+/* Limit string by words not characters */
+function limit_words($string, $word_limit) { $words = explode(" ",$string); return implode(" ",array_splice($words,0,$word_limit)); }
+
+function remove_menus () {
+	global $menu;
+	$restricted = array(__('Links'), __('Comments'));
+	end ($menu);
+	while (prev($menu)){
+		$value = explode(' ',$menu[key($menu)][0]);
+		if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
+	}
+}
+add_action('admin_menu', 'remove_menus');
+
+add_action("login_head", "my_login_head");
+function my_login_head() {
+    echo " 
+    <style>
+    body.login #login h1 a {
+        background: url('".get_bloginfo('template_url')."/images/logo_login.png') no-repeat scroll center top transparent;
+        height: 181px;
+        width: 269px;
+		padding:0 25px;
+    }
+    </style>
+    ";
+}
+
+add_filter( 'login_headerurl', 'w4_login_headerurl');
+function w4_login_headerurl(){
+    return home_url('/');
+}
+
+function columns_one_third( $atts, $content = null ) { return '<div class="one_third">' . do_shortcode($content) . '</div>'; } add_shortcode('one_third', 'columns_one_third');
+function columns_one_third_last( $atts, $content = null ) { return '<div class="one_third last">' . do_shortcode($content) . '</div><div class="clearboth"></div>'; } add_shortcode('one_third_last', 'columns_one_third_last');
+function columns_two_third( $atts, $content = null ) { return '<div class="two_third">' . do_shortcode($content) . '</div>'; } add_shortcode('two_third', 'columns_two_third');
+function columns_two_third_last( $atts, $content = null ) { return '<div class="two_third last">' . do_shortcode($content) . '</div><div class="clearboth"></div>'; } add_shortcode('two_third_last', 'columns_two_third_last');
+function columns_one_half( $atts, $content = null ) { return '<div class="one_half">' . do_shortcode($content) . '</div>'; } add_shortcode('one_half', 'columns_one_half');
+function columns_one_half_last( $atts, $content = null ) { return '<div class="one_half last">' . do_shortcode($content) . '</div><div class="clearboth"></div>'; } add_shortcode('one_half_last', 'columns_one_half_last');
+function columns_one_fourth( $atts, $content = null ) { return '<div class="one_fourth">' . do_shortcode($content) . '</div>'; } add_shortcode('one_fourth', 'columns_one_fourth');
+function columns_one_fourth_last( $atts, $content = null ) { return '<div class="one_fourth last">' . do_shortcode($content) . '</div><div class="clearboth"></div>'; } add_shortcode('one_fourth_last', 'columns_one_fourth_last');
+function columns_three_fourth( $atts, $content = null ) { return '<div class="three_fourth">' . do_shortcode($content) . '</div>'; } add_shortcode('three_fourth', 'columns_three_fourth');
+function columns_three_fourth_last( $atts, $content = null ) { return '<div class="three_fourth last">' . do_shortcode($content) . '</div><div class="clearboth"></div>'; } add_shortcode('three_fourth_last', 'columns_three_fourth_last');
+function columns_one_fifth( $atts, $content = null ) { return '<div class="one_fifth">' . do_shortcode($content) . '</div>'; } add_shortcode('one_fifth', 'columns_one_fifth');
+function columns_one_fifth_last( $atts, $content = null ) { return '<div class="one_fifth last">' . do_shortcode($content) . '</div>
+<div class="clearboth"></div>'; } add_shortcode('one_fifth_last', 'columns_one_fifth_last');
+function columns_two_fifth( $atts, $content = null ) { return '<div class="two_fifth">' . do_shortcode($content) . '</div>'; } add_shortcode('two_fifth', 'columns_two_fifth');
+function columns_two_fifth_last( $atts, $content = null ) { return '<div class="two_fifth last">' . do_shortcode($content) . '</div><div class="clearboth"></div>'; } add_shortcode('two_fifth_last', 'columns_two_fifth_last');
+function columns_three_fifth( $atts, $content = null ) { return '<div class="three_fifth">' . do_shortcode($content) . '</div>'; } add_shortcode('three_fifth', 'columns_three_fifth');
+function columns_three_fifth_last( $atts, $content = null ) { return '<div class="three_fifth last">' . do_shortcode($content) . '</div><div class="clearboth"></div>'; } add_shortcode('three_fifth_last', 'columns_three_fifth_last');
+function columns_four_fifth( $atts, $content = null ) { return '<div class="four_fifth">' . do_shortcode($content) . '</div>'; } add_shortcode('four_fifth', 'columns_four_fifth');
+function columns_four_fifth_last( $atts, $content = null ) { return '<div class="four_fifth last">' . do_shortcode($content) . '</div><div class="clearboth"></div>'; } add_shortcode('four_fifth_last', 'columns_four_fifth_last');
+function columns_one_sixth( $atts, $content = null ) { return '<div class="one_sixth">' . do_shortcode($content) . '</div>'; } add_shortcode('one_sixth', 'columns_one_sixth');
+function columns_one_sixth_last( $atts, $content = null ) { return '<div class="one_sixth last">' . do_shortcode($content) . '</div><div class="clearboth"></div>'; } add_shortcode('one_sixth_last', 'columns_one_sixth_last');
+function columns_five_sixth( $atts, $content = null ) { return '<div class="five_sixth">' . do_shortcode($content) . '</div>'; } add_shortcode('five_sixth', 'columns_five_sixth');
+function columns_five_sixth_last( $atts, $content = null ) { return '<div class="five_sixth last">' . do_shortcode($content) . '</div><div class="clearboth"></div>'; } add_shortcode('five_sixth_last', 'columns_five_sixth_last');
+
+function columns_formatter($content) {
+	$new_content = '';
+
+	/* Matches the contents and the open and closing tags */
+	$pattern_full = '{(\[raw\].*?\[/raw\])}is';
+
+	/* Matches just the contents */
+	$pattern_contents = '{\[raw\](.*?)\[/raw\]}is';
+
+	/* Divide content into pieces */
+	$pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE);
+
+	/* Loop over pieces */
+	foreach ($pieces as $piece) {
+		/* Look for presence of the shortcode */
+		if (preg_match($pattern_contents, $piece, $matches)) {
+
+			/* Append to content (no formatting) */
+			$new_content .= $matches[1];
+		} else {
+
+			/* Format and append to content */
+			$new_content .= wptexturize(wpautop($piece));
+		}
+	}
+
+	return $new_content;
+}
+
+// Remove the 2 main auto-formatters
+remove_filter('the_content', 'wpautop');
+remove_filter('the_content', 'wptexturize');
+
+// Before displaying for viewing, apply this function
+add_filter('the_content', 'columns_formatter', 99);
+add_filter('widget_text', 'columns_formatter', 99);
+
+
+/* Pagination as found here: http://design.sparklette.net/teaches/how-to-add-wordpress-pagination-without-a-plugin/ */
+function pagination($pages = '', $range = 4)
+{  
+     $showitems = ($range * 2)+1;  
+ 
+     global $paged;
+     if(empty($paged)) $paged = 1;
+ 
+     if($pages == '') {
+         global $wp_query;
+         $pages = $wp_query->max_num_pages;
+         if(!$pages) { $pages = 1; }
+     }   
+ 
+     if(1 != $pages)
+     {
+         echo "<div class=\"pagination\"><span>Page ".$paged." of ".$pages."</span>";
+         if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>&laquo; First</a>";
+         if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>&lsaquo; Previous</a>";
+ 
+         for ($i=1; $i <= $pages; $i++) {
+             if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) {
+                 echo ($paged == $i)? "<span class=\"current\">".$i."</span>":"<a href='".get_pagenum_link($i)."' class=\"inactive\">".$i."</a>";
+             }
+         }
+ 
+         if ($paged < $pages && $showitems < $pages) echo "<a href=\"".get_pagenum_link($paged + 1)."\">Next &rsaquo;</a>";  
+         if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last &raquo;</a>";
+         echo "</div>\n";
+     }
+}

+ 68 - 0
header.php

@@ -0,0 +1,68 @@
+<?php
+/**
+ * The Header for our theme
+ *
+ * Displays all of the <head> section and everything up till <div id="main">
+ *
+ * @package WordPress
+ * @subpackage Twenty_Fourteen
+ * @since Twenty Fourteen 1.0
+ */
+?><!DOCTYPE html>
+<!--[if IE 7]><html class="ie ie7" <?php language_attributes(); ?>><![endif]-->
+<!--[if IE 8]><html class="ie ie8" <?php language_attributes(); ?>><![endif]-->
+<!--[if !(IE 7) | !(IE 8) ]><!--><html <?php language_attributes(); ?>><!--<![endif]-->
+<head>
+
+	<meta charset="<?php bloginfo( 'charset' ); ?>">
+	<title><?php wp_title( '|', true, 'right' ); ?></title>
+	<meta name="description" content="Climate Control Systems of Greenwood has been owned and operated in Greenwood, SC for over 25 years.  We are a full-service heating, ventilation and air conditioning company offering repairs and installations for residential and commercial customers. "/>
+	<meta property="og:image" content="http://www.climategreenwood.com/wp-content/themes/climatecontrol/images/climategreenwood.jpg" />
+	<link rel="profile" href="http://gmpg.org/xfn/11">
+	<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
+	<link rel="shortcut icon" href="<?php bloginfo('stylesheet_directory'); ?>/images/favicon.ico" />
+	<link href='https://fonts.googleapis.com/css?family=Economica:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
+	<!--[if lt IE 9]><script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script><![endif]-->
+	<?php wp_head(); ?>
+</head>
+<body <?php body_class(); ?>>
+<div id="page" class="hfeed site">
+	<header id="masthead" class="site-header" role="banner">
+		<div class="header-main">
+			<div class="inner-wrapper">
+				<div class="header-left">
+					<div class="header-links">
+						<?php if ( get_field('header_links', 'options') ) {
+							while( has_sub_field('header_links', 'options') ) {
+								$page = get_sub_field('page');
+								echo "<a href='" . get_permalink( $page->ID ) . "'>" . $page->post_title . "</a>";
+							}
+						} ?>
+					</div>
+					<div class="phone"><?php the_field('phone', 'options'); ?></div>
+				</div>
+				<div class="logo">
+					<a href="<?php bloginfo('url'); ?>"></a>
+				</div>
+				<!--<?php get_search_form(); ?>-->
+				<div class="social">
+					<?php if ( get_field('social_media', 'options') ) {
+						echo "<ul class='social-links'>";
+						while( has_sub_field('social_media', 'options') ) {
+							echo "<li><a href='" . get_sub_field('social_link') . "' target='_blank' style='background-image:url(" . get_sub_field('social_icon') . ");'>" . get_sub_field('social_text') . "</a></li>";
+						}
+						echo "</ul>";
+					} ?>
+				</div>
+			</div>
+		</div>
+		<nav id="primary-navigation" class="site-navigation primary-navigation inner-wrapper" role="navigation">
+			<div class="inner-wrapper">
+				<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
+			</div>
+			<div class="sub-nav-back"></div>
+		</nav>
+	</header><!-- #masthead -->
+
+	<div class="bg-element"></div>
+	<div id="main" class="site-main">

+ 79 - 0
image.php

@@ -0,0 +1,79 @@
+<?php
+/**
+ * The template for displaying image attachments
+ *
+ * @package WordPress
+ * @subpackage Twenty_Fourteen
+ * @since Twenty Fourteen 1.0
+ */
+
+// Retrieve attachment metadata.
+$metadata = wp_get_attachment_metadata();
+
+get_header();
+?>
+
+	<section id="primary" class="content-area image-attachment">
+		<div id="content" class="site-content" role="main">
+
+	<?php
+		// Start the Loop.
+		while ( have_posts() ) : the_post();
+	?>
+			<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+				<header class="entry-header">
+					<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
+
+					<div class="entry-meta">
+
+						<span class="entry-date"><time class="entry-date" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>"><?php echo esc_html( get_the_date() ); ?></time></span>
+
+						<span class="full-size-link"><a href="<?php echo wp_get_attachment_url(); ?>"><?php echo $metadata['width']; ?> &times; <?php echo $metadata['height']; ?></a></span>
+
+						<span class="parent-post-link"><a href="<?php echo get_permalink( $post->post_parent ); ?>" rel="gallery"><?php echo get_the_title( $post->post_parent ); ?></a></span>
+						<?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?>
+					</div><!-- .entry-meta -->
+				</header><!-- .entry-header -->
+
+				<div class="entry-content">
+					<div class="entry-attachment">
+						<div class="attachment">
+							<?php twentyfourteen_the_attached_image(); ?>
+						</div><!-- .attachment -->
+
+						<?php if ( has_excerpt() ) : ?>
+						<div class="entry-caption">
+							<?php the_excerpt(); ?>
+						</div><!-- .entry-caption -->
+						<?php endif; ?>
+					</div><!-- .entry-attachment -->
+
+					<?php
+						the_content();
+						wp_link_pages( array(
+							'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
+							'after'       => '</div>',
+							'link_before' => '<span>',
+							'link_after'  => '</span>',
+						) );
+					?>
+				</div><!-- .entry-content -->
+			</article><!-- #post-## -->
+
+			<nav id="image-navigation" class="navigation image-navigation">
+				<div class="nav-links">
+				<?php previous_image_link( false, '<div class="previous-image">' . __( 'Previous Image', 'twentyfourteen' ) . '</div>' ); ?>
+				<?php next_image_link( false, '<div class="next-image">' . __( 'Next Image', 'twentyfourteen' ) . '</div>' ); ?>
+				</div><!-- .nav-links -->
+			</nav><!-- #image-navigation -->
+
+			<?php comments_template(); ?>
+
+		<?php endwhile; // end of the loop. ?>
+
+		</div><!-- #content -->
+	</section><!-- #primary -->
+
+<?php
+get_sidebar();
+get_footer();

+ 46 - 0
index.php

@@ -0,0 +1,46 @@
+<?php
+/**
+ * The main template file
+ *
+ * This is the most generic template file in a WordPress theme and one
+ * of the two required files for a theme (the other being style.css).
+ * It is used to display a page when nothing more specific matches a query,
+ * e.g., it puts together the home page when no home.php file exists.
+ *
+ * @link http://codex.wordpress.org/Template_Hierarchy
+ *
+ * @package WordPress
+ * @subpackage Twenty_Fourteen
+ * @since Twenty Fourteen 1.0
+ */
+
+get_header(); ?>
+
+<div id="main-content" class="main-content">
+	<div id="primary" class="content-area">
+		<div id="content" class="site-content" role="main">
+		<?php
+			if ( have_posts() ) :
+				// Start the Loop.
+				while ( have_posts() ) : the_post();
+					/*
+					 * Include the post format-specific template for the content. If you want to
+					 * use this in a child theme, then include a file called called content-___.php
+					 * (where ___ is the post format) and that will be used instead.
+					 */
+					get_template_part( 'content', get_post_format() );
+				endwhile;
+				if (function_exists("pagination")) : pagination(); endif;
+			else :
+				// If no content, include the "No posts found" template.
+				get_template_part( 'content', 'none' );
+			endif;
+		?>
+		</div><!-- #content -->
+	</div><!-- #primary -->
+	<?php get_sidebar( 'content' ); ?>
+</div><!-- #main-content -->
+
+<?php
+get_sidebar();
+get_footer();