I'm trying to change the logo depending of the page I'm browsing. The goal is to have different logo style on all single product page.
What I have in my function.php so far is this. I've tried to check by is_product()
but the logo isn't changed.
function change_logo_on_single($html) {
if(is_product()){
$html = preg_replace('/<img(.*?)\/>/', '<img src="Black.png" class="custom-logo" alt=logo"" itemprop="logo" />', $html);
}
return $html;
}
add_filter('get_custom_logo','change_logo_on_single');