Files
hoponhopofftickets/astra-child-hoponhopoff/inc/header.php
amir 67c88c795b fix: Astra style conflicts, full-width, responsive hero images, header search
Plugin (viator-collector 1.8.1):
- is_vc_page() now matches any Viator shortcode, so shortcode Pages (home)
  get the full-width no-sidebar canvas
- load vc-design.css after Astra + inline overrides: strip Astra page-builder
  article padding (removes extra gap above hero), full-bleed containers,
  enforce design font inside .vc-app
- vc_hero_img_html(): render hero from the WP media library with responsive
  srcset when the image is an attachment; used in listing + [viator_hero]
  ([viator_hero image_id=".."])

Theme (astra child):
- remove the user/profile header item
- working header search (expands, submits to the tours archive ?vc_q=)
- load chrome.css after Astra + enforce design font inside .hoho
- rebuild installable ZIP

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4hNL1PSHxXbu94SCenpKj
2026-09-15 17:32:07 +03:30

52 lines
2.2 KiB
PHP

<?php
/**
* Custom site header — "Hop On Hop Off" design. Rendered on the `astra_header`
* hook in place of Astra's default header. Wrapped in .hoho so assets/chrome.css
* (scoped to .hoho) applies without touching the rest of Astra.
*/
defined( 'ABSPATH' ) || exit;
$hoho_archive = get_post_type_archive_link( 'viator_tour' );
$hoho_archive = $hoho_archive ? $hoho_archive : home_url( '/' );
?>
<div class="hoho">
<header class="site-header" id="siteHeader">
<div class="container header__inner">
<div class="header__left">
<?php echo hoho_logo(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<nav class="nav" id="primaryNav" aria-label="<?php echo esc_attr__( 'Primary', 'hoponhopoff' ); ?>">
<?php
wp_nav_menu(
array(
'theme_location' => 'hoho_primary',
'container' => false,
'items_wrap' => '<ul class="nav__list">%3$s</ul>',
'walker' => new Hoho_Nav_Walker(),
'fallback_cb' => 'hoho_nav_fallback',
'depth' => 2,
)
);
?>
</nav>
</div>
<div class="header__actions">
<form class="header__search" role="search" method="get" action="<?php echo esc_url( $hoho_archive ); ?>">
<input class="header__search-input" type="search" name="vc_q" placeholder="<?php echo esc_attr__( 'Search tours…', 'hoponhopoff' ); ?>" aria-label="<?php echo esc_attr__( 'Search tours', 'hoponhopoff' ); ?>">
<button class="icon-btn header__search-btn" type="submit" aria-label="<?php echo esc_attr__( 'Search', 'hoponhopoff' ); ?>">
<?php echo hoho_icon( 'search', 'icon--24' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</button>
</form>
<a class="btn btn--accent header__cta" href="<?php echo esc_url( $hoho_archive ); ?>">
<span><?php echo esc_html__( 'Book now', 'hoponhopoff' ); ?></span>
<?php echo hoho_icon( 'arrow-right' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</a>
<button class="burger" id="burger" type="button" aria-label="<?php echo esc_attr__( 'Open menu', 'hoponhopoff' ); ?>" aria-expanded="false" aria-controls="primaryNav">
<span></span><span></span><span></span>
</button>
</div>
</div>
</header>
</div>