SVG images in buttons

It seems with the very last update, SVG images are being reduced to 1px.

I think there needs to be a min-width option in the setting pane now.

Hi Nathan,

I have tried to reproduce this issue on my test site, but I couldn’t. I have used a SVG with 100px X 100px and I see the exact output with same dimension.

Could you please provide us with an example page URL along with some screenshots on how to reproduce this issue, so that we can investigate it further.

Thanks!


Hi there,

Please change the width and height value of the image. Currently, both values are set to 1 so the image is very small that is is barely visible. Try setting the values to at least 30.

Hope this helps.

Those values are not editable. I had no problems with the size before the last update. Everything worked perfectly fine. Something somewhere has been changed in the coding.

Hi Nathan,

Was that issue happen after the update? Is that svg dimension works on the previous version?

Because I have tested your very svg file on my end and it works just fine (WP 5.0.1 / PRO 2.4.1).



Please clear all your caching features (plugin, server-side, CDN, and browser’s cache) after updating so that the code from the latest release is always in use. This will help you to avoid any potential errors.

Also, please do a testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

Let us know how it goes!

I’ve mentioned twice that this is with the latest update. There is no plugin conflict, and I cleared all caches.

I simply went in to edit the page, the SVG was displaying properly. I needed to edit the URL src, as soon as I clicked the button to edit it, the SVG size changed to 1px immediately. I tested on another page with an SVG in the button, and it did the same thing.

Hi Nathan,

I did the same from your video on my installation and it works okay, the dimension are perfectly fine. And the theme has no feature that retrieves image sizes, it’s all provided by Wordpress and only display what’s supplied to it from Media Library. And it shouldn’t be affected by update since there is no code that directly process images.

But what I’m guessing is that Wordpress fail to read SVG file hence, returning an invalid data. Have your host allowed SVG before then blocked it recently? Or have you add some code or plugin that allows SVG to Media Library but now are inactive? Or have you updated your Wordpress core? SVG isn’t allowed by default in Wordpress for security reason.

Thanks!

No, SVG is working fine throughout the rest of the website. I even used some SVG in the inline navigation, just added these. Works fine as well.

Hey Nathan,

I’m sorry but like my colleagues, I also could not replicate the issue you’re having. This might have to do with specific SVG. Would you mind providing a link to the SVG you used so we cold test.

If it’ll work for us and not on your end, there could be something in your WordPress setup that is causing the issue.

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.