Changeset 13272 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support-2024/header.php
- Timestamp:
- 03/05/2024 02:45:07 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support-2024/header.php
r12990 r13272 12 12 namespace WordPressdotorg\Forums; 13 13 14 $menu_items = array(15 /* translators: relative link to the forums home page */16 _x( '/forums/', 'header menu', 'wporg-forums' ) => _x( 'Forums', 'header menu', 'wporg-forums' ),17 _x( 'https://wordpress.org/support/guidelines/', 'header menu', 'wporg-forums' ) => _x( 'Guidelines', 'header menu', 'wporg-forums' ),18 _x( 'https://wordpress.org/documentation/', 'header menu', 'wporg-forums' ) => _x( 'Documentation', 'header menu', 'wporg-forums' ),19 _x( 'https://make.wordpress.org/support/handbook/', 'header menu', 'wporg-forums' ) => _x( 'Get Involved', 'header menu', 'wporg-forums' ),20 );21 22 14 \WordPressdotorg\skip_to( '#content' ); 23 15 24 echo do_blocks( '<!-- wp:wporg/global-header /-->' ); 16 echo do_blocks( '<!-- wp:wporg/global-header {"style":{"border":{"bottom":{"color":"var:preset|color|white-opacity-15","style":"solid","width":"1px"}}}} /-->' ); 17 18 $is_forums_home = function_exists( 'bbp_is_forum_archive' ) && bbp_is_forum_archive(); 19 $is_user_profile = function_exists( 'bbp_is_single_user' ) && bbp_is_single_user(); 20 21 echo do_blocks( $is_forums_home 22 ? '<!-- wp:pattern {"slug":"wporg-support/local-nav-home"} /-->' 23 : '<!-- wp:pattern {"slug":"wporg-support/local-nav"} /-->' 24 ); 25 25 26 26 ?> … … 30 30 31 31 <div id="content" class="site-content"> 32 < header id="masthead" class="site-header <?php echo is_front_page() ? 'home' : ''; ?>" role="banner">33 < div class="site-branding">34 < ?php if ( is_front_page() ) : ?>32 <?php if ( is_front_page() ) : ?> 33 <header id="masthead" class="site-header <?php echo is_front_page() ? 'home' : ''; ?>" role="banner"> 34 <div class="site-branding"> 35 35 <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/forums/' ) ); ?>" rel="home"><?php _ex( 'WordPress Support', 'Site title', 'wporg-forums' ); ?></a></h1> 36 36 … … 42 42 </p> 43 43 <?php get_search_form(); ?> 44 <?php else : ?> 45 <p class="site-title"><a href="<?php echo esc_url( home_url( '/forums/' ) ); ?>" rel="home"><?php _ex( 'Support', 'Site title', 'wporg-forums' ); ?></a></p> 44 </div><!-- .site-branding --> 45 </header><!-- #masthead --> 46 <?php elseif ( $is_forums_home ) : ?> 47 <?php echo do_blocks( 48 sprintf( 49 '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"right":"var:preset|spacing|edge-space","left":"var:preset|spacing|edge-space"}}},"backgroundColor":"charcoal-2","className":"has-white-color has-charcoal-2-background-color has-text-color has-background has-link-color","layout":{"type":"constrained"}} --> 50 <div class="wp-block-group alignfull has-white-color has-charcoal-2-background-color has-text-color has-background has-link-color" style="padding-right:var(--wp--preset--spacing--edge-space);padding-left:var(--wp--preset--spacing--edge-space)"> 46 51 47 <nav id="site-navigation" class="main-navigation" role="navigation"> 48 <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-forums' ); ?>"></button> 49 <div id="primary-menu" class="menu"> 50 <ul> 51 <?php 52 foreach ( $menu_items as $path => $text ) : 53 $url = parse_url( $path ); 52 <!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|40","bottom":"var:preset|spacing|40"},"blockGap":"var:preset|spacing|30"}},"layout":{"type":"flex","flexWrap":"wrap","verticalAlignment":"bottom"}} --> 53 <div class="wp-block-group alignwide" style="padding-top:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--40)"> 54 54 55 // Check both host and path (if available).56 $is_same_host = ! empty( $url['host'] ) ? $url['host'] === $_SERVER['HTTP_HOST'] : true;57 $is_same_path = ! empty( $url['path'] ) && false !== strpos( $_SERVER['REQUEST_URI'], $url['path'] );55 <!-- wp:heading {"level":1,"style":{"typography":{"fontSize":"50px","fontStyle":"normal","fontWeight":"400"}},"fontFamily":"eb-garamond"} --> 56 <h1 class="wp-block-heading has-eb-garamond-font-family" style="font-size:50px;font-style:normal;font-weight:400">%s</h1> 57 <!-- /wp:heading --> 58 58 59 $class = ( $is_same_host && $is_same_path ) ? 'class="active" ' : ''; 59 <!-- wp:paragraph {"style":{"typography":{"lineHeight":"2.3"}},"textColor":"white"} --> 60 <p class="has-white-color has-text-color" style="line-height:2.3">%s</p> 61 <!-- /wp:paragraph --> 60 62 61 if ( ! empty( $url['host' ] ) ) {62 $url = esc_url( $path );63 } else {64 $url = esc_url( home_url( $path ) );65 }66 ?>67 <li class="page_item"><a <?php echo $class; ?>href="<?php echo $url; ?>"><?php echo esc_html( $text ); ?></a></li>68 <?php endforeach; ?>69 <li><?php get_search_form(); ?></li>70 </ul>71 63 </div> 72 </nav><!-- #site-navigation --> 73 <?php endif; ?> 74 </div><!-- .site-branding --> 75 </header><!-- #masthead --> 76 <div id="lang-guess-wrap"></div> 64 <!-- /wp:group --> 65 66 </div> 67 <!-- /wp:group --> 68 69 <!-- wp:wporg/language-suggest {"align":"full"} --> 70 <div class="wp-block-wporg-language-suggest alignfull"></div> 71 <!-- /wp:wporg/language-suggest --> 72 73 <!-- wp:group {"layout":{"type":"constrained","justifyContent":"center"},"style":{"border":{"bottom":{"color":"var:preset|color|light-grey-1","style":"solid","width":"1px"}},"spacing":{"padding":{"left":"var:preset|spacing|edge-space","right":"var:preset|spacing|edge-space"}}}} --> 74 <div class="wp-block-group alignfull" style="padding-left:var(--wp--preset--spacing--edge-space);padding-right:var(--wp--preset--spacing--edge-space);border-bottom:1px solid var(--wp--preset--color--light-grey-1)"> 75 76 <!-- wp:pattern {"slug":"wporg-support/search-field"} /--> 77 78 </div> 79 <!-- /wp:group -->', 80 esc_html__( 'Forums', 'wporg-support' ), 81 esc_html__( 'Learn how to help, or get help you need.', 'wporg-support' ) 82 ) 83 ); ?> 84 <?php elseif ( ! $is_user_profile ) : ?> 85 <?php echo do_blocks( 86 '<!-- wp:group {"style":{"spacing":{"border":{"bottom":{"color":"var:preset|color|light-grey-1","style":"solid","width":"1px"}},"padding":{"left":"var:preset|spacing|edge-space","right":"var:preset|spacing|edge-space"}}}} --> 87 <div class="wp-block-group alignfull" style="padding-left:var(--wp--preset--spacing--edge-space);padding-right:var(--wp--preset--spacing--edge-space);border-bottom:1px solid var(--wp--preset--color--light-grey-1)"> 88 89 <!-- wp:pattern {"slug":"wporg-support/search-field"} /--> 90 91 </div> 92 <!-- /wp:group -->' 93 ); ?> 94 <?php endif; ?>
Note: See TracChangeset
for help on using the changeset viewer.