Add Astra child theme for Hop On Hop Off header & footer
- disables Astra header/footer via astra_header/astra_footer hooks and renders custom design markup (logo, nav dropdown, footer columns, socials, support) - chrome.css scoped to .hoho (generated from the design source); chrome.js for burger/submenu/sticky/back-to-top; bundled icon sprite (reuses plugin's) - parameterize scope-css.js scope via VC_SCOPE env Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4hNL1PSHxXbu94SCenpKj
This commit is contained in:
51
astra-child-hoponhopoff/inc/header.php
Normal file
51
astra-child-hoponhopoff/inc/header.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?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">
|
||||
<button class="icon-btn" type="button" aria-label="<?php echo esc_attr__( 'Search', 'hoponhopoff' ); ?>">
|
||||
<?php echo hoho_icon( 'search', 'icon--24' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</button>
|
||||
<a class="icon-btn" href="<?php echo esc_url( wp_login_url() ); ?>" aria-label="<?php echo esc_attr__( 'Account', 'hoponhopoff' ); ?>">
|
||||
<?php echo hoho_icon( 'user', 'icon--24' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</a>
|
||||
<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>
|
||||
Reference in New Issue
Block a user