@@ -10,9 +10,9 @@ |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Print the 1st instance of a paragraph block. If none is found, print the content. |
13 | -if ( has_block( 'core/paragraph', get_the_content() ) ) { |
|
13 | +if (has_block('core/paragraph', get_the_content())) { |
|
14 | 14 | |
15 | - twenty_twenty_one_print_first_instance_of_block( 'core/paragraph', get_the_content() ); |
|
15 | + twenty_twenty_one_print_first_instance_of_block('core/paragraph', get_the_content()); |
|
16 | 16 | } else { |
17 | 17 | |
18 | 18 | the_content(); |
@@ -11,12 +11,12 @@ |
||
11 | 11 | |
12 | 12 | $content = get_the_content(); |
13 | 13 | |
14 | -if ( has_block( 'core/audio', $content ) ) { |
|
15 | - twenty_twenty_one_print_first_instance_of_block( 'core/audio', $content ); |
|
16 | -} elseif ( has_block( 'core/embed', $content ) ) { |
|
17 | - twenty_twenty_one_print_first_instance_of_block( 'core/embed', $content ); |
|
14 | +if (has_block('core/audio', $content)) { |
|
15 | + twenty_twenty_one_print_first_instance_of_block('core/audio', $content); |
|
16 | +} elseif (has_block('core/embed', $content)) { |
|
17 | + twenty_twenty_one_print_first_instance_of_block('core/embed', $content); |
|
18 | 18 | } else { |
19 | - twenty_twenty_one_print_first_instance_of_block( 'core-embed/*', $content ); |
|
19 | + twenty_twenty_one_print_first_instance_of_block('core-embed/*', $content); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | // Add the excerpt. |
@@ -10,9 +10,9 @@ |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Print the 1st gallery found. |
13 | -if ( has_block( 'core/gallery', get_the_content() ) ) { |
|
13 | +if (has_block('core/gallery', get_the_content())) { |
|
14 | 14 | |
15 | - twenty_twenty_one_print_first_instance_of_block( 'core/gallery', get_the_content() ); |
|
15 | + twenty_twenty_one_print_first_instance_of_block('core/gallery', get_the_content()); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | the_excerpt(); |
@@ -7,34 +7,34 @@ |
||
7 | 7 | * @since Twenty Twenty-One 1.0 |
8 | 8 | */ |
9 | 9 | |
10 | -$blog_info = get_bloginfo( 'name' ); |
|
11 | -$description = get_bloginfo( 'description', 'display' ); |
|
12 | -$show_title = ( true === get_theme_mod( 'display_title_and_tagline', true ) ); |
|
10 | +$blog_info = get_bloginfo('name'); |
|
11 | +$description = get_bloginfo('description', 'display'); |
|
12 | +$show_title = (true === get_theme_mod('display_title_and_tagline', true)); |
|
13 | 13 | $header_class = $show_title ? 'site-title' : 'screen-reader-text'; |
14 | 14 | |
15 | 15 | ?> |
16 | 16 | |
17 | -<?php if ( has_custom_logo() && $show_title ) : ?> |
|
17 | +<?php if (has_custom_logo() && $show_title) : ?> |
|
18 | 18 | <div class="site-logo"><?php the_custom_logo(); ?></div> |
19 | 19 | <?php endif; ?> |
20 | 20 | |
21 | 21 | <div class="site-branding"> |
22 | 22 | |
23 | - <?php if ( has_custom_logo() && ! $show_title ) : ?> |
|
23 | + <?php if (has_custom_logo() && ! $show_title) : ?> |
|
24 | 24 | <div class="site-logo"><?php the_custom_logo(); ?></div> |
25 | 25 | <?php endif; ?> |
26 | 26 | |
27 | - <?php if ( $blog_info ) : ?> |
|
28 | - <?php if ( is_front_page() && ! is_paged() ) : ?> |
|
29 | - <h1 class="<?php echo esc_attr( $header_class ); ?>"><?php echo esc_html( $blog_info ); ?></h1> |
|
30 | - <?php elseif ( is_front_page() && ! is_home() ) : ?> |
|
31 | - <h1 class="<?php echo esc_attr( $header_class ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php echo esc_html( $blog_info ); ?></a></h1> |
|
27 | + <?php if ($blog_info) : ?> |
|
28 | + <?php if (is_front_page() && ! is_paged()) : ?> |
|
29 | + <h1 class="<?php echo esc_attr($header_class); ?>"><?php echo esc_html($blog_info); ?></h1> |
|
30 | + <?php elseif (is_front_page() && ! is_home()) : ?> |
|
31 | + <h1 class="<?php echo esc_attr($header_class); ?>"><a href="<?php echo esc_url(home_url('/')); ?>"><?php echo esc_html($blog_info); ?></a></h1> |
|
32 | 32 | <?php else : ?> |
33 | - <p class="<?php echo esc_attr( $header_class ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php echo esc_html( $blog_info ); ?></a></p> |
|
33 | + <p class="<?php echo esc_attr($header_class); ?>"><a href="<?php echo esc_url(home_url('/')); ?>"><?php echo esc_html($blog_info); ?></a></p> |
|
34 | 34 | <?php endif; ?> |
35 | 35 | <?php endif; ?> |
36 | 36 | |
37 | - <?php if ( $description && true === get_theme_mod( 'display_title_and_tagline', true ) ) : ?> |
|
37 | + <?php if ($description && true === get_theme_mod('display_title_and_tagline', true)) : ?> |
|
38 | 38 | <p class="site-description"> |
39 | 39 | <?php echo $description; // phpcs:ignore WordPress.Security.EscapeOutput ?> |
40 | 40 | </p> |
@@ -29,8 +29,11 @@ |
||
29 | 29 | <h1 class="<?php echo esc_attr( $header_class ); ?>"><?php echo esc_html( $blog_info ); ?></h1> |
30 | 30 | <?php elseif ( is_front_page() && ! is_home() ) : ?> |
31 | 31 | <h1 class="<?php echo esc_attr( $header_class ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php echo esc_html( $blog_info ); ?></a></h1> |
32 | - <?php else : ?> |
|
33 | - <p class="<?php echo esc_attr( $header_class ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php echo esc_html( $blog_info ); ?></a></p> |
|
32 | + <?php else { |
|
33 | + : ?> |
|
34 | + <p class="<?php echo esc_attr( $header_class ); |
|
35 | +} |
|
36 | +?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php echo esc_html( $blog_info ); ?></a></p> |
|
34 | 37 | <?php endif; ?> |
35 | 38 | <?php endif; ?> |
36 | 39 |
@@ -9,13 +9,13 @@ |
||
9 | 9 | |
10 | 10 | $wrapper_classes = 'site-header'; |
11 | 11 | $wrapper_classes .= has_custom_logo() ? ' has-logo' : ''; |
12 | -$wrapper_classes .= ( true === get_theme_mod( 'display_title_and_tagline', true ) ) ? ' has-title-and-tagline' : ''; |
|
13 | -$wrapper_classes .= has_nav_menu( 'primary' ) ? ' has-menu' : ''; |
|
12 | +$wrapper_classes .= (true === get_theme_mod('display_title_and_tagline', true)) ? ' has-title-and-tagline' : ''; |
|
13 | +$wrapper_classes .= has_nav_menu('primary') ? ' has-menu' : ''; |
|
14 | 14 | ?> |
15 | 15 | |
16 | -<header id="masthead" class="<?php echo esc_attr( $wrapper_classes ); ?>"> |
|
16 | +<header id="masthead" class="<?php echo esc_attr($wrapper_classes); ?>"> |
|
17 | 17 | |
18 | - <?php get_template_part( 'template-parts/header/site-branding' ); ?> |
|
19 | - <?php get_template_part( 'template-parts/header/site-nav' ); ?> |
|
18 | + <?php get_template_part('template-parts/header/site-branding'); ?> |
|
19 | + <?php get_template_part('template-parts/header/site-nav'); ?> |
|
20 | 20 | |
21 | 21 | </header><!-- #masthead --> |
@@ -9,14 +9,14 @@ |
||
9 | 9 | |
10 | 10 | // Don't show the title if the post-format is `aside` or `status`. |
11 | 11 | $post_format = get_post_format(); |
12 | -if ( 'aside' === $post_format || 'status' === $post_format ) { |
|
12 | +if ('aside' === $post_format || 'status' === $post_format) { |
|
13 | 13 | return; |
14 | 14 | } |
15 | 15 | ?> |
16 | 16 | |
17 | 17 | <header class="entry-header"> |
18 | 18 | <?php |
19 | - the_title( sprintf( '<h2 class="entry-title default-max-width"><a href="%s">', esc_url( get_permalink() ) ), '</a></h2>' ); |
|
19 | + the_title(sprintf('<h2 class="entry-title default-max-width"><a href="%s">', esc_url(get_permalink())), '</a></h2>'); |
|
20 | 20 | twenty_twenty_one_post_thumbnail(); |
21 | 21 | ?> |
22 | 22 | </header><!-- .entry-header --> |
@@ -9,15 +9,15 @@ |
||
9 | 9 | |
10 | 10 | ?> |
11 | 11 | |
12 | -<?php if ( has_nav_menu( 'primary' ) ) : ?> |
|
13 | - <nav id="site-navigation" class="primary-navigation" aria-label="<?php esc_attr_e( 'Primary menu', 'twentytwentyone' ); ?>"> |
|
12 | +<?php if (has_nav_menu('primary')) : ?> |
|
13 | + <nav id="site-navigation" class="primary-navigation" aria-label="<?php esc_attr_e('Primary menu', 'twentytwentyone'); ?>"> |
|
14 | 14 | <div class="menu-button-container"> |
15 | 15 | <button id="primary-mobile-menu" class="button" aria-controls="primary-menu-list" aria-expanded="false"> |
16 | - <span class="dropdown-icon open"><?php esc_html_e( 'Menu', 'twentytwentyone' ); ?> |
|
17 | - <?php echo twenty_twenty_one_get_icon_svg( 'ui', 'menu' ); // phpcs:ignore WordPress.Security.EscapeOutput ?> |
|
16 | + <span class="dropdown-icon open"><?php esc_html_e('Menu', 'twentytwentyone'); ?> |
|
17 | + <?php echo twenty_twenty_one_get_icon_svg('ui', 'menu'); // phpcs:ignore WordPress.Security.EscapeOutput ?> |
|
18 | 18 | </span> |
19 | - <span class="dropdown-icon close"><?php esc_html_e( 'Close', 'twentytwentyone' ); ?> |
|
20 | - <?php echo twenty_twenty_one_get_icon_svg( 'ui', 'close' ); // phpcs:ignore WordPress.Security.EscapeOutput ?> |
|
19 | + <span class="dropdown-icon close"><?php esc_html_e('Close', 'twentytwentyone'); ?> |
|
20 | + <?php echo twenty_twenty_one_get_icon_svg('ui', 'close'); // phpcs:ignore WordPress.Security.EscapeOutput ?> |
|
21 | 21 | </span> |
22 | 22 | </button><!-- #primary-mobile-menu --> |
23 | 23 | </div><!-- .menu-button-container --> |
@@ -7,4 +7,4 @@ |
||
7 | 7 | * @since Twenty Twenty-One 1.0 |
8 | 8 | */ |
9 | 9 | |
10 | -the_title( '<h1 class="entry-title">', '</h1>' ); |
|
10 | +the_title('<h1 class="entry-title">', '</h1>'); |
@@ -7,10 +7,10 @@ |
||
7 | 7 | * @since Twenty Twenty-One 1.0 |
8 | 8 | */ |
9 | 9 | |
10 | -if ( is_active_sidebar( 'sidebar-1' ) ) : ?> |
|
10 | +if (is_active_sidebar('sidebar-1')) : ?> |
|
11 | 11 | |
12 | 12 | <aside class="widget-area"> |
13 | - <?php dynamic_sidebar( 'sidebar-1' ); ?> |
|
13 | + <?php dynamic_sidebar('sidebar-1'); ?> |
|
14 | 14 | </aside><!-- .widget-area --> |
15 | 15 | |
16 | 16 | <?php endif; ?> |