<?php
/**
 * Blog Post Main File.
 *
 * @package ROONIX
 * @author  Themexriver
 * @version 1.0
 */

get_header();
$data    = \ROONIX\Includes\Classes\Common::instance()->data( 'single' )->get();
$layout = $data->get( 'layout' );
$sidebar = $data->get( 'sidebar' );
if (is_active_sidebar( $sidebar )) {$layout = 'right';} else{$layout = 'full';}
$class = ( !$layout || $layout == 'full' ) ? 'col-xs-12 col-sm-12 col-md-12 col-lg-12' : 'col-lg-8 col-md-12 col-sm-12';
$options = roonix_WSH()->option();

if ( class_exists( '\Elementor\Plugin' ) && $data->get( 'tpl-type' ) == 'e') {
	
	while(have_posts()) {
	   the_post();
	   the_content();
    }

} else {
?>

<?php if ( class_exists( '\Elementor\Plugin' )):?>
	<?php do_action( 'roonix_banner', $data );?>
<?php else:?>

<section class="page-title" style="background-image: url(<?php echo esc_url( $data->get( 'banner' ) ); ?>)">
    <div class="auto-container">
        <h2><?php if( $data->get( 'title' ) ) echo wp_kses( $data->get( 'title' ), true ); else( the_title( '' ) ); ?></h2>
        <ul class="bread-crumb clearfix">
            <?php echo roonix_the_breadcrumb(); ?>
        </ul>
    </div>
    <!-- Scroll To Down -->
    <div class="scroll-to-down scroll-to-target" data-target=".services-page-section"><span class="flaticon-down-arrow-1"></span></div>
</section>

<?php endif;?>

<!-- sidebar-page-container -->
<div class="sidebar-page-container">
    <div class="auto-container">
        <div class="row clearfix">
        	<?php
				if ( $data->get( 'layout' ) == 'left' ) {
					do_action( 'roonix_sidebar', $data );
				}
			?>
            <div class="content-side <?php echo esc_attr( $class ); ?>">
            	
				<?php while ( have_posts() ) : the_post(); ?>				
                <div class="news-detail">                	
                    <div class="thm-unit-test">
                    
                        <div class="inner-box">
                            <?php if(has_post_thumbnail()){ ?>
                            <div class="image">
                                <?php the_post_thumbnail('full'); ?>
                            </div>
                            <?php } ?>
                            <div class="lower-content">
                                <?php if(! $options->get( 'single_post_date' ) || $options->get( 'single_post_author' ) || $options->get( 'single_post_comments' )  ){ ?>
                                <ul class="post-meta m-b25">
                                    <?php if(! $options->get( 'single_post_date' ) ){ ?><li><span class="flaticon-calendar"></span> <?php echo get_the_date(); ?></li><?php } ?>
                                    <?php if(! $options->get( 'single_post_author' ) ){ ?><li><span class="flaticon-user-3"></span> <?php the_author(); ?></li><?php } ?>
                                    <?php if(! $options->get( 'single_post_comments' ) ){ ?><li><span class="flaticon-bubble-chat"></span> <?php comments_number( wp_kses(__('0 Comments' , 'roonix'), true), wp_kses(__('1 Comment' , 'roonix'), true), wp_kses(__('% Comments' , 'roonix'), true)); ?></li><?php } ?>
                                </ul>
                                <?php } ?>
                                
								<div class="text"><?php the_content(); ?></div>
                                <div class="clearfix"></div>
                                <?php wp_link_pages(array('before'=>'<div class="paginate-links m-t30">'.esc_html__('Pages: ', 'roonix'), 'after' => '</div>', 'link_before'=>'<span>', 'link_after'=>'</span>')); ?>
                            
                            </div>
                            
                            <?php if( has_tag() ):?>
                            <!-- Post Share Options-->
                            <div class="post-share-options">
                                <div class="post-share-inner clearfix">
                                    <div class="tags">
                                        <span class="tags"><?php esc_html_e('Tags:', 'roonix'); ?></span>
                                        <?php the_tags( '', '', '' ); ?>
                                    </div>
                                </div>
                            </div>
                            <!-- End Post Share Options-->
                            <?php endif;?>
                            
                            <?php comments_template(); ?>
                        </div>
   
                	</div>
					<!--End thm-unit-test-->
                </div>
                <!--End blog-content-->
				<?php endwhile; ?>
                
            </div>
        	<?php
				if ( $data->get( 'layout' ) == 'right' ) {
					do_action( 'roonix_sidebar', $data );
				}
			?>
        </div>
    </div>
</div>
<!--End blog area--> 

<?php
}
get_footer();
