[Resolved] Site logo pointing to different page

Home Forums Support [Resolved] Site logo pointing to different page

Home Forums Support Site logo pointing to different page

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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!
    Saul

    #1171727
    Leo
    Staff
    Customer Support

    Hi 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 πŸ™‚

    #1171832
    Sam

    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?

    #1172059
    Tom
    Lead Developer
    Lead Developer

    Hi 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 πŸ™‚

    #1172358
    Sam

    Hi Tom and Leo!

    I created a codde snippet according to your code. It worked.
    Thanks!

    #1172825
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.