<?php
/**
 * The template for displaying all single posts.
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
 *
 * @package Edumodo
 */
	$post_id = edumodo_get_id();

	// Prefix
	$prefix = '_edumodo_';
	$title_enable = get_post_meta($post_id, $prefix . 'title_enable', true);
	
	$notice_sidebar_single  		= edumodo_get_theme_mod('edumodo_single_notice_layout', 'right-sidebar');

	// view counter
	setPostViews(get_the_ID());

get_header(); 
?>
	<div id="primary" class="content-area notice tx-notice-single">
		<main id="main" class="site-main">
			<div class="content-wrap">
				<div class="container">
					<div class="row">

						<?php if ('left-sidebar' == $notice_sidebar_single): ?>
							<div class="col-md-4">
								<?php get_sidebar(); ?>
							</div> 
						<?php endif; ?>

						<?php if ('no-sidebar' == $notice_sidebar_single): ?>
							<div class="col-md-12">
						<?php else: ?>
							<div class="col-md-8 content-wrapper">
						<?php endif; ?>

							<?php 
								$notice = array(
									'post_type'         => 'notice',
									'post_status'       => 'publish',
									'ignore_sticky_posts' => 1
								);
							?>
								
							<?php
								while ( have_posts() ) : the_post();

									get_template_part( 'template-parts/content-single', 'notice');

										// 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>

						<?php if ('right-sidebar' == $notice_sidebar_single): ?>
							<div class="col-md-4">
								<?php get_sidebar(); ?>
							</div>
							
						<?php elseif('no-sidebar' == $notice_sidebar_single): ?>

						<?php else: ?>
							<div class="col-md-4 sidebar-wrapper-2">
								<?php get_sidebar(); ?>
							</div> 
						<?php endif; ?>

					</div><!-- /.row -->
				</div><!-- /.container -->
			</div>
		</main><!-- #main -->
	</div><!-- #primary -->

<?php
get_footer();
