Home › Forums › Gillion Theme › Logo link
Home › Forums › Gillion Theme › Logo link
How do I change the default logo link?
Hi Diacre,
I hope you are well today and thank you for your question.
If you want to change default logo then you can do so from theme header settings but if you want to change logo URL then you have to add following function code in the functions.php file of Gillion child Theme and change the function home_url( ‘/’ ) to URL whatever you want to.
function gillion_header_logo() {
$standard_logo = gillion_option_image('logo');
/* Use Gillion Logo if Logo is not uploaded */
if( !$standard_logo ) :
$standard_logo = get_template_directory_uri().'/img/logo.png';
endif;
$sticky_logo = ( gillion_option_image('logo_sticky') ) ? gillion_option_image('logo_sticky') : $standard_logo;
$light_logo = ( gillion_option_image('logo_light') ) ? gillion_option_image('logo_light') : $standard_logo;
if( gillion_logo_height() && gillion_logo_height() != 'auto' ) :
$height = ' height="'.str_replace("px", "", gillion_logo_height() ).'"';
else :
$height = '';
endif;
?>
<div class="header-logo">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="header-logo-container sh-table-small">
<div class="sh-table-cell">
<img class="sh-standard-logo" src="<?php echo esc_url( $standard_logo ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>"<?php echo esc_attr( $height ); ?> />
<img class="sh-sticky-logo" src="<?php echo esc_url( $sticky_logo ); ?>" alt="<?php echo get_bloginfo( 'name' ); ?>"<?php echo esc_attr( $height ); ?> />
<img class="sh-light-logo" src="<?php echo esc_url( $light_logo ); ?>" alt="<?php echo get_bloginfo( 'name' ); ?>"<?php echo esc_attr( $height ); ?> />
</div>
</a>
</div>
<?php }
Best regards,
Shufflehound team
It’s not working. I’m trying to link it to an external link.
Here’s what I tried
function gillion_header_logo() {
$standard_logo = gillion_option_image(‘logo’);
/* Use Gillion Logo if Logo is not uploaded */
if( !$standard_logo ) :
$standard_logo = get_template_directory_uri().’/img/logo.png’;
endif;
$sticky_logo = ( gillion_option_image(‘logo_sticky’) ) ? gillion_option_image(‘logo_sticky’) : $standard_logo;
$light_logo = ( gillion_option_image(‘logo_light’) ) ? gillion_option_image(‘logo_light’) : $standard_logo;
if( gillion_logo_height() && gillion_logo_height() != ‘auto’ ) :
$height = ‘ height=”‘.str_replace(“px”, “”, gillion_logo_height() ).'”‘;
else :
$height = ”;
endif;
?>
<div class=”header-logo”>
‘ )); ?>” class=”header-logo-container sh-table-small”>
<div class=”sh-table-cell”>
” alt=”<?php echo esc_attr( get_bloginfo( ‘name’ ) ); ?>”<?php echo esc_attr( $height ); ?> />
” alt=”<?php echo get_bloginfo( ‘name’ ); ?>”<?php echo esc_attr( $height ); ?> />
” alt=”<?php echo get_bloginfo( ‘name’ ); ?>”<?php echo esc_attr( $height ); ?> />
</div>
</div>
<?php }
Nevermind. It worked!!
Awesome great to see it is working for you now.
Please advise if you have more questions.
Have a fantastic day!
If you need services beyond standard support, we've got your back!
If you'd prefer not to handle the installation yourself or need help getting started, we'll set everything up for you.
We'll help you rearrange sections, adjust spacing, and modify the page structure to fit your needs.
More complex styling changes, theme option modifications, and third-party integrations.
If you need something that's not included in the theme, we can code it for you.
Web design services to create custom sections, pages, and blocks for your theme, plus graphics and visualizations.
Full website builds, custom theme development, or plugin creation from scratch.
We'll provide a clear quote based on what you need. No hidden fees.