Archived topic
Sticky Logo Attributes
2 replies · Started by Angel on March 22, 2022
Viewing posts 1–3 of 3
Hello,
I am trying to add a data-no-pin="1" attribute to the sticky logo in the navigation bar. I used filters for the mobile and static logos but I cannot find any filter for the sticky nav logo.
Is there a way to add the attribute?
Thanks
Andy
I managed to add the attribute by modifying the code I used for the mobile logo. It uses my mobile logo but it's ok for me.
add_filter( 'generate_sticky_navigation_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="sticky-navigation-logo">
<a href="%1$s" title="%2$s" rel="home">
<img src="%3$s" data-pin-nopin="1" width="222" height="80" alt="%4$s" />
</a>
</div>',
esc_url( apply_filters( 'generate_logo_href' , home_url( '/' ) ) ),
esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
esc_url( apply_filters( 'generate_mobile_header_logo', $settings['mobile_header_logo'] ) ),
esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) )
);
} );
Hi there,
sounds like you found a solution - let us know if thats not the case :)
This archived topic is closed to new replies.