Okay
  Public Ticket #2792908
Change logo URL to point to external site
Closed

Comments

  •  48
    Ben started the conversation

    Hi, I'm trying to point the URL of the logo to an external site. I uploaded this plugin: 

    https://wordpress.org/plugins/smntcs-custom-logo-link

    But it doesn't seem to be working. I'm guessing the theme is overriding the plugin settings. 

    Do you know of an easy way thought a snippet or plugin to allow this functionality? 
    Thanks in advance! 

  •  1,878
    Judith replied

    Hi Ben,

    The logo will always link to the home page by default – if you wish to change that to be a custom link you’ll need to edit this section:

    in the header.php file:

    <a id="logo" href="<?php echo home_url(); ?>"> </a>

    Thanks.


  •  8,847
    Tahir replied

    Hey Again,

    Please have a look at this Article :Change logo url link via JS code Globally.

    Thanks 


    ThemeNectar Support Team 

  •  48
    Ben replied

    Thanks Tahir! That works. Do you know if there's an easy way to make it open in a new tab?

  •  1,878
  •  48
    Ben replied

    So I'm not a developer, so I'm only guessing here, but I tried updating the script to look like this to include the "_blank", but it's not working for me. :

    <!-- Redirect Main Logo to External URL -->
    <script type='text/javascript'>
    jQuery( document ).ready(function() {
     jQuery('a#logo').attr('href','https://website.com', "_blank");
    });
    </script>

    Can you show me the correct way to update the script provided by Tahir (below) so that it opens in the new tab? Thanks in advance. 

  •  8,847
    Tahir replied

    Hey Again,

    Use this revised Custom Code.

    <script type="text/javascript">
    jQuery( document ).ready(function() {
     jQuery('a#logo').attr('href','http://creativecorridor.co').attr('target', "_blank");
    });
    </script>

    Thanks 


    ThemeNectar Support Team 

  •  48
    Ben replied

    Thank you so much!