Archived topic
Have header image there but not linking to homagepage
2 replies · Started by oboyhehehe on June 12, 2017
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 :)
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!
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 ) )
);
}