diff --git a/wp-content/mu-plugins/acrib-core.php b/wp-content/mu-plugins/acrib-core.php
index a9c9b2d..7b3f3b3 100644
--- a/wp-content/mu-plugins/acrib-core.php
+++ b/wp-content/mu-plugins/acrib-core.php
@@ -2,7 +2,7 @@
/**
* ACRIB Core MU-Plugin
* Always-on: custom footer, security hardening, performance tweaks.
- * @version 1.2
+ * @version 1.4
*/
// --- Remove Kadence default copyright footer ---
@@ -13,11 +13,21 @@ add_action('after_setup_theme', function () {
remove_action('kadence_footer_html', 'Kadence\footer_html');
}, 999);
-// --- Transparent header body class on homepage (Kadence Pro workaround) ---
+// --- Transparent header body class on homepage + its Polylang translations ---
// Kadence's layout/component.php adds non-transparent-header at priority 10.
// We run at 999 to remove it and add transparent-header (used by Kadence JS).
add_filter('body_class', function ($classes) {
- if (is_front_page()) {
+ $is_front = is_front_page();
+ // Also detect translated homepages via Polylang
+ $is_front_translation = false;
+ if (!$is_front && is_singular() && function_exists('pll_get_post_translations')) {
+ $front_id = (int) get_option('page_on_front');
+ if ($front_id) {
+ $translations = pll_get_post_translations($front_id);
+ $is_front_translation = in_array(get_the_ID(), $translations, true);
+ }
+ }
+ if ($is_front || $is_front_translation) {
$classes = array_diff($classes, ['non-transparent-header', 'mobile-non-transparent-header']);
$classes[] = 'transparent-header';
$classes[] = 'mobile-transparent-header';
@@ -94,58 +104,75 @@ add_action('wp_head', function () {
if (is_singular()) {
$layout = get_post_meta(get_the_ID(), '_kadence_post_layout', true);
$meta = $layout ? json_decode($layout, true) : [];
- $hide_title = isset($meta['title']) && $meta['title'] === 'hide';
- $full_width = isset($meta['layout']) && $meta['layout'] === 'fullwidth';
+ $hide_title = isset($meta['title']) && $meta['title'] === 'hide';
+ $full_width = isset($meta['layout']) && $meta['layout'] === 'fullwidth';
if ($hide_title || $full_width) {
+ $id = get_the_ID();
$rules = [];
if ($hide_title) {
- $rules[] = '.page-id-' . get_the_ID() . ' .entry-hero.page-hero-section{display:none!important}';
+ $rules[] = '.page-id-' . $id . ' .entry-hero.page-hero-section{display:none!important}';
}
if ($full_width) {
- // Remove boxed content wrap styling added by content-style-boxed body class
- $rules[] = '.page-id-' . get_the_ID() . ' .entry-content-wrap{padding:0!important;box-shadow:none!important;margin:0!important;background:none!important}';
- $rules[] = '.page-id-' . get_the_ID() . ' .content-area{max-width:100%!important;padding:0!important}';
+ $rules[] = '.page-id-' . $id . ' .entry-content-wrap{padding:0!important;box-shadow:none!important;margin:0!important;background:none!important}';
+ $rules[] = '.page-id-' . $id . ' .content-area{max-width:100%!important;padding:0!important}';
}
if ($rules) {
- echo '' . "\n";
+ echo '' . "\n";
}
}
}
}, 5);
-// --- Homepage: inject critical CSS fixes ---
+// --- Homepage + translations: inject critical CSS fixes ---
+// Uses .home (Spanish front page) and .transparent-header (all front page variants)
+// so the same rules apply to RO and EN translated homepages.
add_action('wp_head', function () {
- if (!is_front_page()) return;
+ if (!is_front_page() && !is_singular()) return;
+ // Only inject for actual front page or its translations
+ $inject = is_front_page();
+ if (!$inject && function_exists('pll_get_post_translations')) {
+ $front_id = (int) get_option('page_on_front');
+ if ($front_id) {
+ $inject = in_array(get_the_ID(), pll_get_post_translations($front_id), true);
+ }
+ }
+ if (!$inject) return;
echo '