At Crunchify, we are publishing only high quality tutorials and code snippets which just works without any changes.
Recently we also launched Premium services and also started selling premium plugins and developer services.
Recently we have changed our Premium site (https://crunchify.com
) and matched theme to match with home site (https://crunchify.com
).
While doing that, we noticed that it’s better to have crunchify.com’s header logo URL points to crunchify.com.
Just FYI. We have completely our PRO site migration to Crunchify.com.
This solution works if you have any of below questions?
- How to change the URL of the header image?
- Changes to logo url for Genesis Sample Theme
- How to change URL of main header image?
- How to change Header Image Link To Any URL?
- How to change Header Image link to custom URL?
- How to change the URL of a clickable banner?
- In WordPress how to Link Header Image to Custom URL?
I was looking for the solution for some time and also contacted Genesis WP support team. But didn’t get resolution except some pointers and tips.
As you see, there is no clear solution I got from Genesis support
team.
So after this, I was still looking for a solution to how to change a Clickable Header Link in WordPress?
Finally after some trial and error I was able to change header logo URL.
Here is a code:
Simply put it into your theme’s functions.php file and you should be good. In my case I’ve put this code into my crunchify.com theme's function.php
file.
function crunchify_custom_logo_url ( $crunchify_logo_html ) { $crunchify_custom_logo_id = get_theme_mod( 'custom_logo' ); // Make sure to replace your updated site URL $crunchify_new_url = 'https://crunchify.com'; $crunchify_logo_html = sprintf( '<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url">%2$s</a>', esc_url( $crunchify_new_url ), wp_get_attachment_image( $crunchify_custom_logo_id, 'full', false, array( 'class' => 'custom-logo', ) ) ); return $crunchify_logo_html; } // get_custom_logo: Returns a custom logo, linked to home unless the theme supports removing the link on the home page. add_filter( 'get_custom_logo', 'crunchify_custom_logo_url' );
- Please make sure you change
crunchify_new_url
to your desired URL.
How to verify?
Let’s check if above code is working and it’s not breaking any of Google’s Structure metadata requirement?
Take a look and compare below two HTML markups.
Before changing WordPress header logo URL
<div class="title-area"><a href="https://crunchify.com/wordpress-consulting/" class="custom-logo-link" rel="home"><img width="946" height="198" src="https://crunchify.com/wp-content/uploads/2023/04/crunchify-pro-logo-white.png" class="custom-logo" alt="crunchify-pro-logo-white" srcset="https://crunchify.com/wp-content/uploads/2023/04/crunchify-pro-logo-white.png 946w, https://crunchify.com/wp-content/uploads/2023/04/crunchify-pro-logo-white-768x161.png 768w" sizes="(max-width: 946px) 100vw, 946px" data-attachment-id="2386" data-permalink="https://crunchify.com/wp-content/uploads/2023/04/crunchify-pro-logo-white.png" data-orig-file="https://crunchify.com/wp-content/uploads/2023/04/crunchify-pro-logo-white.png" data-orig-size="946,198" data-comments-opened="1" data-image-meta="{"aperture":"0","credit":"","camera":"","caption":"","created_timestamp":"0","copyright":"","focal_length":"0","iso":"0","shutter_speed":"0","title":"","orientation":"0"}" data-image-title="crunchify-pro-logo-white" data-image-description="" data-medium-file="https://crunchify.com/wp-content/uploads/2023/04/crunchify-pro-logo-white.png" data-large-file="https://crunchify.com/wp-content/uploads/2023/04/crunchify-pro-logo-white.png"></a><p class="site-title">Crunchify Pro</p><p class="site-description">Premium Services, Plugins & Digital Downloads</p></div>
After changing WordPress header logo URL
<div class="title-area"><a href="https://crunchify.com" class="custom-logo-link" rel="home"><img width="946" height="198" src="https://crunchify.com/wp-content/uploads/2023/04/crunchify-pro-logo-white.png" class="custom-logo" alt="crunchify-pro-logo-white" loading="lazy" srcset="https://crunchify.com/wp-content/uploads/2023/04/crunchify-pro-logo-white.png 946w, https://crunchify.com/wp-content/uploads/2023/04/crunchify-pro-logo-white-768x161.png 768w" sizes="(max-width: 946px) 100vw, 946px" data-attachment-id="2386" data-permalink="https://crunchify.com/crunchify-pro-logo-white/" data-orig-file="https://crunchify.com/wp-content/uploads/2023/04/crunchify-pro-logo-white.png" data-orig-size="946,198" data-comments-opened="1" data-image-meta="{"aperture":"0","credit":"","camera":"","caption":"","created_timestamp":"0","copyright":"","focal_length":"0","iso":"0","shutter_speed":"0","title":"","orientation":"0"}" data-image-title="crunchify-pro-logo-white" data-image-description="" data-medium-file="https://crunchify.com/wp-content/uploads/2023/04/crunchify-pro-logo-white.png" data-large-file="https://crunchify.com/wp-content/uploads/2023/04/crunchify-pro-logo-white.png"></a><p class="site-title">Crunchify Pro</p><p class="site-description">Premium Services, Plugins & Digital Downloads</p></div>
Both structure markup looks good and only difference I see is Logo URL. And that’s it 🙂 .
I hope this helps you change your theme’s header logo URL.
Please feel free to let us know via comment your feedback and comment.