<?php
/**
 * @copyright Copyright (c) 2016 AmyTheme (http://www.amytheme.com). All rights reserved.
 * @license  http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 */

defined( 'ABSPATH' ) or die;

get_header();

get_template_part( 'partials/page-header' );

$movie_meta		= get_post_meta( $post->ID, '_movie_sidebar', true );
$movie_layout	= esc_attr( isset( $movie_meta['movie_sidebar'] ) ? $movie_meta['movie_sidebar'] : 'full' );
$movie_column	= esc_attr( $movie_layout == 'full' ? '12' : '8' );

$banner			= amy_movie_get_banner( $post->ID, 'full' );
$class			= '';

if ( $banner != '' ) {
	$class = 'has-banner';
}
?>

<section class="main-content amy-movie single-movie layout-<?php echo $movie_layout; ?> <?php echo esc_attr( $class ); ?>">
	<div class="container">
		<div class="row">
			<?php amy_movie_page_sidebar( 'left', $movie_layout ); ?>

			<div class="col-md-<?php echo $movie_column; ?>">
				<div class="page-content">
					<?php
					while ( have_posts() ) {
						the_post();
						get_template_part( 'partials/post-formats/content', 'movie' );
					}
					?>
				</div>
			</div>

			<?php amy_movie_page_sidebar( 'right', $movie_layout ); ?>
		</div>
	</div>
</section>

<?php
get_footer();
