<?php
/**
 * The template for displaying singular post-types: posts, pages and user-defined custom post types.
 *
 * 
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

get_header();

$globalFields = get_fields('option');
$pageFields = get_fields();

$headingBlog = $globalFields['heading_blog'];

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

<div id="single" <?php post_class( 'single-wrapper' ); ?>>
	<div class="container">
        <div class="single-head">
            <?php if (!empty($headingBlog)) { ?>
                <h2 class="heading-section"><?php echo $headingBlog; ?></h2>
            <?php } ?>
        </div>
        <div class="single-wrap">
            <div class="single-main">
                <div class="single-header">
                    <?php if ( !empty( get_the_post_thumbnail_url( get_the_ID() ) ) ) { ?>
                        <div class="single-thumbnail">
                            <?php echo get_the_post_thumbnail( get_the_ID(), 'full' ); ?>
                        </div>
                    <?php } ?>
                    <div class="single-date"><?php echo get_the_date( 'j F Y' ); ?></div>
                    <?php the_title( '<h1 class="single-title">', '</h1>' ); ?>
                </div>
                <div class="single-content">
                    <?php the_content(); ?>
                </div>
                <?php //comments_template(); ?>
            </div>
            <div class="single-widget">
                <div class="widget-wrapper">
                    <h6 class="widget-heading"><?php echo __( 'Recent Posts', 'hello-thedavanigroup' ); ?></h6>
                    <?php tdg_recent_posts_function(); ?>
                </div>
            </div>
        </div>
	</div>
</div>

	<?php
endwhile;


get_footer();
