<?php 
/**
 * Template Name: Full Width Page
 * 
 * The template for displaying the full width page
 *
 * @package WordPress
 * @subpackage Edition
 * @since Edition 1.0
 */
get_header(); 

// Get background url
$background_url = get_post_meta($post->ID,'_thumbnail_id',false); // Get Image ID 

if( $background_url ) {
	$alt 			= get_post_meta($background_url, '_wp_attachment_image_alt', true); // Alt text of image
	$background_url = wp_get_attachment_image_src($background_url[0], 'fullslideshownc', false);  // URL of Featured Full Image
	$background_url = $background_url[0];
} ?>

<div class="pagewrapper default-layout <?php echo $background_url ? 'has-background' : 'no-background'; ?>">

	<?php get_template_part('functions/templates/title-full');  ?>

	<!-- Main Content-->
	<?php if ( have_posts() && get_the_content("", false, "") != '') : ?>
		<div class="container">
			<div class="col-md-12">
				<div class="postcontent content">
					<?php 							 
						while ( have_posts() ) : the_post(); 

							// Page Content
							the_content(); 

							// If comments are open or we have at least one comment, load up the comment template.
							if ( comments_open() || get_comments_number() ) {
								comments_template();
							}
						endwhile; 
					?>
				</div>
			</div>
		</div>
	<?php endif; ?>
	<!-- END Main Content -->
	
</div>

<?php 
// Page sections and footer
get_template_part( TW_SECTIONS_DIR . '/sections' );
get_footer();