fix: bloque central footer — noticias_2025.jpg dinámico (corrige duplicación)

El footer template (ID 42370) ya tenía las 3 columnas de banners. El bloque
central usaba publi_2-1.gif (antiguo placeholder). Se reemplaza por el
shortcode [fea_noticia_centro] que muestra noticias_2025.jpg + título del
último artículo de Noticias de alcance de forma dinámica.

Se elimina el shortcode [fea_prefooter] (causaba duplicación al añadirse
sobre el footer template preexistente).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-03 22:37:20 -04:00
parent c6f16ba739
commit 7965928906
@@ -749,78 +749,31 @@ add_shortcode('fea_multimedia', function($atts) {
return $html . '</div></section>'; return $html . '</div></section>';
}); });
// ── Shortcode: [fea_prefooter] — 3 columnas sobre el footer ────────────────── // ── Shortcode: [fea_noticia_centro] — bloque central del footer (Noticias) ───
add_shortcode('fea_prefooter', function() { add_shortcode('fea_noticia_centro', function() {
$uploads = wp_upload_dir()['baseurl']; $uploads = wp_upload_dir()['baseurl'];
$cat_url = get_category_link(fea_cat(41));
// Columna centro: última noticia de alcance (cat term_id=41) $latest = get_posts([
$latest_noticias = get_posts([
'posts_per_page' => 1, 'posts_per_page' => 1,
'category__in' => [fea_cat(41)], 'category__in' => [fea_cat(41)],
'post_status' => 'publish', 'post_status' => 'publish',
'orderby' => 'date', 'orderby' => 'date',
'order' => 'DESC', 'order' => 'DESC',
]); ]);
$cat_noticias_url = get_category_link(fea_cat(41)); $title = !empty($latest) ? fea_title($latest[0]->post_title) : '';
$noticia_title = !empty($latest_noticias) ? fea_title($latest_noticias[0]->post_title) : ''; $url = !empty($latest) ? get_permalink($latest[0]->ID) : $cat_url;
$noticia_url = !empty($latest_noticias) ? get_permalink($latest_noticias[0]->ID) : $cat_noticias_url;
// Columna derecha: último vídeo (cat term_id=58) $html = '<a href="' . esc_url($cat_url) . '">';
$latest_video = get_posts([ $html .= '<img src="' . esc_url($uploads . '/recursos/noticias_2025.jpg') . '" '
'posts_per_page' => 1, . 'alt="Noticias de alcance" width="300" height="340" '
'category__in' => [fea_cat(58)], . 'style="display:block;margin:0 auto;" />';
'post_status' => 'publish', $html .= '</a>';
'orderby' => 'date', if ($title) {
'order' => 'DESC', $html .= '<p style="text-align:center;margin-top:0.5rem;font-size:0.85rem;font-weight:600;line-height:1.3;">'
]); . '<a href="' . esc_url($url) . '" style="color:#0000cc;">'
$video_url = !empty($latest_video) ? get_permalink($latest_video[0]->ID) : get_category_link(fea_cat(58)); . esc_html($title) . '</a></p>';
}
$effa_url = get_permalink(42726); return $html;
$suma_url = get_permalink(18036);
$libros_url = get_category_link(1616);
$videos_escuela_url = get_permalink(21921);
ob_start(); ?>
<div class="fea-prefooter">
<div class="fea-prefooter-col">
<a href="<?php echo esc_url($libros_url); ?>">
<img src="<?php echo esc_url($uploads . '/banners/como_adquirir_nuestros_libros.gif'); ?>" alt="Cómo adquirir nuestros libros" style="display:block;margin:0 auto 8px;" />
</a>
<a href="<?php echo esc_url($videos_escuela_url); ?>">
<img src="<?php echo esc_url($uploads . '/quienes_somos/ultimos_videos.jpg'); ?>" alt="Últimos vídeos de la escuela" width="282" height="97" style="display:block;margin:0 auto;" />
</a>
</div>
<div class="fea-prefooter-col fea-prefooter-center">
<a href="<?php echo esc_url($cat_noticias_url); ?>">
<img src="<?php echo esc_url($uploads . '/recursos/noticias_2025.jpg'); ?>" alt="Noticias de alcance" width="300" height="340" style="display:block;margin:0 auto;" />
</a>
<?php if ($noticia_title): ?>
<p class="fea-prefooter-noticia">
<a href="<?php echo esc_url($noticia_url); ?>"><?php echo esc_html($noticia_title); ?></a>
</p>
<?php endif; ?>
</div>
<div class="fea-prefooter-col">
<a href="<?php echo esc_url($suma_url); ?>">
<img src="<?php echo esc_url($uploads . '/banners/este_portal.gif'); ?>" alt="Este portal" style="display:block;margin:0 auto 5px;" />
</a>
<a href="<?php echo esc_url($effa_url); ?>">
<img src="<?php echo esc_url($uploads . '/banners/acceso_a_EFFA.jpg'); ?>" alt="Acceso a EFFA" style="display:block;margin:0 auto 5px;" />
</a>
<a href="<?php echo esc_url($video_url); ?>">
<img src="<?php echo esc_url($uploads . '/banners/video_de_la_semana1.jpg'); ?>" alt="Vídeo de la semana" style="display:block;margin:0 auto;" />
</a>
</div>
</div>
<?php
$css = '<style>
.fea-prefooter{display:flex;gap:1.5rem;justify-content:center;align-items:flex-start;padding:2rem 1rem;border-top:2px solid #e5e5e5;margin-top:3rem;}
.fea-prefooter-col{flex:1;max-width:320px;text-align:center;}
.fea-prefooter-noticia{margin-top:0.6rem;font-size:0.85rem;font-weight:600;color:#0000cc;line-height:1.3;}
.fea-prefooter-noticia a{color:#0000cc;}
@media(max-width:640px){.fea-prefooter{flex-direction:column;align-items:center;}.fea-prefooter-col{max-width:100%;}}
</style>';
return $css . ob_get_clean();
}); });
// ── Reescribir links internos al idioma activo (Polylang) ───────────────── // ── Reescribir links internos al idioma activo (Polylang) ─────────────────