This commit is contained in:
2024-05-20 15:37:46 +03:00
commit 00b7dbd0b7
10404 changed files with 3285853 additions and 0 deletions

View File

@ -0,0 +1,10 @@
<?php
/**
* Displays the post header
*
* @package WordPress
* @subpackage Twenty_Twenty_One
* @since Twenty Twenty-One 1.0
*/
the_title( '<h1 class="entry-title">', '</h1>' );

View File

@ -0,0 +1,22 @@
<?php
/**
* Displays the post header
*
* @package WordPress
* @subpackage Twenty_Twenty_One
* @since Twenty Twenty-One 1.0
*/
// Don't show the title if the post-format is `aside` or `status`.
$post_format = get_post_format();
if ( 'aside' === $post_format || 'status' === $post_format ) {
return;
}
?>
<header class="entry-header">
<?php
the_title( sprintf( '<h2 class="entry-title default-max-width"><a href="%s">', esc_url( get_permalink() ) ), '</a></h2>' );
twenty_twenty_one_post_thumbnail();
?>
</header><!-- .entry-header -->

View File

@ -0,0 +1,42 @@
<?php
/**
* Displays header site branding
*
* @package WordPress
* @subpackage Twenty_Twenty_One
* @since Twenty Twenty-One 1.0
*/
$blog_info = get_bloginfo( 'name' );
$description = get_bloginfo( 'description', 'display' );
$show_title = ( true === get_theme_mod( 'display_title_and_tagline', true ) );
$header_class = $show_title ? 'site-title' : 'screen-reader-text';
?>
<?php if ( has_custom_logo() && $show_title ) : ?>
<div class="site-logo"><?php the_custom_logo(); ?></div>
<?php endif; ?>
<div class="site-branding">
<?php if ( has_custom_logo() && ! $show_title ) : ?>
<div class="site-logo"><?php the_custom_logo(); ?></div>
<?php endif; ?>
<?php if ( $blog_info ) : ?>
<?php if ( is_front_page() && ! is_paged() ) : ?>
<h1 class="<?php echo esc_attr( $header_class ); ?>"><?php echo esc_html( $blog_info ); ?></h1>
<?php elseif ( is_front_page() && ! is_home() ) : ?>
<h1 class="<?php echo esc_attr( $header_class ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php echo esc_html( $blog_info ); ?></a></h1>
<?php else : ?>
<p class="<?php echo esc_attr( $header_class ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php echo esc_html( $blog_info ); ?></a></p>
<?php endif; ?>
<?php endif; ?>
<?php if ( $description && true === get_theme_mod( 'display_title_and_tagline', true ) ) : ?>
<p class="site-description">
<?php echo $description; // phpcs:ignore WordPress.Security.EscapeOutput ?>
</p>
<?php endif; ?>
</div><!-- .site-branding -->

View File

@ -0,0 +1,21 @@
<?php
/**
* Displays the site header.
*
* @package WordPress
* @subpackage Twenty_Twenty_One
* @since Twenty Twenty-One 1.0
*/
$wrapper_classes = 'site-header';
$wrapper_classes .= has_custom_logo() ? ' has-logo' : '';
$wrapper_classes .= ( true === get_theme_mod( 'display_title_and_tagline', true ) ) ? ' has-title-and-tagline' : '';
$wrapper_classes .= has_nav_menu( 'primary' ) ? ' has-menu' : '';
?>
<header id="masthead" class="<?php echo esc_attr( $wrapper_classes ); ?>">
<?php get_template_part( 'template-parts/header/site-branding' ); ?>
<?php get_template_part( 'template-parts/header/site-nav' ); ?>
</header><!-- #masthead -->

View File

@ -0,0 +1,37 @@
<?php
/**
* Displays the site navigation.
*
* @package WordPress
* @subpackage Twenty_Twenty_One
* @since Twenty Twenty-One 1.0
*/
?>
<?php if ( has_nav_menu( 'primary' ) ) : ?>
<nav id="site-navigation" class="primary-navigation" aria-label="<?php esc_attr_e( 'Primary menu', 'twentytwentyone' ); ?>">
<div class="menu-button-container">
<button id="primary-mobile-menu" class="button" aria-controls="primary-menu-list" aria-expanded="false">
<span class="dropdown-icon open"><?php esc_html_e( 'Menu', 'twentytwentyone' ); ?>
<?php echo twenty_twenty_one_get_icon_svg( 'ui', 'menu' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
</span>
<span class="dropdown-icon close"><?php esc_html_e( 'Close', 'twentytwentyone' ); ?>
<?php echo twenty_twenty_one_get_icon_svg( 'ui', 'close' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
</span>
</button><!-- #primary-mobile-menu -->
</div><!-- .menu-button-container -->
<?php
wp_nav_menu(
array(
'theme_location' => 'primary',
'menu_class' => 'menu-wrapper',
'container_class' => 'primary-menu-container',
'items_wrap' => '<ul id="primary-menu-list" class="%2$s">%3$s</ul>',
'fallback_cb' => false,
)
);
?>
</nav><!-- #site-navigation -->
<?php
endif;