Remove data-bs-spy, data-bs-target, and data-bs-offset attributes from body tag in header.php. The target element .toc-container does not exist, causing Bootstrap ScrollSpy to fail and trigger layout recalculations that account for 82% of the CLS score (0.946 of 1.147). Ref: 99.02-investigacion-cls-mobile.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
89 lines
2.4 KiB
PHP
89 lines
2.4 KiB
PHP
<?php
|
|
/**
|
|
* Header Template
|
|
*
|
|
* Replica EXACTAMENTE la estructura del template RDash (líneas 54-133)
|
|
* Sin wrappers extra.
|
|
*
|
|
* @package ROI_Theme
|
|
* @since 1.0.0
|
|
*/
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html <?php language_attributes(); ?>>
|
|
<head>
|
|
<meta charset="<?php bloginfo('charset'); ?>">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<?php wp_head(); ?>
|
|
</head>
|
|
|
|
<body <?php body_class(); ?>>
|
|
<?php wp_body_open(); ?>
|
|
|
|
<?php
|
|
if (function_exists('roi_render_component')) {
|
|
echo roi_render_component('top-notification-bar');
|
|
}
|
|
?>
|
|
|
|
<!-- Navbar (Template líneas 264-320) -->
|
|
<nav class="navbar navbar-expand-lg navbar-dark py-3" role="navigation" aria-label="<?php esc_attr_e('Primary Navigation', 'roi-theme'); ?>">
|
|
<div class="container">
|
|
|
|
<?php
|
|
// Brand/Logo - Leer configuración desde BD
|
|
$show_brand = roi_get_navbar_setting('media', 'show_brand', false);
|
|
if ($show_brand) :
|
|
$use_logo = roi_get_navbar_setting('media', 'use_logo', false);
|
|
$brand_text = roi_get_navbar_setting('media', 'brand_text', get_bloginfo('name'));
|
|
$home_url = home_url('/');
|
|
|
|
if ($use_logo) :
|
|
$logo_url = roi_get_navbar_setting('media', 'logo_url', '');
|
|
if (!empty($logo_url)) :
|
|
?>
|
|
<a class="navbar-brand" href="<?php echo esc_url($home_url); ?>">
|
|
<img src="<?php echo esc_url($logo_url); ?>" alt="<?php echo esc_attr($brand_text); ?>" class="roi-navbar-logo">
|
|
</a>
|
|
<?php
|
|
endif;
|
|
else :
|
|
?>
|
|
<a class="navbar-brand roi-navbar-brand" href="<?php echo esc_url($home_url); ?>">
|
|
<?php echo esc_html($brand_text); ?>
|
|
</a>
|
|
<?php
|
|
endif;
|
|
endif;
|
|
?>
|
|
|
|
<!-- Hamburger Toggle Button -->
|
|
<button class="navbar-toggler"
|
|
type="button"
|
|
data-bs-toggle="collapse"
|
|
data-bs-target="#navbarSupportedContent"
|
|
aria-controls="navbarSupportedContent"
|
|
aria-expanded="false"
|
|
aria-label="<?php esc_attr_e('Toggle navigation', 'roi-theme'); ?>">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
|
|
<!-- Collapsible Menu -->
|
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
|
<?php
|
|
// Navbar Component - Menu de navegación
|
|
if (function_exists('roi_render_component')) {
|
|
echo roi_render_component('navbar');
|
|
}
|
|
?>
|
|
|
|
<?php
|
|
// CTA "Let's Talk" Button Component
|
|
if (function_exists('roi_render_component')) {
|
|
echo roi_render_component('cta-lets-talk');
|
|
}
|
|
?>
|
|
</div>
|
|
|
|
</div><!-- .container -->
|
|
</nav><!-- .navbar -->
|