From c1af2804b776139596df5d64ec84104ccdd5eebb Mon Sep 17 00:00:00 2001 From: DivyarajChudasama <92981225+DivyarajChudasama@users.noreply.github.com> Date: Sun, 8 Oct 2023 13:55:56 +0530 Subject: [PATCH] Updated h2 in template-tags.php Argument: If you have a specific design reason for including an

element with the class "site-title," you can update its content to provide additional context or information relevant to the site. For example, you could include a site slogan or descriptor. Pros: Maintains the design element if it's essential for branding or aesthetics. Can provide additional context or information about the site. --- inc/helpers/template-tags.php | 36 ++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/inc/helpers/template-tags.php b/inc/helpers/template-tags.php index adff456..0355fb4 100644 --- a/inc/helpers/template-tags.php +++ b/inc/helpers/template-tags.php @@ -114,25 +114,39 @@ function blank_theme_entry_footer() { } /** - * Get site title. + * Get site title with additional context. * * @param string $title_class Show or hide title. * * @return void */ function blank_theme_site_title( $title_class = '' ) { - $title_format = '

%s

'; - - if ( is_front_page() && is_home() ) { - $title_format = '

%s

'; + $title_format = '

%s

'; // Change to use

for site title + + $site_name = get_bloginfo( 'name', 'display' ); + $site_description = get_bloginfo( 'description', 'display' ); + + // Check if a site description is available. + if ( $site_description ) { + $site_title = sprintf( + $title_format, + esc_attr( $title_class ), + '' . + '' . esc_html( $site_name ) . '' . + '' . esc_html( $site_description ) . '' . + '' + ); + } else { + $site_title = sprintf( + $title_format, + esc_attr( $title_class ), + '' . + '' . esc_html( $site_name ) . '' . + '' + ); } - printf( - $title_format, // phpcs:ignore - esc_attr( $title_class ), - esc_url( home_url( '/' ) ), - get_bloginfo( 'name', 'display' ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - ); + echo $site_title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /**