I need to link the Logo to external page

Hi there,
I need to add an external link (to another website) to the Logo image.
I have just checked the Css option but it seems I can't do it only with Css.
I also tried to check the header.php file of the theme but cannot find where it calls for logo.
How can I hard code the new url to Logo?

Thanks
Vlad

Comments

  • Hello,
    Sorry, but it will not be possible - you would have to change the HTML code of that element to achieve that.
    Logo is by the default linked to the homepage.
    Thanks
  • Ok, can you tell me what code is calling the logo in header.php ?
  • I have figured it out:
    The code for logo is in 
    /includes/include-logo.php file
    I just can't make it open in new window.
  • You have to add the html "target" attribute.
    See how it works here:

    Thanks
  • edited July 2021
    This is an embed external element. It can be deleted using the delete key or the backspace key. To view the full element, press the preview button below.


    Hello,

    Could you please show me the code in include-logo.php where I need to put in the link to external website for the log?

    Thanks,

  • Hello @Bendall,

    Sorry, but we do not provide help with the file customizations of the theme.

    We only help with the fixing theme bugs, understanding how the theme works or minor css tweaks.

    Thanks

  • Can't you give us the name of the file and the section where we need to change the link? We don't want the code.

  • Hello,

    The file name is the one you mentioned in your first message:

    This is an embed external element. It can be deleted using the delete key or the backspace key. To view the full element, press the preview button below.

    You should search for the word "link" or <a> tag. If you are using Appearance -> Theme Editor you can use the CTRL + F for searching.


    Best regards

  • Hello,

    I changed the link for the logo as below to www.google.ca, still it's not jumping to the external site. Could you please look into it?

    Thanks


    // link


    if (isset($logo_options['link'])) {

    //$logo_before = '<a id="logo" href="'. esc_url(get_home_url()) .'" title="'. esc_attr(get_bloginfo('name')) .'" data-height="'. intval($logo_height, 10) .'" data-padding="'. intval($logo_padding, 10) .'">';

    $logo_before = '<a id="logo" href="https://www.google.ca/" title="'. esc_attr(get_bloginfo('name')) .'" data-height="'. intval($logo_height, 10) .'" data-padding="'. intval($logo_padding, 10) .'">';

    $logo_after = '</a>';

    } else {

    $logo_before = '<span id="logo" data-height="'. intval($logo_height, 10) .'" data-padding="'. intval($logo_padding, 10) .'">';

    $logo_after = '</span>';

    }

  • Sorry, but as @Pablo said, we do not provide help with file customization.

    In the case where you are editing theme files, you should contact your web developer.


    Best regards

Sign In or Register to comment.