Hello guys,
Thanks @addweb-solution-pvt-ltd for contributing to the topic. Your solution is correct.
But it will be better not to hardcode the url to the theme.
So here is a better solution.
add_filter( 'get_custom_logo', 'custom_logo_url' );
function custom_logo_url ( $html ) {
$custom_logo_id = get_theme_mod( 'custom_logo' );
//Your Custom URL
$url = 'www.mysiteurl.com'; //Replace the URL with your own.
$html = sprintf( '<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url">%2$s</a>',
esc_url( $url ),
wp_get_attachment_image( $custom_logo_id, 'full', false, array(
'class' => 'custom-logo',
) )
);
return $html;
}
You need to replace the url – https://www.mysiteurl.com in line number 5 with your own url and it’s done.
Read this article to know the correct way to add a code snippet to the theme – https://whitedot-docs.zeetheme.com/docs/developers/adding-php/
Let me know if the problem is solved.
Thank you both for using WhiteDot.
-
This reply was modified 5 years, 11 months ago by ZeeTheme.