Custom Logo Function SEO optimized

Hello! I would like to give a small tip. For SEO reasons, they say on homepage the Logo has to be inside an h1 tag and on all the other pages without enclosing it inside an h1 tag. For the function custom logo you haven’t implement it, so I make it! I hope this helps!

function talon_site_branding() {
	?>
	<div class="site-branding">
	<?php
	if ( function_exists( 'the_custom_logo' ) && has_custom_logo() ) {
		if ( is_front_page() || is_home() ) : ?>
			<h1 class="site-title">
				<?php the_custom_logo(); ?></a>
			</h1>
		<?php else :
			the_custom_logo();
		endif;
	} else {
		if ( is_front_page() || is_home() ) : ?>
			<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
		<?php else : ?>
			<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
		<?php
		endif;

		$description = get_bloginfo( 'description', 'display' );
		if ( $description || is_customize_preview() ) : ?>
			<p class="site-description"><?php echo $description; ?></p>
		<?php endif;
	}
	?>
	</div>
	<?php
}

Hi,

Thanks, we were actually planning on doing something like this.