-
Maria
-
David
Hi there,
the SVG you’re using has no
width
orheight
attributes in its markup.
Ideally you would want to save an SVG that has those attributes.Otherwise you can use the PHP Snippet provided here to add them in the theme:
Note the line:
<img src="%3$s" width="999" height="999" alt="%4$s" />
You need to set the width and height you require for your image.
-
Maria
Thank you, David.
-
David
You’re welcome
-
Maria
Hi David,
Just wanted to follow up on this. In addition to setting the height and width of the logo, would I also need to add the URL “%3$s” to the image and the alt text “%4$s”?
Secondly, the code you provided is just for SVG logos, right? So, if I have other svg images that aren’t logos can I use this code snippet? In my case, there are 2 other svg images that need to have height and width set. I’m not too concerned with it at this point, I just want to know for my own knowledge.
-
Hi Maria,
would I also need to add the URL “%3$s” to the image and the alt text “%4$s”?
No, you don’t need to, as these info are there by default.
Secondly, the code you provided is just for SVG logos, right?
Usually, image logos have the width and height attribute by default, they don’t require this snippet.
So, if I have other svg images that aren’t logos can I use this code snippet?
No, the snippet is only for logo.
In my case, there are 2 other svg images that need to have height and width set.
Do the 2 other SVG images get the flag? Let me know!
-
Hi Ying,
Yes, I get the error on both the logo and image. Here’s the screenshot: https://www.screencast.com/t/JENyvbVEW4wY
-
Can you share the link to your site where I can see both images?
Let me know 🙂
-
Sorry about that, https://j3painting.com/
-
Hum…I tried uploading your SVG to my site, and the SVG image does have width and height attributes.
How did you upload the SVG?
I also wonder if the cache plugin is doing something to it, can you disable the cache plugin first, then install the Safe SVG plugin and then upload the image again?
Let me know 🙂
-
Maria
I’m not going to worry about it. Thanks for looking into it.
-
No problem 🙂
- You must be logged in to reply to this topic.