<?php
/**
 * The template for displaying all single posts.
 *
 * @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' );
$single_container  = eronex_option( 'eronex_single_container_layout', $general_container );
$single_container  = ! empty( $single_container ) ? $single_container : $general_container;
$meta_container    = get_post_meta( $p_id, 'eronex_container_layout', true );
$container         = ! empty( $meta_container ) ? $meta_container : $single_container;

$general_sidebar = eronex_option( 'eronex_sidebar_layout', 'right' );
$single_sidebar  = eronex_option( 'eronex_single_sidebar_layout', $general_sidebar );
$meta_sidebar    = get_post_meta( $p_id, 'eronex_sidebar_layout', true );
$sidebar         = ! empty( $meta_sidebar ) ? $meta_sidebar : $single_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 && is_singular('post') ) { ?>
				<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();
