<?php
/**
 * The template for displaying all pages
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site may use a
 * different template.
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package ultimate_hotel_booking
 */

get_header();

$ultimate_hotel_booking_prefix = 'travelfic_customizer_settings_';
$ultimate_hotel_booking_sidebar = get_theme_mod($ultimate_hotel_booking_prefix.'page_sidebar', 'right');
$ultimate_hotel_booking_disable_sidebar = get_post_meta( get_the_ID(), 'ultimate-hotel-booking-pmb-disable-sidebar', true );

if($ultimate_hotel_booking_disable_sidebar == 1){
	$ultimate_hotel_booking_content_wrap_class = 'ultimate-hotel-booking-no-sidebar';
}else{
	if( $ultimate_hotel_booking_sidebar == 'none' ){  
		$ultimate_hotel_booking_content_wrap_class = 'ultimate-hotel-booking-no-sidebar';
	} elseif($ultimate_hotel_booking_sidebar == 'left'){ 
		$ultimate_hotel_booking_content_wrap_class = 'ultimate-hotel-booking-left-sidebar';
	}elseif($ultimate_hotel_booking_sidebar == 'right'){
		$ultimate_hotel_booking_content_wrap_class = 'ultimate-hotel-booking-right-sidebar';
	}else{
		$ultimate_hotel_booking_content_wrap_class = 'ultimate-hotel-booking-right-sidebar';
	}
}

$ultimate_hotel_booking_banner = get_theme_mod($ultimate_hotel_booking_prefix . 'page_banner', 'banner');
$ultimate_hotel_booking_disable_banner = get_post_meta( get_the_ID(), 'ultimate-hotel-booking-pmb-banner', true );

?>
	<div id="site-content" class="ultimate-hotel-booking-site-content ultimate-hotel-booking-single-page">
		<div class="tf-page-header ultimate-hotel-booking-customizer-typography">
			<?php 
				if( $ultimate_hotel_booking_disable_banner != 1 && $ultimate_hotel_booking_banner == 'banner' ){
					get_template_part( 'template-parts/ultimate_hotel_booking', 'banner' );
				}
			?>
		</div>
		<div class="<?php echo esc_attr( apply_filters( 'ultimate_hotel_booking_page_tftcontainer', $ultimate_hotel_booking_container = '') ); ?> <?php echo esc_attr( $ultimate_hotel_booking_content_wrap_class ); ?>">
				
			<main id="tf-site-content" class="primary site-main">

				<?php
				
				while ( have_posts() ) :

					the_post();

					get_template_part( 'template-parts/content', 'page' );
					// If comments are open or we have at least one comment, load up the comment template.
					if ( comments_open() || get_comments_number() ) :
						comments_template();
					endif;
				endwhile; // End of the loop.
				?>
			</main><!-- #main -->
			
			<?php 
				if( $ultimate_hotel_booking_disable_sidebar != 1){
					if( $ultimate_hotel_booking_sidebar == 'left' || $ultimate_hotel_booking_sidebar == 'right'){
						get_sidebar();						
					}
				}
			?> 
		</div>
	</div>
	

<?php

get_footer();
