<?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/
 *
 * @author      CodeGearThemes
 * @category    WordPress
 * @package     Acoustics
 * @version     1.0.0
 *
 */

get_header();

$acoustics_breadcrumb_control = get_theme_mod( 'acoustics_breadcrumb_layout', false );
?>

<?php if( !is_front_page() ): ?>
<header class="section-page-header">
	<div class="<?php echo esc_attr( apply_filters( 'acoustics_container_class', 'container' ) ); ?>">
		<div class="grid">
			<div class="grid__item <?php if( $acoustics_breadcrumb_control ){ echo "one-whole"; } else{ echo "one-half"; } ?> text-left">
				<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
			</div>
			<?php if( $acoustics_breadcrumb_control ): ?>
				<div class="grid__item one-half text-right">
					<?php acoustics_breadcrumb(); ?>
				</div>
			<?php endif;?>
		</div>
	</div>
</header>
<?php endif; ?>
<div class="section-default section--page-template">
	<div class="<?php echo esc_attr( apply_filters( 'acoustics_container_class', 'container' ) ); ?>">
		<div class="grid">
			<section id="primary" class="section-primary grid__item <?php echo esc_attr( apply_filters( 'acoustics_content_class', 'one-whole' ) ); ?> content-area">
				<main id="main" class="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>
			</section>
			<?php do_action( 'acoustics_sidebar' ); ?>
		</div>
	</div>
</div>
<?php
get_footer();
