Logo link

Home Forums Gillion Theme Logo link

Home Forums Gillion Theme Logo link

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    RESOLVED Posts
  • SarahS
    Participant

    I’m trying to change the link on my logo. I’ve followed the instructions from this thread (https://support.shufflehound.com/forums/topic/logo-link/) & inserted this code into functions.php –

    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”>

    ” 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>
    (<) /a (>)
    </div>

    <?php }

     

     

    (link < > in brackets so the relevant code shows up!)

     

    And changed the home_url to the link I need, but it’s not working. It seems to add the URL I’ve added in home_url to the end of the blog URL (and of course throws up a 404 error).

     

    What am I doing wrong? Nobody seemed to share how they got their link working on all of the threads about this!

     

    Thanks!

    Hi @SarahS,

     

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

     

    You don’t have to just change home_url but whole href tag attribute value as displayed below where xyz.com is website URL.

     

    (<) a href=”http://xyz.com” 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>
    (<) /a (>)

     

    Best regards,
    Shufflehound team

    SarahS
    Participant

    Hi

     

    This is just not working for me at all. I keep getting HTTP 500 errors all the time & have to reupload the functions.php file again through FTP to get back to normal again.

    Can you please paste the entire code I need to be putting in to the functions.php file please just in case there is something I’m doing wrong that is making it go wrong all the time.

    I think this is a very simple feature that should be added in to the theme really at the next update.

    Thanks.

    We will consider this to be implemented in the future  version of theme.

     

    Here’s the whole code.

    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">
    		
    			<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 }

    Solution for this topic

    The code didn’t get shared correctly so i have added it in the attached file.

    Attachments:
    You must be logged in to view attached files.

    SarahS
    Participant

    That is working perfectly now. Thank you!

    You are most welcome here 🙂

Viewing 7 posts - 1 through 7 (of 7 total)