Files
xmarticaims/wp-content/themes/xmartica/header.php
T
2026-11-02 10:26:32 -06:00

133 lines
7.5 KiB
PHP

<?php
/**
* Site header.
*
* @package Xmartica
*/
$xmartica_language = function_exists( 'pll_current_language' )
? pll_current_language( 'slug' )
: 'en';
if ( 'es' === $xmartica_language ) {
require get_theme_file_path( '/header-es.php' );
return;
}
$xmartica_logo = get_theme_file_uri( '/assets/header/xmart.svg' );
$xmartica_ims = get_theme_file_uri( '/assets/header/ims.svg' );
$xmartica_arrow = add_query_arg( 'ver', filemtime( get_theme_file_path( '/assets/header/arrow-forward-sharp.svg' ) ), get_theme_file_uri( '/assets/header/arrow-forward-sharp.svg' ) );
$xmartica_contact_url = home_url( '/#contacto' );
$xmartica_home_url = function_exists( 'pll_home_url' ) ? pll_home_url( 'en' ) : home_url( '/' );
$xmartica_spanish_url = function_exists( 'pll_home_url' ) ? pll_home_url( 'es' ) : home_url( '/' );
if ( function_exists( 'pll_get_post' ) ) {
$xmartica_current_page_id = get_queried_object_id();
if ( $xmartica_current_page_id ) {
$xmartica_spanish_page_id = pll_get_post( $xmartica_current_page_id, 'es' );
if ( $xmartica_spanish_page_id ) {
$xmartica_spanish_permalink = get_permalink( $xmartica_spanish_page_id );
if ( $xmartica_spanish_permalink ) {
$xmartica_spanish_url = $xmartica_spanish_permalink;
}
}
}
}
$xmartica_home_url = wp_make_link_relative( $xmartica_home_url );
$xmartica_spanish_url = wp_make_link_relative( $xmartica_spanish_url );
$xmartica_header_service_links = array(
array(
'label' => esc_html__( 'Industrial Technical Services', 'html5blank' ),
'path' => '/industrial-technical-services',
),
array(
'label' => esc_html__( 'Industrial Maintenance Services', 'html5blank' ),
'path' => '/industrial-maintenance-services',
),
array(
'label' => esc_html__( 'Reliability Engineering', 'html5blank' ),
'path' => '/reliability-engineering',
),
array(
'label' => esc_html__( 'Asset Management Services', 'html5blank' ),
'path' => '/asset-management-services',
),
array(
'label' => esc_html__( 'Industrial Repair Services', 'html5blank' ),
'path' => '/industrial-repair-services',
),
);
?>
<!doctype html>
<html <?php language_attributes(); ?> class="no-js">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php wp_head(); ?>
</head>
<body <?php body_class( 'bg-black font-[Geist,sans-serif]' ); ?>>
<?php wp_body_open(); ?>
<header id="site-header" class="site-header site-header--ims fixed top-0 z-50 w-full" data-node-id="337:4889">
<div class="site-header__background pointer-events-none absolute inset-0" aria-hidden="true"></div>
<div class="relative mx-auto flex min-h-[147px] w-full max-w-[1440px] items-center justify-between py-10 xxl:px-[72px] xl:min-h-[96px] xl:px-8 xl:py-[20px] lg:min-h-[70px] lg:px-4 lg:py-[10px]">
<a class="relative z-10 flex shrink-0 items-center justify-center px-5 py-2.5 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[#ffcd11]" href="<?php echo esc_url( $xmartica_home_url ); ?>" aria-label="<?php echo esc_attr__( 'XmartIMS — Home', 'html5blank' ); ?>" data-node-id="335:3716">
<span class="flex items-center gap-0.5" data-node-id="335:3717">
<?php if ( $xmartica_logo ) : ?>
<img class="block h-[21.0823px] w-[83.4433px] max-w-none" src="<?php echo esc_url( $xmartica_logo ); ?>" alt="Xmart" width="83.4433" height="21.0823" data-node-id="335:3718">
<?php endif; ?>
<span class="flex h-[31.42px] w-[70.246px] items-center justify-center rounded-[20px] bg-[#ffcd11] px-2.5 py-[5px]" data-node-id="335:3724">
<?php if ( $xmartica_ims ) : ?>
<img class="block h-[21.42px] w-[50.246px] max-w-none" src="<?php echo esc_url( $xmartica_ims ); ?>" alt="IMS" width="50.246" height="21.42" data-node-id="335:3725">
<?php endif; ?>
</span>
</span>
</a>
<button id="site-menu-toggle" class="site-header__toggle relative z-20 hidden h-[47px] w-[47px] items-center justify-center rounded-full border border-[#444] bg-[#101f33] text-[#ffcd11] lg:flex" type="button" aria-expanded="false" aria-controls="site-navigation" aria-label="<?php echo esc_attr__( 'Open menu', 'html5blank' ); ?>">
<span class="site-header__toggle-lines" aria-hidden="true"><span></span><span></span><span></span></span>
</button>
<nav id="site-navigation" class="site-header__nav relative z-10 flex h-[67px] w-[707px] shrink-0 items-center justify-center gap-2.5 rounded-[100px] border border-[#444] bg-[rgba(18,35,58,0.7)] backdrop-blur-[10px] lg:absolute lg:left-4 lg:right-4 lg:top-[calc(100%-4px)] lg:h-auto lg:w-auto lg:flex-col lg:items-stretch lg:rounded-[28px] lg:p-3" aria-label="<?php echo esc_attr__( 'Primary navigation', 'html5blank' ); ?>" data-node-id="335:3485">
<ul class="xmartica-menu flex items-center gap-2.5 lg:w-full lg:flex-col lg:items-stretch lg:gap-1">
<li class="xmartica-menu__solutions menu-item-has-children">
<a href="<?php echo esc_url( home_url( '/#soluciones' ) ); ?>" aria-haspopup="true"><?php echo esc_html__( 'Solutions', 'html5blank' ); ?></a>
<button class="xmartica-menu__submenu-toggle" type="button" aria-expanded="true" aria-controls="xmartica-solutions-submenu" aria-label="<?php echo esc_attr__( 'Ocultar soluciones', 'html5blank' ); ?>">
<svg viewBox="0 0 12 8" width="12" height="8" aria-hidden="true" focusable="false"><path d="M1 1.25 6 6.25l5-5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/></svg>
</button>
<ul id="xmartica-solutions-submenu" class="xmartica-menu__submenu is-open" aria-label="<?php echo esc_attr__( 'Soluciones', 'html5blank' ); ?>">
<?php foreach ( $xmartica_header_service_links as $xmartica_header_service_link ) : ?>
<li>
<a href="<?php echo esc_url( home_url( $xmartica_header_service_link['path'] ) ); ?>"><?php echo esc_html( $xmartica_header_service_link['label'] ); ?></a>
</li>
<?php endforeach; ?>
</ul>
</li>
<li>
<a href="<?php echo esc_url( home_url( '/#preguntas-frecuentes' ) ); ?>"><?php echo esc_html__( 'FAQ', 'html5blank' ); ?></a>
</li>
</ul>
<div class="flex shrink-0 items-start gap-2.5 lg:w-full lg:items-center" data-node-id="335:3491">
<a class="flex h-[47px] w-[47px] shrink-0 items-center justify-center rounded-full border border-[#444] bg-[#101f33] text-sm font-normal text-white transition-colors hover:border-[#ffcd11] hover:text-[#ffcd11] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#ffcd11]" href="<?php echo esc_url( $xmartica_spanish_url ); ?>" lang="es" hreflang="es" aria-label="<?php echo esc_attr__( 'View the site in Spanish', 'html5blank' ); ?>" data-node-id="335:3492">ES</a>
<a class="flex h-[47px] min-w-[211px] items-center justify-center gap-[5px] rounded-[50px] bg-[#ffcd11] px-10 py-3 text-lg font-semibold text-black transition-colors hover:bg-[#e6b900] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white lg:min-w-0 lg:flex-1 lg:px-5" href="<?php echo esc_url( $xmartica_contact_url ); ?>" data-node-id="335:3494">
<span><?php echo esc_html__( 'Contact us', 'html5blank' ); ?></span>
<?php if ( $xmartica_arrow ) : ?>
<img class="block h-[15px] w-[15px] max-w-none" src="<?php echo esc_url( $xmartica_arrow ); ?>" alt="" width="15" height="15" aria-hidden="true" data-node-id="335:3496">
<?php endif; ?>
</a>
</div>
</nav>
</div>
</header>