Site logo

Archived topic

Los elementos de imagen no tienen width y height explícitos

8 replies · Started by Jose Enrique on June 10, 2021

Viewing posts 1–9 of 9

Hi all,

I am receiving the error "Los elementos de imagen no tienen width y height explícitos" from the pagespeed insights regarding the Logo object:

"img alt="Ahuyentar o Eliminar" src="https://ahuyentar.org/wp-content/uploads/2021/02/cropped-Ahuye-1.png""

I have applied the codes mentioned in the forum:

add_filter( 'generate_logo_output','tu_logo_atts', 10, 2 );
function tu_logo_atts( $output, $logo ) {
printf(
'

',
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_logo', $logo ) )
);
}

and the corresponding one for the desktop

Could you please help?

Thanks and regards,

Hi there,

those codes shouldn't be required now. Can you share a link to the site so i can see whats going on.

Hi Jose,

Assuming it's just the logo you're trying to address, I believe the "Image elements do not have explicit width and height" flag on the site's logo has already been addressed on GP and GP Premium's latest update.

All you have to do is to reupload the logo and re-assign it on Appearance > customize > Site Identity so the theme generates the image height and width attribute for it.

But plugins can interfere with this, especially the image optimization ones.

I've checked your site and it seems to be having issues with one because all the img src paths have been changed to base64 images and it's breaking the image displayed on your site. Here's what i see on my end - https://share.getcloudapp.com/X6uAdX8A

As you can see, no image is displaying. And if we check the page source as shown here - https://share.getcloudapp.com/jkuPD8vr - the image is missing.

Hi all,

I have disabled the img pluggings and reupload the logo.

could you please check?

Thanks and regards,

Do you still have the PHP snippet for generate_logo_output filter added? Can you make sure it's inactive or removed?

I have disable almost all the plugings (img,cache etc...)

And reupload the logo again

Now the problem only has been detected in the movile not in the desktop

Hi there,

there are 2 logo settings in the site setup.

1. Customizer > Site Identity - this logo is currently being requested over HTTP - So Chrome won't display it as the site is HTTPS.

2. Customizer > Layout > Header --> Mobile Header Logo - the logo here is 404ing ( does not exist ).

To fix - remove both of the logos from those two places. And delete the files from the Media Library.
Change the filenames of the original logo files and reupload to WordPress - then re-add the two logos in the Customizer.

This archived topic is closed to new replies.