This commit is contained in:
IGNY8 VPS (Salman)
2026-01-10 08:05:04 +00:00
parent b6b6ae7a84
commit b0c941dba5
3 changed files with 24 additions and 10 deletions

View File

@@ -3,7 +3,7 @@
* Plugin Name: IGNY8 WordPress Bridge * Plugin Name: IGNY8 WordPress Bridge
* Plugin URI: https://igny8.com/igny8-wp-bridge * Plugin URI: https://igny8.com/igny8-wp-bridge
* Description: Lightweight bridge plugin that connects WordPress to IGNY8 API for one-way content publishing. * Description: Lightweight bridge plugin that connects WordPress to IGNY8 API for one-way content publishing.
* Version: 1.3.2 * Version: 1.3.3
* Author: IGNY8 * Author: IGNY8
* Author URI: https://igny8.com/ * Author URI: https://igny8.com/
* License: GPL v2 or later * License: GPL v2 or later
@@ -22,7 +22,7 @@ if (!defined('ABSPATH')) {
} }
// Define plugin constants // Define plugin constants
define('IGNY8_BRIDGE_VERSION', '1.3.2'); define('IGNY8_BRIDGE_VERSION', '1.3.3');
define('IGNY8_BRIDGE_PLUGIN_DIR', plugin_dir_path(__FILE__)); define('IGNY8_BRIDGE_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('IGNY8_BRIDGE_PLUGIN_URL', plugin_dir_url(__FILE__)); define('IGNY8_BRIDGE_PLUGIN_URL', plugin_dir_url(__FILE__));
define('IGNY8_BRIDGE_PLUGIN_FILE', __FILE__); define('IGNY8_BRIDGE_PLUGIN_FILE', __FILE__);

View File

@@ -510,8 +510,7 @@
/* Landscape images */ /* Landscape images */
.igny8-image-landscape { .igny8-image-landscape {
max-width: 1024px; max-width: 1024px;
width: 100%; width: 100%;
margin: 0 auto 2rem;
display: block; display: block;
} }
@@ -538,8 +537,7 @@
/* Table-specific image positioning */ /* Table-specific image positioning */
.igny8-image-before-table { .igny8-image-before-table {
max-width: 1024px; max-width: 1024px;
width: 100%; width: 100%;
margin: 0 auto 2rem;
display: block; display: block;
clear: both; clear: both;
} }

View File

@@ -143,19 +143,27 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2
// Check if section has table // Check if section has table
$has_table = igny8_section_has_table($section['content']); $has_table = igny8_section_has_table($section['content']);
if ($has_table && $img_url) { if ($has_table && $img_url) {
// Place full-width image before table // Place full-width image after first paragraph
$img_type = 'landscape'; $img_type = 'landscape';
$img_align = 'full'; $img_align = 'full';
$img_class = 'igny8-image-landscape igny8-image-before-table'; $img_class = 'igny8-image-landscape igny8-image-before-table';
if (!$show_description) { if (!$show_description) {
$img_class .= ' igny8-image-reuse'; $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)) { if (!$show_description || empty($img_caption)) {
$figure_class .= ' igny8-image-no-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-section-content">
<div class="igny8-prose">
<?php echo $first_paragraph; ?>
</div>
<figure class="<?php echo esc_attr($figure_class); ?>"> <figure class="<?php echo esc_attr($figure_class); ?>">
<img src="<?php echo esc_url($img_url); ?>" <img src="<?php echo esc_url($img_url); ?>"
alt="<?php echo esc_attr($section['heading']); ?>" alt="<?php echo esc_attr($section['heading']); ?>"
@@ -168,7 +176,7 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2
<?php endif; ?> <?php endif; ?>
</figure> </figure>
<div class="igny8-prose"> <div class="igny8-prose">
<?php echo $section['content']; ?> <?php echo $remaining_content; ?>
</div> </div>
</div> </div>
<?php <?php
@@ -213,8 +221,16 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2
if (!$show_description || empty($img_caption)) { if (!$show_description || empty($img_caption)) {
$figure_class .= ' igny8-image-no-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-section-content">
<div class="igny8-prose">
<?php echo $first_paragraph; ?>
</div>
<figure class="<?php echo esc_attr($figure_class); ?>"> <figure class="<?php echo esc_attr($figure_class); ?>">
<img src="<?php echo esc_url($img_url); ?>" <img src="<?php echo esc_url($img_url); ?>"
alt="<?php echo esc_attr($section['heading']); ?>" alt="<?php echo esc_attr($section['heading']); ?>"
@@ -227,7 +243,7 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2
<?php endif; ?> <?php endif; ?>
</figure> </figure>
<div class="igny8-prose"> <div class="igny8-prose">
<?php echo $section['content']; ?> <?php echo $remaining_content; ?>
</div> </div>
</div> </div>
<?php <?php