1.3.3
This commit is contained in:
@@ -510,8 +510,7 @@
|
||||
/* Landscape images */
|
||||
.igny8-image-landscape {
|
||||
max-width: 1024px;
|
||||
width: 100%;
|
||||
margin: 0 auto 2rem;
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
@@ -538,8 +537,7 @@
|
||||
/* Table-specific image positioning */
|
||||
.igny8-image-before-table {
|
||||
max-width: 1024px;
|
||||
width: 100%;
|
||||
margin: 0 auto 2rem;
|
||||
width: 100%;
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
@@ -143,19 +143,27 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2
|
||||
// Check if section has table
|
||||
$has_table = igny8_section_has_table($section['content']);
|
||||
if ($has_table && $img_url) {
|
||||
// Place full-width image before table
|
||||
// Place full-width image after first paragraph
|
||||
$img_type = 'landscape';
|
||||
$img_align = 'full';
|
||||
$img_class = 'igny8-image-landscape igny8-image-before-table';
|
||||
if (!$show_description) {
|
||||
$img_class .= ' igny8-image-reuse';
|
||||
}
|
||||
$figure_class = 'igny8-image-figure';
|
||||
$figure_class = 'igny8-image-figure igny8-image-landscape-figure';
|
||||
if (!$show_description || empty($img_caption)) {
|
||||
$figure_class .= ' igny8-image-no-caption';
|
||||
}
|
||||
|
||||
// Split content to insert image after first paragraph
|
||||
$content_parts = preg_split('/(<\/p>)/i', $section['content'], 2, PREG_SPLIT_DELIM_CAPTURE);
|
||||
$first_paragraph = isset($content_parts[0]) && isset($content_parts[1]) ? $content_parts[0] . $content_parts[1] : '';
|
||||
$remaining_content = isset($content_parts[2]) ? $content_parts[2] : $section['content'];
|
||||
?>
|
||||
<div class="igny8-section-content">
|
||||
<div class="igny8-prose">
|
||||
<?php echo $first_paragraph; ?>
|
||||
</div>
|
||||
<figure class="<?php echo esc_attr($figure_class); ?>">
|
||||
<img src="<?php echo esc_url($img_url); ?>"
|
||||
alt="<?php echo esc_attr($section['heading']); ?>"
|
||||
@@ -168,7 +176,7 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2
|
||||
<?php endif; ?>
|
||||
</figure>
|
||||
<div class="igny8-prose">
|
||||
<?php echo $section['content']; ?>
|
||||
<?php echo $remaining_content; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
@@ -213,8 +221,16 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2
|
||||
if (!$show_description || empty($img_caption)) {
|
||||
$figure_class .= ' igny8-image-no-caption';
|
||||
}
|
||||
|
||||
// Split content to insert image after first paragraph
|
||||
$content_parts = preg_split('/(<\/p>)/i', $section['content'], 2, PREG_SPLIT_DELIM_CAPTURE);
|
||||
$first_paragraph = isset($content_parts[0]) && isset($content_parts[1]) ? $content_parts[0] . $content_parts[1] : '';
|
||||
$remaining_content = isset($content_parts[2]) ? $content_parts[2] : $section['content'];
|
||||
?>
|
||||
<div class="igny8-section-content">
|
||||
<div class="igny8-prose">
|
||||
<?php echo $first_paragraph; ?>
|
||||
</div>
|
||||
<figure class="<?php echo esc_attr($figure_class); ?>">
|
||||
<img src="<?php echo esc_url($img_url); ?>"
|
||||
alt="<?php echo esc_attr($section['heading']); ?>"
|
||||
@@ -227,7 +243,7 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2
|
||||
<?php endif; ?>
|
||||
</figure>
|
||||
<div class="igny8-prose">
|
||||
<?php echo $section['content']; ?>
|
||||
<?php echo $remaining_content; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user