Skip to content

Commit

Permalink
Simply menu display.
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenDufresne committed Jun 10, 2022
1 parent d237b4a commit 5298c9c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions source/wp-content/themes/wporg-developer/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,13 @@
// When to show the masthead
$show_masthead = is_front_page() || is_page( 'reference' );

$active_menu = is_post_type_archive( 'command' ) || is_singular( 'command' ) ? 'devhub-cli-menu' : 'devhub-menu';

// When the search is in the subheading bar
$has_menu_items = $show_search && ! $show_masthead || has_nav_menu( $active_menu );

?>

<header id="masthead" class="site-header<?php if ( $show_masthead ) { echo ' home'; } ?>" role="banner">
<?php if ( function_exists( 'wporg_is_handbook' ) && wporg_is_handbook() && ! is_search() ) : ?>
<a href="#" id="secondary-toggle" onclick="return false;"><strong><?php _e( 'Menu', 'wporg' ); ?></strong></a>
<?php endif; ?>
<div class="site-branding<?php echo $has_menu_items && ! ( $show_masthead ) ? ' has-actions': '' ?>">
<div class="site-branding<?php echo ! $show_masthead ? ' has-actions': '' ?>">

<h1 class="site-title">
<a href="<?php echo esc_url( DevHub\get_site_section_url() ); ?>" rel="home"><?php echo DevHub\get_site_section_title(); ?></a>
Expand All @@ -44,6 +39,7 @@
<nav id="site-navigation" class="main-navigation" role="navigation">
<button class="menu-toggle dashicons dashicons-arrow-down-alt2" aria-controls="primary-menu" aria-expanded="false" aria-label="<?php esc_attr_e( 'Primary Menu', 'wporg' ); ?>"></button>
<?php
$active_menu = is_post_type_archive( 'command' ) || is_singular( 'command' ) ? 'devhub-cli-menu' : 'devhub-menu';
wp_nav_menu( array(
'theme_location' => $active_menu,
'container_class' => 'menu-container',
Expand Down

0 comments on commit 5298c9c

Please sign in to comment.