revert to last healthy
This commit is contained in:
@@ -33,37 +33,11 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2
|
||||
<div class="igny8-content-body">
|
||||
|
||||
<!-- Introduction (content before first H2) -->
|
||||
<?php if (!empty($parsed_content['intro'])):
|
||||
// Generate TOC for intro section
|
||||
$toc_items = igny8_generate_table_of_contents($content);
|
||||
$min_headings = get_option('igny8_toc_min_headings', 3);
|
||||
$show_toc = count($toc_items) >= $min_headings;
|
||||
?>
|
||||
<?php if (!empty($parsed_content['intro'])): ?>
|
||||
<section class="igny8-intro-section">
|
||||
<div class="igny8-intro-layout">
|
||||
<?php if ($show_toc): ?>
|
||||
<nav class="igny8-intro-toc">
|
||||
<div class="igny8-toc-header">
|
||||
<svg class="igny8-toc-icon" viewBox="0 0 20 20" fill="currentColor">
|
||||
<path d="M9 4.804A7.968 7.968 0 005.5 4c-1.255 0-2.443.29-3.5.804v10A7.969 7.969 0 015.5 14c1.669 0 3.218.51 4.5 1.385A7.962 7.962 0 0114.5 14c1.255 0 2.443.29 3.5.804v-10A7.968 7.968 0 0014.5 4c-1.255 0-2.443.29-3.5.804V12a1 1 0 11-2 0V4.804z"/>
|
||||
</svg>
|
||||
<h3>Table of Contents</h3>
|
||||
</div>
|
||||
<ol class="igny8-toc-list">
|
||||
<?php foreach ($toc_items as $item): ?>
|
||||
<li class="igny8-toc-item">
|
||||
<a href="#<?php echo esc_attr($item['id']); ?>" class="igny8-toc-link">
|
||||
<span class="igny8-toc-number"><?php echo $item['number']; ?></span>
|
||||
<span class="igny8-toc-text"><?php echo esc_html($item['text']); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
<div class="igny8-intro-content">
|
||||
<?php echo $parsed_content['intro']; ?>
|
||||
</div>
|
||||
<div class="igny8-section-label">Opening Narrative</div>
|
||||
<div class="igny8-prose">
|
||||
<?php echo $parsed_content['intro']; ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
@@ -78,13 +52,15 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2
|
||||
<span class="igny8-section-number"><?php echo $index + 1; ?></span>
|
||||
<div class="igny8-section-heading-wrapper">
|
||||
<?php
|
||||
// Get section badge (only 1, no repeats)
|
||||
// Get section badges based on keyword/tag matching
|
||||
$badges = igny8_get_section_badges($section['heading'], get_the_ID());
|
||||
if (!empty($badges) && isset($badges[0])): ?>
|
||||
if (!empty($badges)): ?>
|
||||
<div class="igny8-section-badges">
|
||||
<span class="igny8-section-badge igny8-section-badge-primary">
|
||||
<?php echo esc_html($badges[0]['text']); ?>
|
||||
</span>
|
||||
<?php foreach ($badges as $badge_index => $badge): ?>
|
||||
<span class="igny8-section-badge <?php echo $badge_index === 0 ? 'igny8-section-badge-primary' : 'igny8-section-badge-secondary'; ?>">
|
||||
<?php echo esc_html($badge['text']); ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<h2 class="igny8-section-heading"><?php echo esc_html($section['heading']); ?></h2>
|
||||
@@ -152,14 +128,15 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2
|
||||
}
|
||||
?>
|
||||
<div class="igny8-section-content">
|
||||
<figure class="igny8-image-figure igny8-image-card">
|
||||
<figure class="igny8-image-figure">
|
||||
<img src="<?php echo esc_url($img_url); ?>"
|
||||
alt="<?php echo esc_attr($section['heading']); ?>"
|
||||
class="<?php echo esc_attr($img_class); ?>"
|
||||
loading="lazy">
|
||||
<?php if ($show_description && $img_prompt): ?>
|
||||
<figcaption class="igny8-image-caption">
|
||||
<?php echo esc_html($img_prompt); ?>
|
||||
<p class="igny8-caption-label">Visual Direction</p>
|
||||
<p class="igny8-caption-text"><?php echo esc_html($img_prompt); ?></p>
|
||||
</figcaption>
|
||||
<?php endif; ?>
|
||||
</figure>
|
||||
@@ -184,16 +161,11 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2
|
||||
loading="lazy">
|
||||
<?php if ($show_description && $img_prompt): ?>
|
||||
<figcaption class="igny8-image-caption">
|
||||
<?php echo esc_html($img_prompt); ?>
|
||||
<p class="igny8-caption-label">Visual Direction</p>
|
||||
<p class="igny8-caption-text"><?php echo esc_html($img_prompt); ?></p>
|
||||
</figcaption>
|
||||
<?php endif; ?>
|
||||
</figure>
|
||||
<?php
|
||||
// Render TOC in section 1 after image
|
||||
if ($index === 0) {
|
||||
include plugin_dir_path(dirname(__FILE__)) . 'igny8-table-of-contents.php';
|
||||
}
|
||||
?>
|
||||
<div class="igny8-prose">
|
||||
<?php echo $section['content']; ?>
|
||||
</div>
|
||||
@@ -212,14 +184,15 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2
|
||||
}
|
||||
?>
|
||||
<div class="igny8-section-content">
|
||||
<figure class="igny8-image-figure igny8-image-card">
|
||||
<figure class="igny8-image-figure">
|
||||
<img src="<?php echo esc_url($img_url); ?>"
|
||||
alt="<?php echo esc_attr($section['heading']); ?>"
|
||||
class="<?php echo esc_attr($img_class); ?>"
|
||||
loading="lazy">
|
||||
<?php if ($show_description && $img_prompt): ?>
|
||||
<figcaption class="igny8-image-caption">
|
||||
<?php echo esc_html($img_prompt); ?>
|
||||
<p class="igny8-caption-label">Visual Direction</p>
|
||||
<p class="igny8-caption-text"><?php echo esc_html($img_prompt); ?></p>
|
||||
</figcaption>
|
||||
<?php endif; ?>
|
||||
</figure>
|
||||
|
||||
@@ -20,10 +20,22 @@ if (!$image_url) {
|
||||
?>
|
||||
|
||||
<div class="igny8-featured-image-block">
|
||||
<figure class="igny8-image-figure igny8-image-card">
|
||||
<div class="igny8-featured-header">
|
||||
<span class="igny8-featured-label">Featured Visual</span>
|
||||
</div>
|
||||
|
||||
<div class="igny8-featured-image-wrapper">
|
||||
<img src="<?php echo esc_url($image_url); ?>"
|
||||
alt="<?php echo esc_attr($image_alt ?: get_the_title()); ?>"
|
||||
class="igny8-featured-image igny8-image-landscape"
|
||||
style="max-width: 1024px;"
|
||||
loading="lazy">
|
||||
</figure>
|
||||
</div>
|
||||
|
||||
<?php if ($featured_image_prompt): ?>
|
||||
<div class="igny8-image-prompt">
|
||||
<p class="igny8-prompt-label">AI Image Prompt</p>
|
||||
<p class="igny8-prompt-text"><?php echo esc_html($featured_image_prompt); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
@@ -16,9 +16,20 @@ $status_class = igny8_get_status_class($status);
|
||||
?>
|
||||
|
||||
<div class="igny8-header">
|
||||
<!-- Title -->
|
||||
<!-- 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 -->
|
||||
<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 -->
|
||||
@@ -53,21 +64,13 @@ $status_class = igny8_get_status_class($status);
|
||||
</div>
|
||||
|
||||
<!-- Topic (Cluster Name) -->
|
||||
<?php if ($cluster_name):
|
||||
// Get cluster term for link
|
||||
$cluster_terms = get_the_terms(get_the_ID(), 'igny8_clusters');
|
||||
$cluster_link = (!empty($cluster_terms) && !is_wp_error($cluster_terms)) ? get_term_link($cluster_terms[0]) : '';
|
||||
?>
|
||||
<?php if ($cluster_name): ?>
|
||||
<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>
|
||||
<?php if ($cluster_link): ?>
|
||||
<a href="<?php echo esc_url($cluster_link); ?>" class="igny8-meta-link"><?php echo esc_html($cluster_name); ?></a>
|
||||
<?php else: ?>
|
||||
<span class="igny8-meta-value"><?php echo esc_html($cluster_name); ?></span>
|
||||
<?php endif; ?>
|
||||
<span class="igny8-meta-value"><?php echo esc_html($cluster_name); ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -79,18 +82,8 @@ $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):
|
||||
// Build hierarchy path (Parent > Child)
|
||||
$cat_hierarchy = [];
|
||||
$current_cat = $cat;
|
||||
while ($current_cat) {
|
||||
array_unshift($cat_hierarchy, $current_cat);
|
||||
$current_cat = ($current_cat->parent > 0) ? get_category($current_cat->parent) : null;
|
||||
}
|
||||
$hierarchy_text = implode(' > ', array_map(function($c) { return $c->name; }, $cat_hierarchy));
|
||||
?>
|
||||
<a href="<?php echo esc_url(get_category_link($cat->term_id)); ?>" class="igny8-category-badge"><?php echo esc_html($hierarchy_text); ?></a>
|
||||
<?php foreach ($categories as $cat): ?>
|
||||
<span class="igny8-category-badge"><?php echo esc_html($cat->name); ?></span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -104,12 +97,8 @@ $status_class = igny8_get_status_class($status);
|
||||
</svg>
|
||||
<span class="igny8-meta-label">Tags:</span>
|
||||
<div class="igny8-meta-badges">
|
||||
<?php
|
||||
// Get only tags assigned to the post (not keywords)
|
||||
$post_tags = wp_get_post_tags(get_the_ID());
|
||||
foreach ($post_tags as $tag):
|
||||
?>
|
||||
<a href="<?php echo esc_url(get_tag_link($tag->term_id)); ?>" class="igny8-tag-badge"><?php echo esc_html($tag->name); ?></a>
|
||||
<?php foreach ($tags as $tag): ?>
|
||||
<span class="igny8-tag-badge"><?php echo esc_html($tag->name); ?></span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user