From f525f4a85db41907d80318a7776d7e1a15604958 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 18 Aug 2025 20:32:37 -0300 Subject: [PATCH] fix: Resolve header overlap and CSS loading issues on event edit page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed z-index layering with !important rules for proper navigation stacking - Enhanced CSS file loading detection with multiple page identification methods - Added comprehensive header overlap prevention for all Astra theme header elements - Improved event edit page detection to handle URL patterns and page IDs - Verified all fixes working on staging with proper navigation visibility 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- assets/css/hvac-event-edit-custom.css | 38 ++++++++++++++++------- includes/class-hvac-custom-event-edit.php | 13 ++++++-- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/assets/css/hvac-event-edit-custom.css b/assets/css/hvac-event-edit-custom.css index 5ead760e..2698d2e9 100644 --- a/assets/css/hvac-event-edit-custom.css +++ b/assets/css/hvac-event-edit-custom.css @@ -34,20 +34,36 @@ --hvac-border-radius: 4px; } -/* Fix navigation bar z-index issue */ -.hvac-event-edit-page .hvac-trainer-menu-wrapper { - position: relative; - z-index: 100; - background: #fff; - margin-bottom: 0; +/* Fix navigation bar z-index issue - force above all site headers */ +.hvac-trainer-menu-wrapper { + position: relative !important; + z-index: 999 !important; + background: #fff !important; + margin-bottom: 0 !important; + width: 100% !important; + top: 0 !important; } /* Ensure breadcrumbs appear correctly */ -.hvac-event-edit-page .hvac-breadcrumbs { - position: relative; - z-index: 90; - background: #fff; - padding: 15px 0; +.hvac-breadcrumbs { + position: relative !important; + z-index: 998 !important; + background: #fff !important; + padding: 15px 0 !important; + width: 100% !important; +} + +/* Force site header to stay below trainer navigation */ +.hvac-event-edit-page .site-header, +.hvac-event-edit-page .ast-main-header-wrap, +.hvac-event-edit-page .ast-above-header-wrap, +.hvac-event-edit-page .ast-below-header-wrap { + z-index: 49 !important; +} + +/* Add top margin to content to account for fixed navigation */ +.hvac-event-edit-page .hvac-event-edit-wrapper { + margin-top: 20px !important; } /* Main wrapper - matches registration page */ diff --git a/includes/class-hvac-custom-event-edit.php b/includes/class-hvac-custom-event-edit.php index ffd0aaf4..f9751f2f 100644 --- a/includes/class-hvac-custom-event-edit.php +++ b/includes/class-hvac-custom-event-edit.php @@ -129,8 +129,17 @@ final class HVAC_Custom_Event_Edit { * Check if current page is event edit page */ private function isEditPage(): bool { - return get_query_var('hvac_event_edit') === '1' - || (is_page() && get_page_template_slug() === 'templates/page-edit-event-custom.php'); + // Check for the URL pattern /trainer/event/edit/ + $is_edit_url = strpos($_SERVER['REQUEST_URI'], '/trainer/event/edit') !== false; + + // Check for the specific page ID (6177) that handles edit events + $is_edit_page = is_page(6177); + + // Check query var and template slug (fallback methods) + $has_query_var = get_query_var('hvac_event_edit') === '1'; + $has_template = is_page() && get_page_template_slug() === 'templates/page-edit-event-custom.php'; + + return $is_edit_url || $is_edit_page || $has_query_var || $has_template; } /**