- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
WordPress. How to assign a custom link to logo
March 3, 2014
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:
-
Open the content\themes\theme#####\static directory on your FTP
-
Open static-logo.php for editing.
-
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>
-
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>
-
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>
-
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>
-
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.