If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

Featured templates

WordPress. How to assign a custom link to logo

This tutorial is going to show you how to assign a custom link to the logo of your WordPress Cherry based template.

WordPress. How to assign a custom link to logo

By default the logo is pointed to the “Home” page of your site. In order to change its link:

  1. Open the content\themes\theme#####\static directory on your FTP

  2. Open static-logo.php  for editing.

  3. If you  are currently using the text logo, in lines 6 and 8 that run:

    <h1 class="logo_h logo_h__txt"><a href="<?php echo home_url(); ?>/" title="<?php bloginfo('description'); ?>" class="logo_link"><?php bloginfo('name'); ?></a></h1>
    <?php } else { ?>
    <h2 class="logo_h logo_h__txt"><a href="<?php echo home_url(); ?>/" title="<?php bloginfo('description'); ?>" class="logo_link"><?php bloginfo('name'); ?></a></h2> 
    
  4. Change <?php echo home_url(); ?> to an URL address like https://www.google.com:

    <h1 class="logo_h logo_h__txt"><a href="https://www.google.com/" title="<?php bloginfo('description'); ?>" class="logo_link"><?php bloginfo('name'); ?></a></h1>
    <?php } else { ?>
    <h2 class="logo_h logo_h__txt"><a href="https://www.google.com/" title="<?php bloginfo('description'); ?>" class="logo_link"><?php bloginfo('name'); ?></a></h2>
    
  5. If you  are currently using the image logo, in lines 12 and 14 of the same file that run:

    <a href="<?php echo home_url(); ?>/" class="logo_h logo_h__img"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/logo.png" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('description'); ?>"></a>
    <?php } else { ?>
    <a href="<?php echo home_url(); ?>/" class="logo_h logo_h__img"><img src="<?php echo of_get_option('logo_url', '' ); ?>" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('description'); ?>"></a>
    
  6. Change <?php echo home_url(); ?> to an URL address like https://www.google.com:

    <a href="https://www.google.com/" class="logo_h logo_h__img"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/logo.png" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('description'); ?>"></a>
    <?php } else { ?>
    <a href="https://www.google.com/" class="logo_h logo_h__img"><img src="<?php echo of_get_option('logo_url', '' ); ?>" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('description'); ?>"></a>
    
  7. Save the changes to the file and click the logo on the frontpage to check if it is pointed to that URL address.

Feel free to check the detailed video tutorial below:

WordPress. How to assign a custom link to logo

If you happen to be looking for top-notch templates for your site, check out wordpress company websites.