<?php
/**
 * The template for displaying all single posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
 *
 * @package mediapulse
 * @since 0.1
 */
get_header();
$mediapulse_breadcrumb_banner_enable = get_theme_mod( 'breadcrumb_banner_enable', true ); 
if ( $mediapulse_breadcrumb_banner_enable == true ) {
	get_template_part('breadcrums'); 
} 
$mediapulse_news_single_layout = get_theme_mod( 'single_layout', "right" ); ?>

<!-- News With Sidebar Start -->
    <div class="container-fluid py-3" id="content">
        <div class="container-fluid px-md-5">
            <div class="row">
			<?php if( $mediapulse_news_single_layout == "left" ) : ?>
				<div class="col-lg-4 pt-3 pt-lg-0">
                    <?php get_sidebar(); ?>
                </div>
				<?php endif; 
				if ( $mediapulse_news_single_layout == "full" ) {
					$mediapulse_div = "12";
				} else {
					$mediapulse_div = "8";
				} ?>
                <div class="col-lg-<?php echo $mediapulse_div; ?>">
                    <!-- News Detail Start -->
					<?php if ( have_posts()): 
					while ( have_posts() ): the_post(); ?>
                    <div class="position-relative single-post-detail mb-3" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                        <?php if ( has_post_thumbnail() ) :
						the_post_thumbnail(); endif; ?>
                        <div class="overlay position-relative bg-light single-content">
                            <div class="mb-3">
                                <?php the_category( ' , ' ); ?>
                                <span class="px-1"><?php esc_html_e('/','mediapulse'); ?></span>
                                <span><?php echo esc_html( get_the_date() ); ?></span>
                            </div>
                            <div>
                                <h3 class="mb-3"><?php the_title(); ?></h3>
                                <p><?php the_content(); ?></p>    
                            </div>
                        </div>
                    </div>
					<?php $args = array(
						'before'           => '<p>' . __( 'Pages:', 'mediapulse' ),
						'after'            => '</p>',
						'link_before'      => '',
						'link_after'       => '',
						'next_or_number'   => 'number',
						'separator'        => ' ',
						'nextpagelink'     => __( 'Next page', 'mediapulse' ),
						'previouspagelink' => __( 'Previous page', 'mediapulse' ),
						'pagelink'         => '%',
						'echo'             => 1
					);
					wp_link_pages( $args ); 
					endwhile; endif; ?>
					
					<?php wp_reset_postdata(); ?>
					
					<div class="single-pagination">
						<div class="previous-link"><?php 
						previous_post_link(); ?></div>
						<div class="next-link">
						<?php next_post_link(); ?> </div>
					</div>
					<div class="bg-light mb-3" style="padding: 30px;">
					<?php 
					if ( comments_open() || get_comments_number() ) :
						comments_template();
					endif; ?>
					</div>
                    <!-- News Detail End --> 
                </div>

                <?php if( $mediapulse_news_single_layout == "right" ) : ?>
				<div class="col-lg-4 pt-3 pt-lg-0">
                    <?php get_sidebar(); ?>
                </div>
				<?php endif; ?>
            </div>
        </div>
    </div>


<?php
get_footer();
?>