<?php
/**
 * Template part for displaying single page
 */

get_header();
?>
<main class="main-wrapper">
    <?php
    $sidebar_position = rivax_get_sidebar_position ('single-page', 'none');

    /* Start the Loop */
    while ( have_posts() ) :
        the_post();

        if($sidebar_position == 'elementor') {
            ?>
            <div class="content-wrapper">
                <?php the_content(); ?>
            </div>
            <?php
        }
        else {
            ?>
            <div class="content-wrapper">
                <div class="rs-p-1"></div>
                <div class="rs-container">
                    <div class="rs-row page-content-wrapper <?php echo 'sidebar-' . $sidebar_position; ?>">
                        <div class="content-container">
                            <article id="post-<?php the_ID(); ?>" <?php post_class( 'single-content' ); ?> >
                                <h1 class="single-page-title"><?php the_title(); ?></h1>
                                <?php the_content(); ?>
                                <?php wp_link_pages(); ?>
                            </article>
                            <?php comments_template(); ?>
                        </div>
                        <?php if($sidebar_position == 'left' || $sidebar_position == 'right'): ?>
	                        <?php get_sidebar(); ?>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
            <?php
        }
    endwhile; // End of the loop.
    ?>
</main>
<?php
get_footer();
