<?php
// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}

// Get the current post ID
$post_id = get_the_ID();

// Get post title
$title = get_the_title($post_id);

// Get post content
$content = get_the_content(null, false, $post_id);

// Get categories
$categories = get_the_terms($post_id, 'aump_portfolio_category');

get_header();
?>

<div class="aump_single-portfolio">
    <?php if (has_post_thumbnail($post_id)) : ?>
        <div class="aump_featured-image-wrapper">
            <?php echo get_the_post_thumbnail($post_id, 'full', ['class' => 'aump_featured-image']); ?>
        </div>
    <?php endif; ?>

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

        <?php if (!empty($categories) && !is_wp_error($categories)) : ?>
            <div class="aump_portfolio-categories">
                <strong><?php echo esc_html(__('Categories:', 'advanced-universal-modern-portfolio-and-gallery')); ?></strong>
                <?php foreach ($categories as $category) : ?>
                    <span class="aump_category"><?php echo esc_html($category->name); ?></span>
                <?php endforeach; ?>
            </div>
        <?php endif; ?>

        <div class="aump_portfolio-description">
            <?php echo wp_kses_post($content); ?>
        </div>
    </div>
</div>

<?php get_footer(); ?>