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:
88
astra-child-hoponhopoff/inc/footer.php
Normal file
88
astra-child-hoponhopoff/inc/footer.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* Custom site footer — "Hop On Hop Off" design. Rendered on the `astra_footer`
|
||||
* hook in place of Astra's default footer.
|
||||
*/
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$hoho_about = apply_filters(
|
||||
'hoho_footer_about',
|
||||
get_bloginfo( 'description' ) ? get_bloginfo( 'description' ) : __( 'Open-top hop on, hop off bus tours — explore the city at your own pace, with flexible tickets and free cancellation.', 'hoponhopoff' )
|
||||
);
|
||||
|
||||
$hoho_socials = apply_filters(
|
||||
'hoho_socials',
|
||||
array(
|
||||
'whatsapp' => '#',
|
||||
'instagram' => '#',
|
||||
'telegram' => '#',
|
||||
'facebook' => '#',
|
||||
)
|
||||
);
|
||||
|
||||
$hoho_footer_col = function ( $location ) {
|
||||
if ( ! has_nav_menu( $location ) ) {
|
||||
return;
|
||||
}
|
||||
wp_nav_menu(
|
||||
array(
|
||||
'theme_location' => $location,
|
||||
'container' => false,
|
||||
'items_wrap' => '<ul>%3$s</ul>',
|
||||
'depth' => 1,
|
||||
'fallback_cb' => false,
|
||||
)
|
||||
);
|
||||
};
|
||||
?>
|
||||
<div class="hoho">
|
||||
<footer class="footer" id="footer">
|
||||
<a class="ring-badge ring-badge--top" href="#top" aria-label="<?php echo esc_attr__( 'Back to top', 'hoponhopoff' ); ?>">
|
||||
<svg class="ring-badge__ring" viewBox="0 0 100 100" aria-hidden="true">
|
||||
<text class="ring-badge__text"><textPath href="#ringPathScroll" startOffset="0">BACK TO TOP · BACK TO TOP · </textPath></text>
|
||||
</svg>
|
||||
<span class="ring-badge__dot"><svg class="icon" aria-hidden="true"><use href="#i-arrow-up"></use></svg></span>
|
||||
</a>
|
||||
|
||||
<div class="container footer__inner">
|
||||
<div class="footer__brand">
|
||||
<span class="footer__logo"><?php require get_stylesheet_directory() . '/inc/logo.php'; ?></span>
|
||||
<p class="footer__about"><?php echo esc_html( $hoho_about ); ?></p>
|
||||
</div>
|
||||
|
||||
<nav class="footer__cols" aria-label="<?php echo esc_attr__( 'Footer', 'hoponhopoff' ); ?>">
|
||||
<div class="footer__col">
|
||||
<h2 class="footer__ct"><?php echo esc_html__( 'Quick Access', 'hoponhopoff' ); ?></h2>
|
||||
<?php $hoho_footer_col( 'hoho_quick' ); ?>
|
||||
</div>
|
||||
<div class="footer__col">
|
||||
<h2 class="footer__ct"><?php echo esc_html__( 'Tours', 'hoponhopoff' ); ?></h2>
|
||||
<?php $hoho_footer_col( 'hoho_tours' ); ?>
|
||||
</div>
|
||||
<div class="footer__col">
|
||||
<h2 class="footer__ct"><?php echo esc_html__( 'User Account', 'hoponhopoff' ); ?></h2>
|
||||
<?php $hoho_footer_col( 'hoho_account' ); ?>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="container footer__bar">
|
||||
<p class="footer__copy">© <?php echo esc_html( gmdate( 'Y' ) ); ?> <?php echo esc_html( get_bloginfo( 'name' ) ); ?>. <?php echo esc_html__( 'All rights reserved.', 'hoponhopoff' ); ?></p>
|
||||
<ul class="socials">
|
||||
<?php foreach ( $hoho_socials as $network => $url ) : ?>
|
||||
<?php if ( $url ) : ?>
|
||||
<li><a href="<?php echo esc_url( $url ); ?>" aria-label="<?php echo esc_attr( ucfirst( $network ) ); ?>"><?php echo hoho_icon( $network, 'icon--20' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></a></li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<a class="support" href="<?php echo esc_url( apply_filters( 'hoho_support_url', '#' ) ); ?>" aria-label="<?php echo esc_attr__( 'Support', 'hoponhopoff' ); ?>">
|
||||
<svg class="ring-badge__ring support__ring" viewBox="0 0 100 100" aria-hidden="true">
|
||||
<text class="ring-badge__text"><textPath href="#ringPathScroll" startOffset="0">SUPPORT · SUPPORT · SUPPORT · </textPath></text>
|
||||
</svg>
|
||||
<span class="support__tab"><?php echo hoho_icon( 'headset', 'icon--24' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
</a>
|
||||
</footer>
|
||||
</div>
|
||||
<?php
|
||||
Reference in New Issue
Block a user