Site logo

Archived topic

problem with svg logo since php8

13 replies · Started by Jens on October 24, 2022

Viewing posts 1–14 of 14

Hi Support-Team,
i switched a website with php 7.4 and svg-logo zu php 8/8.1. after that there are problems with width and height of the svg-logo.
error-message: undefinded array key width/height in header.php line 137+138

when i change the logo to a png, i have no problems.

can you reproduce that?

regards, Jens

Hi there,

do you have a custom header.php on your site ?

Hi David,
no custom header.php

Oh, sorry, it was too short.
it refers to generatepress/inc/structure/header.php

Well silly me - having a brain fog day today - please excuse me :)

So the SVG you have uploaded, if you view that in the Media Library - does it display any Width and Height attributes ?

No, there are no width and height. Is there something missing in the svg-file?

Can i see the site with that logo ?

the warning is in .inside-header

thanks for the link, but i think its all ok with the site, only the php-warning crashes the layout.
when i deactivate php-errors with ini_set('display_errors','off'); in wp-config.php its all fine. and i dont need the php snippet.

Just to note - that snippet will replace the missing width and height attributes in the img HTML. So it not only would fix that error, but it would make sure the Image has correct size attributes, without those you may get some CLS or resizing issues.

good to know, thanks a lot.

You're welcome :)

This archived topic is closed to new replies.