<?php
get_header();
include get_template_directory() . '/inc/menus/menu.php';
?>
<main role="main">
<?php 
// Store original post before any modifications
global $post;
$original_post = $post;
?>
<?php if ( has_post_thumbnail() ) : ?>
<section class="single-hero">
    <?php if (has_post_thumbnail()) : ?>
        <?php the_post_thumbnail('full', ['class' => 'single-hero-bg']); ?>
    <?php endif; ?>

    <div class="single-hero-content">
        <h1 class="single-hero-title"><?php the_title(); ?></h1>
    </div>
</section>

<?php endif; ?>


 <?php 
    // Reset to original post
    $post = $original_post;
    setup_postdata($post);
    
    if (have_posts()): while (have_posts()) : the_post(); ?>
        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
            <?php the_content(); ?>
        </article>
    <?php endwhile; ?>
    <?php else: ?>
        <article>
            <h2><?php _e('Sorry, nothing to display.', 'kipya'); ?></h2>
        </article>
    <?php endif; ?>
    <?php edit_post_link(); ?>
</main>
<?php get_footer(); ?>