fix: remove wpcf7 contact layout injection causing 3-column layout
The existing homepage had a proper 2-column Gutenberg columns block (contact info left, CF7 form right). The previous wpcf7_enqueue_scripts injection was wrapping .wpcf7 in an additional grid, creating a 3-column visual layout. Removed the injection entirely - contact address and presidencia@acrib.es email are now stored directly in the page content left column (updated via fix-contact2.php). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -69,53 +69,7 @@ add_action('wp_footer', function () {
|
|||||||
<?php
|
<?php
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
// ── Contact section: inject address sidebar next to CF7 form ──
|
// Contact address info is in the page content (left column of the Gutenberg columns block).
|
||||||
add_action('wpcf7_enqueue_scripts', function () {
|
|
||||||
add_action('wp_footer', function () {
|
|
||||||
$lang = function_exists('pll_current_language') ? pll_current_language() : 'es';
|
|
||||||
$ll = [
|
|
||||||
'es' => ['title' => 'Información de contacto', 'addr' => 'Dirección', 'email' => 'Correo general', 'pres' => 'Presidencia'],
|
|
||||||
'ro' => ['title' => 'Informații de contact', 'addr' => 'Adresă', 'email' => 'E-mail general', 'pres' => 'Președinție'],
|
|
||||||
'en' => ['title' => 'Contact information', 'addr' => 'Address', 'email' => 'General email', 'pres' => 'Presidency'],
|
|
||||||
];
|
|
||||||
$l = $ll[$lang] ?? $ll['es'];
|
|
||||||
?>
|
|
||||||
<style id="acrib-contact-layout-css">
|
|
||||||
.acrib-contact-layout{display:grid;grid-template-columns:280px 1fr;gap:2.5rem;align-items:start;}
|
|
||||||
.acrib-contact-info{background:#f4f7fb;border-radius:6px;padding:1.75rem 1.5rem;border-top:3px solid #c69c48;}
|
|
||||||
.acrib-contact-info h4{font-family:"Lato",sans-serif;font-size:.75rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:#13294b;margin:0 0 1.25rem;}
|
|
||||||
.acrib-ci-row{display:flex;flex-direction:column;margin-bottom:1rem;}
|
|
||||||
.acrib-ci-label{font-size:.7rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:#8a9ab5;font-family:"Lato",sans-serif;margin-bottom:.25rem;}
|
|
||||||
.acrib-ci-value,.acrib-contact-info address{font-size:.9rem;color:#13294b;line-height:1.6;font-style:normal;}
|
|
||||||
.acrib-contact-info a{color:#c69c48;text-decoration:none;}
|
|
||||||
.acrib-contact-info a:hover{text-decoration:underline;}
|
|
||||||
.acrib-ci-cif{font-size:.72rem;color:#8a9ab5;margin:.75rem 0 0;padding-top:.75rem;border-top:1px solid #dce6f0;}
|
|
||||||
@media(max-width:820px){.acrib-contact-layout{grid-template-columns:1fr;}}
|
|
||||||
</style>
|
|
||||||
<script id="acrib-contact-layout-js">
|
|
||||||
(function(){
|
|
||||||
var form=document.querySelector('.wpcf7');
|
|
||||||
if(!form) return;
|
|
||||||
var layout=document.createElement('div');
|
|
||||||
layout.className='acrib-contact-layout';
|
|
||||||
form.parentNode.insertBefore(layout,form);
|
|
||||||
var info=document.createElement('div');
|
|
||||||
info.className='acrib-contact-info';
|
|
||||||
info.innerHTML='<h4><?php echo esc_js($l['title']); ?></h4>'
|
|
||||||
+'<div class="acrib-ci-row"><span class="acrib-ci-label"><?php echo esc_js($l['addr']); ?></span>'
|
|
||||||
+'<address>Avda. Asima, n.\u00ba\u00a017<br>Planta\u00a01, Puerta\u00a0A<br>07009 Palma de Mallorca<br>Illes Balears, Espa\u00f1a</address></div>'
|
|
||||||
+'<div class="acrib-ci-row"><span class="acrib-ci-label"><?php echo esc_js($l['email']); ?></span>'
|
|
||||||
+'<span class="acrib-ci-value"><a href="mailto:info@acrib.es">info@acrib.es</a></span></div>'
|
|
||||||
+'<div class="acrib-ci-row"><span class="acrib-ci-label"><?php echo esc_js($l['pres']); ?></span>'
|
|
||||||
+'<span class="acrib-ci-value"><a href="mailto:presidencia@acrib.es">presidencia@acrib.es</a></span></div>'
|
|
||||||
+'<p class="acrib-ci-cif">CIF: G22992846</p>';
|
|
||||||
layout.appendChild(info);
|
|
||||||
layout.appendChild(form);
|
|
||||||
}());
|
|
||||||
</script>
|
|
||||||
<?php
|
|
||||||
}, 55);
|
|
||||||
});
|
|
||||||
|
|
||||||
// --- Security headers ---
|
// --- Security headers ---
|
||||||
add_action('send_headers', function () {
|
add_action('send_headers', function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user