Archived topic
How to change URL target of in-menu site icon?
5 replies · Started by Derek on November 27, 2018
Hello,
So...you know that site icon that you can have replace the Home link in your main menu? When you click on it, it redirects you to the home page. I would like to change that behavior and have it redirect to a custom url. How can this be accomplished? :)
Really appreciate it!
Thank you!
Hi Derek,
Since you are only using the navigation logo and not the normal logo, you can use this filter:
https://docs.generatepress.com/article/generate_logo_href/
Search generate_logo_href to see examples if you need.
Let me know if you need help with the code :)
Hi Leo,
Thank you for the reply! The examples I found seemed to include other lines I think I don't need...defiantly going to need help with the code :P
Thanks!!
So you want to change it globally?
Then this should work:
add_filter( 'generate_logo_href', function() {
return 'https://CUSTOM-LOGO-URL';
} );
Adding PHP: https://docs.generatepress.com/article/adding-php/
Outstanding!
Awesome :)