<?php
/**
 * The template for displaying all pages.
 *
 * @package Eronex
 * @since 0.0.1
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
get_header();

$p_id              = get_the_ID();
$general_container = eronex_option( 'eronex_container_layout', 'container' );
$page_container    = eronex_option( 'eronex_page_container_layout', $general_container );
$page_container    = ! empty( $page_container ) ? $page_container : $general_container;
$meta_container    = get_post_meta( $p_id, 'eronex_container_layout', true );
$container         = ! empty( $meta_container ) ? $meta_container : $page_container;

$general_sidebar = eronex_option( 'eronex_sidebar_layout', 'right' );
$page_sidebar    = eronex_option( 'eronex_page_sidebar_layout', 'none' );
$meta_sidebar    = get_post_meta( $p_id, 'eronex_sidebar_layout', true );
$sidebar         = ! empty( $meta_sidebar ) ? $meta_sidebar : $page_sidebar;
?>
<div class="eronex-content-inner">
	<div class="eronex-<?php echo esc_attr( $container ); ?>">
	<div class="eronex-row">
		<main class="eronex-main">
			<?php
			/**
			 * Fires to output single content (page or post).
			 *
			 * @since 0.0.1
			 */
			do_action( 'eronex_single_content' );
			?>
		</main>
		<?php if ( 'none' !== $sidebar ) { ?>
			<aside class="eronex-aside eronex-aside-<?php echo esc_attr( $sidebar ); ?>">
				<?php
				/**
				 * Fires to output the sidebar markup.
				 *
				 * @since 0.0.1
				 */
				do_action( 'eronex_sidebar' );
				?>
			</aside>
		<?php } ?>
	</div>
</div>
</div>
<?php
get_footer();
