SVG Inline Code
-
After discovering that SVG’s are inserted as src attribute in an <img>, I looked into how I could get it inline and found that editing the includes/front.php and changing one line will do the trick – then you can style how you will with CSS and colours / SVG elements can be targeted for interaction.
The line 492 is the one to edit:
<img src="%s" class="%s" aria-hidden="true" alt="%s"%s%s%s/>',
Changed to:
file_get_contents(esc_url( wp_get_attachment_url( $meta['icon'] ) )),
Will output the raw SVG from the media library.
Can I suggest the devs add this as Setting option, along with optional units for the measurements? Not all of us use ’em’s!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘SVG Inline Code’ is closed to new replies.