50 lines
1.9 KiB
PHP
50 lines
1.9 KiB
PHP
<?php
|
|
/**
|
|
* Shared brand nav.
|
|
*
|
|
* Used by front-page.php and page-templates/page-shop.php. Emits the
|
|
* cream-background nav: SEWJOY logo (wp_nav_menu 'menu-1' with a hardcoded
|
|
* fallback) + 3 account icons + 1px hairline divider.
|
|
*
|
|
* @package SewJoy_Theme
|
|
*/
|
|
?>
|
|
<header class="home-nav" role="banner">
|
|
<a class="home-nav__logo" href="<?php echo esc_url( home_url( '/' ) ); ?>">
|
|
<?php bloginfo( 'name' ); ?>
|
|
</a>
|
|
|
|
<nav class="home-nav__menu" aria-label="<?php esc_attr_e( 'Primary', 'sewjoy-theme' ); ?>">
|
|
<?php
|
|
$fallback_items = array( 'SHOP', 'DESIGN YOURS', 'FABRICS', 'MEMBERSHIP', 'COMMUNITY', 'ABOUT' );
|
|
$has_menu = has_nav_menu( 'menu-1' );
|
|
|
|
if ( $has_menu ) {
|
|
wp_nav_menu( array(
|
|
'theme_location' => 'menu-1',
|
|
'container' => false,
|
|
'menu_class' => 'home-nav__menu-list',
|
|
'depth' => 1,
|
|
'fallback_cb' => false,
|
|
) );
|
|
} else {
|
|
echo '<ul class="home-nav__menu-list">';
|
|
foreach ( $fallback_items as $item ) {
|
|
printf(
|
|
'<li><a href="%s">%s</a></li>',
|
|
esc_url( home_url( '/' ) ),
|
|
esc_html( $item )
|
|
);
|
|
}
|
|
echo '</ul>';
|
|
}
|
|
?>
|
|
</nav>
|
|
|
|
<div class="home-nav__icons" aria-label="<?php esc_attr_e( 'Account', 'sewjoy-theme' ); ?>">
|
|
<button type="button" class="home-nav__icon" aria-label="<?php esc_attr_e( 'Search', 'sewjoy-theme' ); ?>">⌕</button>
|
|
<button type="button" class="home-nav__icon" aria-label="<?php esc_attr_e( 'Wishlist', 'sewjoy-theme' ); ?>">♡</button>
|
|
<button type="button" class="home-nav__icon" aria-label="<?php esc_attr_e( 'Cart', 'sewjoy-theme' ); ?>">▢</button>
|
|
</div>
|
|
</header>
|
|
<div class="home-nav__divider" role="presentation"></div>
|