<?php
/**
 * Template Name: Blog
 *
 * The template for displaying the Blog page.
 *
 * Used to display archive-type pages if nothing more specific matches a query.
 * For example, puts together date-based pages if no date.php file exists.
 *
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage ChurchThemes
 *
 ===================================================================================================
 WARNING! DO NOT EDIT THIS FILE OR ANY TEMPLATE FILES IN THIS THEME!

 To make it easy to update your theme, you should not edit this file. Instead, you should create a
 Child Theme first. This will ensure your template changes are not lost when updating the theme.

 You can learn more about creating Child Themes here: http://codex.wordpress.org/Child_Themes

 You have been warned! :)
 ===================================================================================================
 */

$page_options_meta = get_post_meta($post->ID,'_page_options',true);
isset($page_options_meta['ct_page_layout']) ? $page_layout = $page_options_meta['ct_page_layout'] : $page_layout = null;
isset($page_options_meta['ct_page_sidebar']) ? $page_sidebar = $page_options_meta['ct_page_sidebar'] : $page_sidebar = null;
isset($page_options_meta['ct_page_tagline']) ? $page_tagline = $page_options_meta['ct_page_tagline'] : $page_tagline = null;
isset($page_options_meta['ct_social_footer']) ? $page_social = $page_options_meta['ct_social_footer'] : $page_social = null;

get_header();

?>
		<div id="ribbon" class="page">
			<div class="container_12 grid-container content">
				<div class="ribbon-wrapper">
					<div class="<?php if(!empty($page_tagline)): ?>grid_8 grid-66<?php else: ?>grid_12 grid-100<?php endif; ?> alpha">
						<h1><?php the_title(); ?></h1>
					</div>
	<?php if(!empty($page_tagline)): ?>
					<div class="grid_4 grid-33 omega">
						<span class="tagline"><?php echo $page_tagline; ?></span>
					</div>
	<?php endif; ?>
				</div>
			</div>
		</div>
		<div id="wrapper3" class="container_12 grid-container">
<?php
	if($page_layout == 'left'): get_sidebar();
?>
			<div id="content" class="grid_8 grid-66 omega">
<?php
	elseif($page_layout == 'full'):
?>
			<div id="content" class="grid_12 grid-100 alpha">
<?php
	else:
?>
			<div id="content" class="grid_8 grid-66 alpha">
<?php
	endif;
?>
<?php

	get_template_part('loop');

?>
			</div>
<?php if($page_layout == 'right' || empty($page_layout)): get_sidebar(); endif; ?>
		</div>
<?php get_footer(); ?>