<?php 
/**
 * Template Name: Contact Page
 * 
 * The template for displaying the contact 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'); ?>

	<div class="container">

		<!-- Main Content-->
		<div class="rightside">
			<div class="rightcontent content">
				<div class="postcontent">
					<?php 							 
						if ( have_posts() ) : 
							while ( have_posts() ) : the_post(); 
								the_content(); 
							endwhile; 
						endif; 
					?>
				</div>
			</div>
		</div>
		<!-- END Main Content -->

		<!-- Sidebar -->
		<?php if ( is_active_sidebar( 'contact-sidebar' ) ) : ?>
			<div class="sidebar">
				<div class="sidebarcontent">
					<?php dynamic_sidebar('Contact Sidebar'); ?>
				</div>
			</div>
		<?php endif; ?>
		<!-- END Sidebar -->

	</div>
</div>

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