Archived topic
Los elementos de imagen no tienen width y height explícitos
9 replies · Started by jmpefe78gmail-com on March 2, 2021
Hola al analizar con Page Speed me dice que Los elementos de imagen no tienen width y height explícitos
Esto me sucede en el Logo, ¿porqué sucede esto? https://tuwebdecero.com/wp-content/uploads/2021/03/cropped-logo-empresa-tu-web-de-cero.png
Gracias
Hi there,
Any chance you can link us to the site in question?
You can use the private information field.
Let me know :)
Sí, doy acceso.
Hay que meter 2 veces el usuario y contraseña para que permita acceder al administrador
Hi there,
You could give solution a try:
https://generatepress.com/forums/topic/how-to-set-height-and-width-for-the-logo-image/#post-1563234
Adding PHP: https://docs.generatepress.com/article/adding-php/
He copiado el código en el funtions.php pero no desaparece el aviso.
Que tengo que modificar aparte de poner las dimensiones de mi logo?
Hi there,
I've checked your site and it doesn't seem like you've applied the code properly.
Can you tell us how you've added it?
Here's how you add PHP - https://docs.generatepress.com/article/adding-php/
Hola de nuevo, lo eliminé al ver que no funcionaba.
Me puedes poner aquí en código que tengo que pegar por favor?
You can try this snippet.
add_filter( 'generate_logo_attributes', function($array){
$img_attr = array('width' => '200px', 'height' => '200x',);
return array_merge($array, $img_attr);
},15,1);
Gracias. Se arreglo!!! ;)
Nice one. Glad you got it resolved. No problem. :)