<?php
/**
 * The template for displaying all single moment
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
 *
 * @package pix
 */

get_header();
$nav_h = cls_nav_height();
?>

<div class="pix-content home-box home-classic">
	<div class="uk-flex-center uk-grid-collapse" uk-grid>

	<?php if(is_active_sidebar( 'moment-left' ) && get_cu('cls_left_wid',false) ){ ?>	
        <div class="left uk-width-expand">			
            <div class="widget_inner moment_left_inner">
                <?php dynamic_sidebar( 'moment-left' ); ?>  
            </div>	
        </div>			
    <?php } ?>

	<div class="center-content<?php 
        $left = is_active_sidebar( 'moment-left' ) && get_cu('cls_left_wid',false);
        $right = is_active_sidebar( 'moment-right' ) && get_cu('cls_right_wid',false);
        if(!$left && !$right) echo ' uk-width-expand';
        elseif(!$left || !$right) echo ' center-half';
    ?>">
		<div id="primary" class="site-main">

		<div class="cls-banner">
                <?php echo Classic_mod::banner_info(); ?>
                <img data-src="<?php echo THEME_DEFAULT_URL ?>" uk-img="loading: lazy">
            </div>

		<div class="single-wrap">
			<?php
			while ( have_posts() ) :
				the_post();

				get_template_part( 'tpl/single','moment');


				// 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.
			?>
		</div>

		</div><!-- #main -->
	</div>	

	<?php if(is_active_sidebar( 'moment-right' ) && get_cu('cls_right_wid',false) ){ ?>		
        <div class="right uk-width-expand">		
            <div class="widget_inner moment_right_inner">
                <?php dynamic_sidebar( 'moment-right' ); ?>
            </div>	
        </div>			
    <?php } ?>	

	</div>
</div>
<?php
get_footer();
