[Resolved] How to change URL target of in-menu site icon?

Home Forums Support [Resolved] How to change URL target of in-menu site icon?

Home Forums Support How to change URL target of in-menu site icon?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #742110
    Derek

    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!

    #742145
    Leo
    Staff
    Customer Support

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

    #742156
    Derek

    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 πŸ˜›

    Thanks!!

    #742171
    Leo
    Staff
    Customer Support

    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/

    #742185
    Derek

    Outstanding!

    #742207
    Leo
    Staff
    Customer Support

    Awesome πŸ™‚

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