Site logo

Archived topic

How to change navigation logo alt?

7 replies · Started by Giuseppe on June 2, 2019

Viewing posts 1–8 of 8

I would like to know, how to change alt tag of my main navigation(sticky+static) logo.
Thanks

Hi Leo,

I read the documentation you linked to me but I don't understand how to change the ALT of the logo.

I found a old topic where Tom explained this way :

"You can try this filter: generate_logo_title"

add_filter( 'generate_logo_title', 'tu_change_logo_alt' );
function tu_change_logo_alt() {
    return 'Your alt title';
}

This is the topic https://generatepress.com/forums/topic/how-to-change-navigation-logo-alt/

Could you explain me better what I should do to change the ALT tag?

thanks

Hi there,

add that function to your child themes function file or by using the code snippets plugin.
Then edit the return 'Your alt title'; to contain your alt title.

Hi David

then I go in Dashboard/Appearance/Theme Editor and then enter in the file functions.php this code :

add_filter( 'generate_logo_title', 'tu_change_logo_alt' );
function tu_change_logo_alt() {
    return 'Your alt title';
}

putting the name of the alt title in this point :
return 'Your alt title'

It's correct?

Thanks

Yes you can but only on your Child Theme not the parent theme as any changes to this will be lost when the them updates.

More info here on using a Child Theme:

https://docs.generatepress.com/article/using-child-theme/

If you don't have one then install the Code Snippets plugin and add the code there.

Hi David,

I solved with your directions

Thanks

Glad to be of help.

This archived topic is closed to new replies.