Hi,
I used the below code from one of your previous posts to remove the h1 tag from the site title for all pages on the site. Is there a way to modify this so that the site title has a h1 tag just on the home page, but not any of the other pages?
if ( ! function_exists( ‘ultra_display_logo’ ) ) :
/**
* Display the logo.
*/
function ultra_display_logo() {
$logo = siteorigin_setting( ‘header_logo’ );
$logo = apply_filters( ‘ultra_logo_image_id’, $logo );
if ( empty( $logo ) ) {
if ( function_exists( ‘has_custom_logo’ ) && has_custom_logo() ) {
the_custom_logo();
return;
}
// Just display the site title.
$logo_html = ‘<h2 class=”site-title”>’ . get_bloginfo( ‘name’ ) . ‘</h2>’;
$logo_html = apply_filters( ‘ultra_logo_text’, $logo_html );
}
else {
// Load the logo image.
if ( is_array( $logo ) ) {
list ( $src, $height, $width ) = $logo;
}
else {
$image = wp_get_attachment_image_src( $logo, ‘full’ );
$src = $image[0];
$height = $image[2];
$width = $image[1];
}
// Add the logo attributes.
$logo_attributes = apply_filters( ‘ultra_logo_image_attributes’, array(
‘src’ => $src,
‘width’ => round( $width ),
‘height’ => round( $height ),
‘alt’ => sprintf( esc_html__( ‘%s Logo’, ‘ultra’ ), get_bloginfo( ‘name’ ) ),
) );
if ( siteorigin_setting( ‘header_sticky’ ) && siteorigin_setting( ‘header_scale’ ) ) $logo_attributes[‘data-scale’] = ‘1’;
$logo_attributes_str = array();
if ( ! empty( $logo_attributes ) ) {
foreach($logo_attributes as $name => $val) {
if ( empty( $val ) ) continue;
$logo_attributes_str[] = $name.’=”‘.esc_attr($val).’” ‘;
}
}
$logo_html = apply_filters( ‘ultra_logo_image’, ‘‘ );
}
// Echo the image.
echo apply_filters( ‘ultra_logo_html’, $logo_html );
}
endif;
Thanks,
April