true, 'flex-height' => true ) ); register_nav_menus( array( 'hoho_primary' => __( 'HoHo — Header Menu', 'hoponhopoff' ), 'hoho_quick' => __( 'HoHo — Footer: Quick Access', 'hoponhopoff' ), 'hoho_tours' => __( 'HoHo — Footer: Tours', 'hoponhopoff' ), 'hoho_account' => __( 'HoHo — Footer: User Account', 'hoponhopoff' ), ) ); } ); /** * Print the SVG icon sprite once, high in the footer, so * resolves everywhere (header, footer, and the plugin's pages). */ add_action( 'wp_footer', function () { // Reuse the plugin's guarded printer when available, so the sprite is never // output twice on plugin pages. if ( function_exists( 'vc_print_icon_sprite' ) ) { vc_print_icon_sprite(); return; } $sprite = get_stylesheet_directory() . '/assets/sprite.svg'; if ( is_readable( $sprite ) ) { echo file_get_contents( $sprite ); // phpcs:ignore } }, 1 ); /** * Swap Astra's header/footer markup for ours. * * Astra prints its header via astra_header_markup() on the `astra_header` * action, and its footer via astra_footer_markup() on `astra_footer`. We remove * those and render our own template parts. Deferred to `wp` so Astra's parent * functions.php (which registers the callbacks) has already loaded. */ add_action( 'wp', function () { if ( function_exists( 'astra_header_markup' ) ) { remove_action( 'astra_header', 'astra_header_markup' ); } add_action( 'astra_header', 'hoho_render_header' ); if ( function_exists( 'astra_footer_markup' ) ) { remove_action( 'astra_footer', 'astra_footer_markup' ); } add_action( 'astra_footer', 'hoho_render_footer' ); } ); function hoho_render_header() { require get_stylesheet_directory() . '/inc/header.php'; } function hoho_render_footer() { require get_stylesheet_directory() . '/inc/footer.php'; } require get_stylesheet_directory() . '/inc/nav-walker.php'; /** * The logo: a linked WordPress Custom Logo if one is set, otherwise the bundled * "Hop On Hop Off" SVG wordmark. */ function hoho_logo() { $home = esc_url( home_url( '/' ) ); if ( has_custom_logo() ) { $id = get_theme_mod( 'custom_logo' ); $img = wp_get_attachment_image( $id, 'full', false, array( 'class' => 'logo' ) ); if ( $img ) { return ''; } } ob_start(); ?> '; }