I had a quick look at the site-branding template part which handles the rendering of the custom logo on the site header. There’s a conditional check on two lines against has_custom_logo()
, along show title theme mod, which determines, if the custom logo should be rendered or not.
Internally has_custom_logo()
calls get_theme_mod( 'custom_logo' )
to figure out, if a custom logo has been set. This means, you can use the theme_mod_{$name} filter to change 1) the value of the theme mod and 2) the result of has_custom_logo()
.
As code the above would be something like this,
function prefix_disable_logo_on_front_page( $value ) {
return is_front_page() ? false : $value;
}
add_filter('theme_mod_custom_logo', 'prefix_disable_logo_on_front_page');