Changeset 12050 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/header.php
- Timestamp:
- 09/05/2022 05:14:31 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/header.php
r11496 r12050 8 8 */ 9 9 10 \WordPressdotorg\skip_to( '#content' ); 11 10 12 echo do_blocks( '<!-- wp:wporg/global-header /-->' ); 13 14 $show_search = DevHub\should_show_search_bar(); 15 16 // When to show the masthead 17 $show_masthead = is_front_page() || is_page( 'reference' ); 11 18 12 19 ?> 13 20 14 <header id="masthead" class="site-header<?php if ( is_front_page()) { echo ' home'; } ?>" role="banner">21 <header id="masthead" class="site-header<?php if ( $show_masthead ) { echo ' home'; } ?>" role="banner"> 15 22 <?php if ( function_exists( 'wporg_is_handbook' ) && wporg_is_handbook() && ! is_search() ) : ?> 16 23 <a href="#" id="secondary-toggle" onclick="return false;"><strong><?php _e( 'Menu', 'wporg' ); ?></strong></a> 17 24 <?php endif; ?> 18 <div class="site-branding"> 25 <div class="site-branding<?php echo ! $show_masthead && $show_search ? ' has-actions': '' ?>"> 26 19 27 <h1 class="site-title"> 20 28 <a href="<?php echo esc_url( DevHub\get_site_section_url() ); ?>" rel="home"><?php echo DevHub\get_site_section_title(); ?></a> … … 25 33 <?php endif; ?> 26 34 27 <nav id="site-navigation" class="main-navigation" role="navigation"> 28 <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> 29 <?php 30 $active_menu = is_post_type_archive( 'command' ) || is_singular( 'command' ) ? 'devhub-cli-menu' : 'devhub-menu'; 31 wp_nav_menu( array( 32 'theme_location' => $active_menu, 33 'container_class' => 'menu-container', 34 'container_id' => 'primary-menu', 35 ) ); ?> 36 </nav> 35 <div> 36 <?php if ( $show_search ) : ?> 37 <?php get_search_form(); ?> 38 <?php endif; ?> 39 40 <?php if ( ! $show_masthead ) : ?> 41 <nav id="site-navigation" class="main-navigation" role="navigation"> 42 <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> 43 <?php 44 $active_menu = is_post_type_archive( 'command' ) || is_singular( 'command' ) ? 'devhub-cli-menu' : 'devhub-menu'; 45 wp_nav_menu( array( 46 'theme_location' => $active_menu, 47 'container_class' => 'menu-container', 48 'container_id' => 'primary-menu', 49 ) ); ?> 50 </nav> 51 <?php endif; ?> 52 </div> 37 53 </div> 38 54 </header><!-- #masthead --> 39 55 40 56 <div id="page" class="hfeed site devhub-wrap"> 41 <a href="#main" class="screen-reader-text"><?php _e( 'Skip to content', 'wporg' ); ?></a>42 43 57 <?php do_action( 'before' ); ?> 44 <?php45 if ( DevHub\should_show_search_bar() ) : ?>46 <div id="inner-search">47 <?php get_search_form(); ?>48 <div id="inner-search-icon-container">49 <div id="inner-search-icon">50 <div class="dashicons dashicons-search"><span class="screen-reader-text"><?php _e( 'Search', 'wporg' ); ?></span></div>51 </div>52 </div>53 </div>54 55 <?php endif; ?>56 58 <div id="content" class="site-content">
Note: See TracChangeset
for help on using the changeset viewer.