Customize logo link

Hi! My main logo image set in the header is defaulting to a URL and I need to change it to something else. How can I customize this link? Thank you!

Hi @bzsim8,

I hope you are well today and thank you for your question.

You can try achieving this by using the attached custom child theme of Shapely theme that contains some custom code.

The shared child theme contains the following code in its functions.php file so just change the URL https://colorlib.com in it to whatever you want to set as logo link.

/* 
 * Header Logo
 */
function custom_shapely_get_header_logo(){
  $logo_id = get_theme_mod('header_logo', ''); 
  $logo = wp_get_attachment_image_src($logo_id, 'full'); ?>
    
  <a href="https://colorlib.com"><?php
  if( $logo[0] != '' ){ ?>
    <img src="<?php echo $logo[0]; ?>" class="logo" alt="<?php echo esc_html( get_bloginfo( 'name' ) ); ?>"><?php
  }
  else{ ?>
    <h1 class="site-title"><?php echo esc_html( get_bloginfo( 'name' ) ); ?></h1><?php 
  } ?>
  </a><?php  
}

Best Regards,
Movin

Hi Movin,

I had the same request as the user above and when I went to use the child theme, the header will only display the Site Title text and will not display a logo. Do you know what could be causing that issue?

@llewton That is old solution and the theme is changed a lot now so instead of using that solution could you please create your own thread for your question here https://colorlibsupport.com/c/shapely/

If you want to you can also add reference of this thread in your newly created thread.

We would be more than happy to help you on your new thread.