diff --git a/wp-content/mu-plugins/acrib-core.php b/wp-content/mu-plugins/acrib-core.php index 6669641..a9c9b2d 100644 --- a/wp-content/mu-plugins/acrib-core.php +++ b/wp-content/mu-plugins/acrib-core.php @@ -87,6 +87,32 @@ if (!defined('WP_POST_REVISIONS')) { define('WP_POST_REVISIONS', 3); } +// --- Global: hide Kadence title section on pages with custom heroes --- +// Kadence free ignores _kadence_post_layout title:hide meta. +// We read it ourselves and output the fix for any page that set it. +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'; + if ($hide_title || $full_width) { + $rules = []; + if ($hide_title) { + $rules[] = '.page-id-' . get_the_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}'; + } + if ($rules) { + echo '' . "\n"; + } + } + } +}, 5); + // --- Homepage: inject critical CSS fixes --- add_action('wp_head', function () { if (!is_front_page()) return;