- This topic has 5 replies, 3 voices, and was last updated 2 years, 11 months ago by
Tom.
-
AuthorPosts
-
February 20, 2020 at 7:28 am #1171651
Sam
Hi everyone!
I’m very happy with my generatepress journey!
But I’ll allways find something to improve…What I’m willing to do now:
I created an online store in the site sementesdamor.pt.
Using the elements, I created an alternative header, with a slightly different site logo for the store pages.
What I’d like to achive, if possible without over complicating things is to know if it is posilbe for the site logo that links to the home page to link to the shop page in those pages where I have an alternative header.PS: I think that my site actually looks nice (thanks to GP Premium, of course), so you can showcase it any time.
Thanks in advance!
SaulFebruary 20, 2020 at 8:24 am #1171727Leo
StaffCustomer SupportHi there,
I believe this is filter you are looking for:
https://docs.generatepress.com/article/generate_logo_href/Examples:
https://generatepress.com/forums/search/generate_logo_href/Adding PHP: https://docs.generatepress.com/article/adding-php/
Let me know if this helps π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 20, 2020 at 10:04 am #1171832Sam
Hi Leo!
Thanks for your reply.This is what I have so far, I know it’s incomplete:
if ( the_hook_name??? () ) { add_filter( 'generate_logo_href', 'generate_newlogo_href' ); function generate_newlogo_href() { return 'https://www.sementesdamor.pt/loja/'; } }
I wonder…
can I insert the code in the element directly? In that case, what are the parameters?
Or I’ll need to create a code snippet? In that case, what is the hook name?February 20, 2020 at 4:55 pm #1172059Tom
Lead DeveloperLead DeveloperHi there,
It can’t be added to an Element, but you can target your store.
For example:
add_filter( 'generate_logo_href', function( $href ) { if ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) { $href = 'URL TO YOUR STORE'; } return $href; } );
Let me know if that helps or not π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentFebruary 21, 2020 at 2:56 am #1172358Sam
Hi Tom and Leo!
I created a codde snippet according to your code. It worked.
Thanks!February 21, 2020 at 9:08 am #1172825Tom
Lead DeveloperLead DeveloperYou’re welcome π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.