[Support request] Have header image there but not linking to homagepage

Home Forums Support [Support request] Have header image there but not linking to homagepage

Home Forums Support Have header image there but not linking to homagepage

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #332488
    oboyhehehe

    Hi

    is it possible to remove the link from the header image that links to home page. I just want the image there but not linking to anything.

    Thanks 🙂

    #332490
    Leo
    Staff
    Customer Support

    Hi there,

    Try removing the logo in Site Identity and just add it as a static image using the before header content hook:
    http://demo.generatepress.com/hook-locations/
    https://docs.generatepress.com/article/hooks-overview/

    If you need more info, can you provide a link to your site? Thanks!

    #332693
    Tom
    Lead Developer
    Lead Developer

    Or you could filter the logo HTML (because filters are awesome):

    add_filter( 'generate_logo_output','tu_no_logo_link', 10, 2 );
    function tu_no_logo_link( $output, $logo ) {
    	printf( 
    		'<div class="site-logo">
    			<img class="header-image" src="%2$s" alt="%1$s" title="%1$s" />
    		</div>',
    		esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
    		esc_url( apply_filters( 'generate_logo', $logo ) )
    	);
    }
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.