Archived topic
Remove link from mobile header
5 replies · Started by Lucas on March 6, 2019
Hi there,
So this worked pretty well on Desktop: https://docs.generatepress.com/article/generate_logo_output/
But I have mobile header activated. How can I remove the link from there too? Because on mobile the link persists.
Hi there,
Try this:
add_filter( 'generate_mobile_header_logo_output', function() {
if ( ! function_exists( 'generate_menu_plus_get_defaults' ) ) {
return $output;
}
$settings = wp_parse_args(
get_option( 'generate_menu_plus_settings', array() ),
generate_menu_plus_get_defaults()
);
return sprintf(
'<div class="site-logo mobile-header-logo">
<img src="%1$s" alt="%2$s" />
</div>',
esc_url( apply_filters( 'generate_mobile_header_logo', $settings['mobile_header_logo'] ) ),
esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) )
);
} );
Let me know :)
Hi there, thanks for the reply, but that didn't work either.
My menu lost the image: http://prntscr.com/mubj6a
Sorry about that, just made an adjustment: https://generatepress.com/forums/topic/remove-link-from-mobile-header/#post-830802
Perfect, thanks.
You're welcome :)