try is\\u front\\u page()条件函数
<?php } else { ?>
<hgroup>
<?php $is_front_page = is_front_page() ? \'h1\' : \'h6\'; ?>
<<?php echo $is_front_page ?> class="site-title"><a href="<?php echo home_url( \'/\' ); ?>" title="<?php echo esc_attr( get_bloginfo( \'name\', \'display\' ) ); ?>" rel="home"><?php bloginfo( \'name\' ); ?></a></h1>
<h2 class="site-description"><?php bloginfo( \'description\' ); ?></h2>
</hgroup>
<?php } ?>
编辑以解决OP关于添加到标题图像的问题:
<?php $header_image = get_header_image();
if ( ! empty( $header_image ) ) { ?>
<a href="<?php echo esc_url( home_url( \'/\' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( \'name\', \'display\' ) ); ?>" rel="home">
<img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" />
</a>
<?php
/* Start new code here */
$heading = ( is_front_page() ? \'h1\' : \'h6\' );
?>
<<?php echo $heading; ?>>INSERT TEXT HERE</<?php echo $heading; ?>>
<?php
/* End new code here */
?>
<?php } else { ?>