• Resolved wezznn

    (@wezznn)


    Hello! I’m trying to disable the link on my header logo and I don’t know how. Can you help me?

    I’ve already created a child theme and added the custom link in functions.php, but since I have 2 languages on my website, I don’t want the logo on the header image to be clickabel. I just want the image as an image non clickabel. Can I do that?

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi Wezzn,

    You can try adding the following code to your Admin Panel > Appearance > Customize > Additional CSS field:

    a.custom-logo-link {
      pointer-events: none;
    }

    Thanks!

    Theme Author oceanwp

    (@oceanwp)

    Hello, I answered to your other topic with the solution ??

    Thread Starter wezznn

    (@wezznn)

    Hey! It worked! Thank you so much! I own you one!

    Theme Author oceanwp

    (@oceanwp)

    You’re welcome ??

    hi,
    Where is the other topic with the solution?
    thank you

    Theme Author oceanwp

    (@oceanwp)

    Hello, add this code int he function.php file of your child theme:

    function my_custom_logo_link() {
    
    	// The logo
        $custom_logo_id = get_theme_mod( 'custom_logo' );
    
        // If has logo
        if ( $custom_logo_id ) {
    
        	// Attr
    	    $custom_logo_attr = array(
    			'class'    => 'custom-logo',
    			'itemprop' => 'logo',
    		);
    
    		// Image alt
    		$image_alt = get_post_meta( $custom_logo_id, '_wp_attachment_image_alt', true );
    		if ( empty( $image_alt ) ) {
    			$custom_logo_attr['alt'] = get_bloginfo( 'name', 'display' );
    		}
    
    	    // Get the image
    	    $html = sprintf( '<span class="custom-logo-link" rel="home" itemprop="url">%2$s</span>',
    			wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr )
    		);
    
    	}
    
    	// Return
        return $html;   
    }
    add_filter( 'get_custom_logo', 'my_custom_logo_link' );

    I’m trying to do the opposite – how do I get the header image to link to a certain page (in my case, just the HOME page)?

    Thanks,
    John

    Theme Author oceanwp

    (@oceanwp)

    Hello @jmnewman, by default, the logo is linked to the homepage.

    Dear @oceanwp, is it possible to link it to an external website?

    Thanks
    Matt

    Theme Author oceanwp

    (@oceanwp)

    Hi, yes: https://docs.oceanwp.org/article/473-change-custom-logo-url
    Change oceanwp.org by your own url.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to remove a link from image header’ is closed to new replies.