<?php
/**
 * The template for displaying all single posts.
 *
 * @package daisy
 */

get_header(); ?>
<div id="tf-content">
	<div class="container"><!-- Container -->
		<div class="row" data-sticky_parent=""><!-- Row -->
			<?php
				if( get_theme_mod('rst_post_layout') ){	
					$post_layout = get_theme_mod('rst_post_layout');
				}else{
					$post_layout = get_theme_mod('rst_general_layout') ? get_theme_mod('rst_general_layout') : 1;
				}
				$template_style = rs::getField('rst_template_style') != 0 ? rs::getField('rst_template_style') : $post_layout;

				$class = "";
				if( $template_style == 1 ) {
					$class .= 'col-md-12 rst-content-wrap';
				}
				if( $template_style == 2 ) {
					$class .= 'col-md-8 pull-right has-sidebar-left';
				}
				if( $template_style == 3 ) {
					$class .= 'col-md-8 pull-left has-sidebar-right';
				}
			?>
			<div class="<?php echo esc_attr($class) ?>"> <!-- Left Content for Blog Posts -->

				<?php while ( have_posts() ) : the_post(); ?>

					<?php get_template_part( 'content', 'single' ); ?>

					<?php
						// If comments are open or we have at least one comment, load up the comment template.
						if ( (comments_open() || get_comments_number()) && ! get_theme_mod('singe_hide_comment') ) :
							comments_template();
						endif;
					?>

				<?php endwhile; // End of the loop. ?>

				
			</div><!-- #primary -->
			<?php
				if( $template_style == 2 || $template_style == 3 ) {
					get_sidebar();
				}
			?>
		</div><!-- end Row -->
	</div><!-- End Container -->
</div>
<?php get_footer(); ?>
