HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //var/www/html/WPSassoon/wp-content/themes/sassoon/single-deal.php
<?php
get_header();
?>

<div class="tombstone-detail-container" style="max-width:900px; margin:0 auto; padding:20px;">

    <?php
    if (have_posts()) :
        while (have_posts()) : the_post();

            $post_id = get_the_ID();
            $title = get_the_title();
            $content = get_the_content();
            $thumbnail = has_post_thumbnail() ? get_the_post_thumbnail($post_id, 'large') : '';
            $categories = get_the_terms($post_id, 'tombstone_category');
    ?>

    <div class="tombstone-detail">
        <h1><?php echo esc_html($title); ?></h1>

        <?php if ($thumbnail): ?>
            <div class="tombstone-image"><?php echo $thumbnail; ?></div>
        <?php endif; ?>

        <div class="tombstone-categories">
            <?php if (!empty($categories) && !is_wp_error($categories)) : ?>
                <strong>Category:</strong>
                <?php
                    $cats = [];
                    foreach ($categories as $cat) {
                        $cats[] = esc_html($cat->name);
                    }
                    echo implode(', ', $cats);
                ?>
            <?php endif; ?>
        </div>

        <div class="tombstone-content" style="margin-top:15px;">
            <?php echo wp_kses_post($content); ?>
        </div>

    </div>

    <?php
        endwhile;
    endif;
    ?>

</div>

<?php
get_footer();