This commit is contained in:
IGNY8 VPS (Salman)
2026-01-10 07:04:24 +00:00
parent be2c190eca
commit ceee9ba34d
8 changed files with 269 additions and 75 deletions

View File

@@ -11,25 +11,12 @@ if (!defined('ABSPATH')) {
exit;
}
$status_label = igny8_format_status_label($status);
$status_class = igny8_get_status_class($status);
?>
<div class="igny8-header">
<!-- Back Button -->
<div class="igny8-header-back">
<a href="<?php echo esc_url(get_post_type_archive_link('post')); ?>" class="igny8-back-button">
<span class="igny8-back-icon">←</span>
<span>Back to Posts</span>
</a>
</div>
<!-- Title & Status -->
<!-- Title -->
<div class="igny8-header-title-row">
<h1 class="igny8-title"><?php the_title(); ?></h1>
<span class="igny8-status-badge <?php echo esc_attr($status_class); ?>">
<?php echo esc_html($status_label); ?>
</span>
</div>
<!-- Metadata Row -->
@@ -64,17 +51,33 @@ $status_class = igny8_get_status_class($status);
</div>
<!-- Topic (Cluster Name) -->
<?php if ($cluster_name): ?>
<?php if ($cluster_name):
// Try to find a tag or category matching the cluster name for linking
$cluster_link = '';
$cluster_tag = get_term_by('name', $cluster_name, 'post_tag');
if ($cluster_tag) {
$cluster_link = get_term_link($cluster_tag);
} else {
$cluster_cat = get_term_by('name', $cluster_name, 'category');
if ($cluster_cat) {
$cluster_link = get_term_link($cluster_cat);
}
}
?>
<div class="igny8-meta-item">
<svg class="igny8-icon" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z"/>
</svg>
<span class="igny8-meta-label">Topic:</span>
<span class="igny8-meta-value"><?php echo esc_html($cluster_name); ?></span>
<?php if ($cluster_link && !is_wp_error($cluster_link)): ?>
<a href="<?php echo esc_url($cluster_link); ?>" class="igny8-meta-value igny8-clickable-link"><?php echo esc_html($cluster_name); ?></a>
<?php else: ?>
<span class="igny8-meta-value"><?php echo esc_html($cluster_name); ?></span>
<?php endif; ?>
</div>
<?php endif; ?>
<!-- Categories -->
<!-- Categories (with hierarchy) -->
<?php if ($categories && !is_wp_error($categories)): ?>
<div class="igny8-meta-item">
<svg class="igny8-icon" viewBox="0 0 20 20" fill="currentColor">
@@ -82,23 +85,35 @@ $status_class = igny8_get_status_class($status);
</svg>
<span class="igny8-meta-label">Categories:</span>
<div class="igny8-meta-badges">
<?php foreach ($categories as $cat): ?>
<span class="igny8-category-badge"><?php echo esc_html($cat->name); ?></span>
<?php foreach ($categories as $cat):
// Build full hierarchy path
$hierarchy = [];
$current_cat = $cat;
while ($current_cat) {
array_unshift($hierarchy, $current_cat);
$current_cat = $current_cat->parent ? get_category($current_cat->parent) : null;
}
?>
<a href="<?php echo esc_url(get_category_link($cat->term_id)); ?>" class="igny8-category-badge igny8-clickable-badge">
<?php echo esc_html(implode(' ', array_map(function($c) { return $c->name; }, $hierarchy))); ?>
</a>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<!-- Tags -->
<?php if ($tags && !is_wp_error($tags)): ?>
<!-- Tags (limit to 5) -->
<?php if ($tags && !is_wp_error($tags)):
$tags_to_show = array_slice($tags, 0, 5);
?>
<div class="igny8-meta-item">
<svg class="igny8-icon" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M17.707 9.293a1 1 0 010 1.414l-7 7a1 1 0 01-1.414 0l-7-7A.997.997 0 012 10V5a3 3 0 013-3h5c.256 0 .512.098.707.293l7 7zM5 6a1 1 0 100-2 1 1 0 000 2z"/>
</svg>
<span class="igny8-meta-label">Tags:</span>
<div class="igny8-meta-badges">
<?php foreach ($tags as $tag): ?>
<span class="igny8-tag-badge"><?php echo esc_html($tag->name); ?></span>
<?php foreach ($tags_to_show as $tag): ?>
<a href="<?php echo esc_url(get_tag_link($tag->term_id)); ?>" class="igny8-tag-badge igny8-clickable-badge"><?php echo esc_html($tag->name); ?></a>
<?php endforeach; ?>
</div>
</div>