Change URL link of logo to external site

Home Forums Reykjavik Change URL link of logo to external site

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #21197

    michael.rampe
    Participant

    Change URL link of logo to external site

    Resolved

    Hey there! Have you noticed this support service is provided FREE of charge?
    If you like the speed and accuracy of resolutions, please consider supporting me with a small donation. Thank you

    Consider a donation →

    Hey Webman,

    Awesome theme! Just getting started with it.

    I am looking to change the link of the logo to a different one than the homepage (an external URL actually)

    I have dug around in the code but cannot seem to find where to override the site URL for this.

    Can you point me in the right direction?

    M

    #21200

    Oliver Juhas
    Keymaster

    Hi M,

    Thank you, I’m glad you like the theme :)

    The best approach would probably be to copy the templates/parts/header/site-branding.php from Reykjavik theme to your child theme (keeping the folder structure) and edit the file there:

    • Replace <?php echo esc_url( home_url( '/' ) ); ?> with your custom URL.
    • Replace <?php the_custom_logo(); ?> with the logo image you want to use and wrap it in your custom URL link. If you still want to use the WordPress’ the_custom_logo() function, you would need to change its link URL via get_custom_logo filter hook, so editing this directly into the file is better approach in this case I think.

    Best regards,

    Oliver Juhas
    WebMan Design

    #21202

    michael.rampe
    Participant

    Thanks Heaps!

    I ended up googling some more and did it this way: https://stackoverflow.com/questions/38737209/change-my-custom-logo-link-wordpress

    Put this solution in the functions.php file and it worked a treat! Can you foresee any issues doing it this way?

    (Sorry, I am quite new to php)

    M

    #21204

    Oliver Juhas
    Keymaster

    Hi M,

    First, of all, please never edit the theme core files. You will loose all your modifications when you update the theme in the future. Use a child theme for your modifications.

    The solution you’ve linked to is using the get_custom_logo filter hook approach I’ve mentioned in my previous reply. This will only change the URL for your logo image, but not the logo text.

    Please use my suggested solution for Reykjavik theme to set custom URL for the whole logo section of the theme.

    Best regards,

    Oliver Juhas
    WebMan Design

    #21205

    michael.rampe
    Participant

    Ok. Thank you. I was adding it to the child theme function.php… I did listen!

    All I needed was the image URL, not the text ;-)

    • This reply was modified 2 months, 1 week ago by  Oliver Juhas. Reason: Making the post public as there is no sensitive information shared
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.