Categories

Featured templates

WordPress. How to assign a custom link to logo

Daniel Morales March 3, 2014
Rating: 4.7/5. From 3 votes.
Please wait...

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.

HTML 5 Wordpress Themes
This entry was posted in WordPress Tutorials and tagged assign, custom, link, logo. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket