How to Upload SVG files in Wordpress (Without any Plugin) | Add Vector Images to WordPress
Vložit
- čas přidán 21. 06. 2021
- This video will show you how to upload SVG files in WordPress. Here, I will cover two methods to enable the support of SVG image files in WordPress.
One is by adding a Plugin and the other method is by adding a PHP code in the theme editor.
#SVG stands for Scalable Vector Graphics which is an Extensible Markup Language-based vector image format for two-dimensional graphics. SVG images and their behaviours are defined in XML text files.
#Wordpress doesn't support the upload of SVG files as it may create security risks but you can bypass this by following this video.
✅ Download the PHP code: key2blogging.com/enable-svg-s...
✅ Code snippet Plugin: wordpress.org/plugins/code-sn...
If you have any doubt ask me in the comment section and Subscribe to my channel for more upcoming videos like this.
Related Videos:
✅ How to upload webp images in WordPress (with or without Plugin): • How to Upload WebP ima...
✅ Add Author box in GeneratePress (without Plugin): • How to Add Author Box ...
✅ Twitter: / key2blogging
✅ Telegram: t.me/techyleaf
✅ Quora: www.quora.com/profile/Abhishe...
✅ Pinterest: / abhishekpadhi666
Gear I Use -
Mic: amzn.to/3tOnN7Q
Wireless mouse: amzn.to/3uP9DVB
Keyboard: amzn.to/3fk0MVc
Find more videos at #key2blogging
#wordpressguide #wordpresstuitorials #imageoptimization
Very informative. Thank you and stay safe! Martin
The coding is working perfectly fine. 👍👍
using the plugin not solved my problem, but using this method solved my problem. thanks bro
Thank you for sharing. The code works like a charm.
You're welcome!
Thank you so much. It work perfectly
Welcome 🙂
Thank you , can you tell me whwer I shall found SVG development focus file ?
Thankyou it worked correctly with code ..
You're welcome!
thanks, just addding the plugin is enough to upload svg
Yes
07.2022... it works. Awesome, thx man
thank you brother
J'ai copié collé manuellement le code dans le fichier function.php directement depuis le FTP et ça fonctionne :) merci !
You are welcome..
Hey! thanks for this video. Please clarify how to show this svg file on a particular page or category?
Just use the media library and choose the svg image as you select other image files like jpg, png
ok, thanks@@Key2Blogging
Hi...have a couple of questions...In your example you use an undraw svg....undraw has an extensive library of files and I was thinking of using them in hero images etc...would you use a compressed .jpg file or the svg? Second question..would you use an svg for your logo or compressed .png file?
Svg is always a better option as it provides better quality and less size
@@Key2Blogging thank you so much for a quick reply....what about the security side of things...is there a plugin to protect us from crap in svg files? What am I looking for if I open up the svg files in illustrator...hope you don't mind the questions....love your videos!
No problem, you can ask all of your doubts.
Only use svg images from reputed sites like undraw, storyset, freepik etc.
But, there is some security risk in svg as they are written in html. So, downloading from untrusted sites may create problem.
@@Key2Blogging In the code for the functions.php file you have a specific function for .thumbnail images...but what about when using for background images 1920 x 1080....Featured images 1200 x 900...900 x 1200....have you functions for those types ....?
After a svg graphics was added to a page, is it possible to make it into a button? I.e. react to mouse click?
Yes, you can use the svg icon inside a button also.
Thanks for the video. What are the benefits of the code over the plugin?
Thanks for your response
Those who don't want to add a additional plugins and use one code manager plugin for multiple function in wordpress
Perhaps not related to the video but any idea on how to connect my current go daddy site to my home page? It seems to be redirected to a blog page instead of redirecting to my landing page
Any help is appreciated@@Key2Blogging
thank you
Thanks
I have a problem. I added the logo to the site svg file, but then the colors in the logo are not on there place or position, it looks like it is moving up , please do you have any idea why this happen
It may happen due to existing CSS code written for svg files. Why not you use a Png format for logo.
Thanks. What are the cons of using a plugin for this? It seems easier but at the same time using the code feels like you're "in control" more, so which is best?
You can use any method you Like. It's just personal preference. Most people don't like to add plugin for simple task like this.
@@Key2Blogging Okay, Thank you!
Have you any advice about compressing svg files?
Yes, you can compress svg also.
@@Key2Blogging sorry....I was asking how you go about compressing svg files?
Search "compress svg online" and you will see alot of sites to compress this format.
works fine with the latest WP. Copy the code into your child-theme function.php
Yes, you can use it in child theme also..
HI, is the code secure?
Yes, it is secure and enable svg Upload but always use svg files from trusted source only.
Because svg files may infected as it is an HTML based file.
But there is no issue with this function file and it is using most of the svg plugin.
sir mere usme ye cide work ni kr raha h
kya karu sir ab mai
Then Use a plugin like WP SVG Images by shortpixel
I've tried everything and nothing I do works
Did you try using a Plugin Like svg support
Bhai Mera svg support nhi kar rha aur nahh me kisi ko bhej pa rha pls help me do u have insta ??
thank you