1.3.1
This commit is contained in:
@@ -169,15 +169,16 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
// Square image (left or right aligned)
|
||||
// Square image (left or right aligned) - 2 column layout
|
||||
elseif ($img_url && $img_type === 'square') {
|
||||
$img_class = 'igny8-image-square-' . $img_align;
|
||||
if (!$show_description) {
|
||||
$img_class .= ' igny8-image-reuse';
|
||||
}
|
||||
$section_class = 'igny8-section-content igny8-has-square-image igny8-image-' . $img_align;
|
||||
?>
|
||||
<div class="igny8-section-content">
|
||||
<figure class="igny8-image-figure <?php echo esc_attr($img_class); ?>">
|
||||
<div class="<?php echo esc_attr($section_class); ?>">
|
||||
<figure class="igny8-image-figure">
|
||||
<img src="<?php echo esc_url($img_url); ?>"
|
||||
alt="<?php echo esc_attr($section['heading']); ?>"
|
||||
class="igny8-in-article-image"
|
||||
@@ -191,10 +192,6 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2
|
||||
<div class="igny8-prose">
|
||||
<?php echo $section['content']; ?>
|
||||
</div>
|
||||
<?php
|
||||
// Widget placeholder below square images
|
||||
igny8_render_widget_placeholder($img_align, $index);
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -52,14 +52,16 @@ if (!defined('ABSPATH')) {
|
||||
|
||||
<!-- Topic (Cluster Name) -->
|
||||
<?php if ($cluster_name):
|
||||
// Try to find a tag or category matching the cluster name for linking
|
||||
$cluster_link = '';
|
||||
// Create search URL for cluster name as fallback
|
||||
$cluster_link = add_query_arg('s', urlencode($cluster_name), home_url('/'));
|
||||
|
||||
// Try to find a tag or category matching the cluster name
|
||||
$cluster_tag = get_term_by('name', $cluster_name, 'post_tag');
|
||||
if ($cluster_tag) {
|
||||
if ($cluster_tag && !is_wp_error($cluster_tag)) {
|
||||
$cluster_link = get_term_link($cluster_tag);
|
||||
} else {
|
||||
$cluster_cat = get_term_by('name', $cluster_name, 'category');
|
||||
if ($cluster_cat) {
|
||||
if ($cluster_cat && !is_wp_error($cluster_cat)) {
|
||||
$cluster_link = get_term_link($cluster_cat);
|
||||
}
|
||||
}
|
||||
@@ -69,15 +71,11 @@ if (!defined('ABSPATH')) {
|
||||
<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 && !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; ?>
|
||||
<a href="<?php echo esc_url($cluster_link); ?>" class="igny8-meta-value igny8-clickable-link"><?php echo esc_html($cluster_name); ?></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Categories (with hierarchy) -->
|
||||
<!-- Categories (each level separately clickable) -->
|
||||
<?php if ($categories && !is_wp_error($categories)): ?>
|
||||
<div class="igny8-meta-item">
|
||||
<svg class="igny8-icon" viewBox="0 0 20 20" fill="currentColor">
|
||||
@@ -86,17 +84,23 @@ if (!defined('ABSPATH')) {
|
||||
<span class="igny8-meta-label">Categories:</span>
|
||||
<div class="igny8-meta-badges">
|
||||
<?php foreach ($categories as $cat):
|
||||
// Build full hierarchy path
|
||||
// Build full hierarchy path with each level clickable
|
||||
$hierarchy = [];
|
||||
$current_cat = $cat;
|
||||
while ($current_cat) {
|
||||
array_unshift($hierarchy, $current_cat);
|
||||
$current_cat = $current_cat->parent ? get_category($current_cat->parent) : null;
|
||||
}
|
||||
|
||||
// Output each category in hierarchy as separate clickable link
|
||||
$hierarchy_links = [];
|
||||
foreach ($hierarchy as $h_cat) {
|
||||
$hierarchy_links[] = '<a href="' . esc_url(get_category_link($h_cat->term_id)) . '" class="igny8-category-link">' . esc_html($h_cat->name) . '</a>';
|
||||
}
|
||||
?>
|
||||
<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>
|
||||
<span class="igny8-category-badge">
|
||||
<?php echo implode(' <span class="igny8-cat-separator">›</span> ', $hierarchy_links); ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user