Home › Forums › ACF PRO › Image minimum width/height and SVGs › Reply To: Image minimum width/height and SVGs
If anyone is still having a problems with this, one thing I noticed that was caused an issue with uploading SVGs is the lack of a proper <xml>
tag at the start of every SVG file. So now I make sure to add a <?xml version="1.0" encoding="utf-8"?>
to the start of every SVG file.
Also, I make sure to have height
, width
and viewBox
declarations in the opening <svg>
tag as well. So something like <svg xmlns="http://www.w3.org/2000/svg" width="100" height="200" viewBox="0 0 100 200" xml:space="preserve" y="0" x="0" version="1.1">
.
Since I started doing that, I haven’t had any problems with uploading SVGs.
TIP: I’d also recommend to install an awesome little plugin called Safe SVG, which adds secure SVG upload capability to WP, and as a bonus helps display SVGs properly in the Media library. Otherwise your Media Library will be filled with a bunch of generic WP placeholders, instead of actual SVG image thumbnails.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.