<?php
/**
 * The template for displaying all single posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
 *
 * @package freelancer-resume
 */

get_header();
?>

<main id="primary" class="site-main singlepage">
<div class="banner-head">
    <div class="header-img">
        <?php
        if ( has_post_thumbnail() ) {
            the_post_thumbnail( 'full', array( 'class' => 'header-image' ) );
        }
        ?>
    </div>
    <header class="entry-header">
                        <?php the_title('<h1 class="entry-title">', '</h1>'); ?>
                        <div class="archive-info mb-3">
                            <span class="date">
                                <?php echo esc_html__('Published on:', 'freelancer-resume'); ?>
                                <?php the_time('F j, Y'); ?>
                            </span>
                            <span class="author">
                                <?php echo esc_html__('by', 'freelancer-resume'); ?>
                                <?php the_author(); ?>
                            </span>
                        </div>
                    </header>
</div>

    <div class="blog-div container-fluid p-5" id="primaryid">
        <div class="row">
            <div class="col-lg-12 col-md-12 col-12">
                <article id="post <?php the_ID(); ?>" <?php post_class(); ?>>
                    <!-- <header class="entry-header">
                        </?php the_title('<h1 class="entry-title">', '</h1>'); ?>
                        <div class="archive-info mb-3">
                            <span class="date">
                                </?php echo esc_html__('Published on:', 'freelancer-resume'); ?>
                                </?php the_time('F j, Y'); ?>
                            </span>
                            <span class="author">
                                </?php echo esc_html__('by', 'freelancer-resume'); ?>
                                </?php the_author(); ?>
                            </span>
                        </div>
                    </header> -->
                    <div class="row">
                        <div class="entry-content col-lg-9 col-md-8 col-12">
                            <div class="row">
                                <div class="col-lg-6 col-md-6 col-12">
                                    <?php
                                    // Exclude the featured image from the content
                                    echo wp_kses_post(get_the_content());
                                    ?>
                                    <!-- <div class="pt-3"></div> -->

                                </div>
                                <div class="col-lg-6 col-md-6 col-12 position-relative">
                                    <!-- /////////// -->
                                    <?php
                                    if (has_post_thumbnail()) {
                                        the_post_thumbnail('full'); // You can specify the image size here
                                    }
                                    ?>
                                </div>
                            </div>
                            <!-- //////// comment box -->
                            <div class="pt-3">
                                <?php
                                while (have_posts()):
                                    the_post();
                                    //   get_template_part( 'template-parts/content', get_post_type() );
                                    // 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>
                        </div>
                        <div class="col-lg-3 col-md-4 col-12 single_sidebar">
                            <?php
                            // The Loop
                            if (have_posts()):
                                while (have_posts()):
                                    the_post();

                                    // Your single post content here
                            
                                endwhile;
                            endif;

                            // Display the custom sidebar
                            if (is_active_sidebar('sidebar-1')) {
                                dynamic_sidebar('sidebar-1');
                            } else {
                                get_sidebar();
                            }
                            ?>
                        </div>
                    </div>
            </div>
        </div>
        <?php
        the_post_navigation(
            array(
                'prev_text' => '<span class="nav-subtitle">' . esc_html__('Previous:', 'freelancer-resume') . '</span> <span class="">%title</span>',
                'next_text' => '<span class="nav-subtitle">' . esc_html__('Next:', 'freelancer-resume') . '</span> <span class="">%title</span>',
            )
        );
        ?>
    </div>


    <footer class="entry-footer">
        <?php
        ?>
    </footer>
    </article><!-- #post-<?php the_ID(); ?> -->

    </div>
    </div>

</main><!-- #main -->


<?php
get_footer();