<?php
/**
 * Default Template 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' );
$layout = ( $layout ) ? $layout : 'right';
$sidebar = ( $sidebar ) ? $sidebar : 'default-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';
?>

<?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 ); ?>">
				<div class="news-detail">
					<div class="thm-unit-test">
							
						<?php while ( have_posts() ): the_post(); ?>
							<?php the_content(); ?>
						<?php endwhile; ?>
						
						<div class="clearfix"></div>
						<?php
						$defaults = array(
							'before' => '<div class="paginate-links">' . esc_html__( 'Pages:', 'roonix' ),
							'after'  => '</div>',
		
						);
						wp_link_pages( $defaults );
						?>
						<?php comments_template() ?>
					 
					 </div>
				</div>
            </div>
            <?php
				if ( $layout == 'right' ) {
					$data->set('sidebar', 'default-sidebar');
					do_action( 'roonix_sidebar', $data );
				}
            ?>
        
        </div>
	</div>
</div><!-- blog section with pagination -->
<?php get_footer(); ?>
