-
AuthorPosts
-
August 23, 2015 at 9:30 am #366711
Hey Guys,
Can add SVG logo on my web. I’m using Integrity main theme, i accomplished that by adding this function to child theme:
function cc_mime_types($mimes) {
$mimes[‘svg’] = ‘image/svg+xml’;
return $mimes;
}
add_filter(‘upload_mimes’, ‘cc_mime_types’);
But my menu disappeared and instead i’m getting assign menu. Can i modify this function or there are other ways of adding svg files.Thank you
August 23, 2015 at 10:02 am #366728Hi There,
Thanks for writing in!
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
August 23, 2015 at 8:37 pm #367033This reply has been marked as private.August 23, 2015 at 11:47 pm #367156This reply has been marked as private.August 24, 2015 at 12:44 am #367195Awesome support guys. That works. Cheers
August 24, 2015 at 12:45 am #367196You are welcome!
Glad that it helped. Feel free to let us know if you face any other issue. We’ll be happy to assist you.
Thanks for using X.
Cheers!
November 2, 2015 at 4:51 pm #649983Hello!
Just following this thread…
I want to use svg file in my logo.
Already added this code to my child theme functions.php
function cc_mime_types($mimes) {
$mimes[‘svg’] = ‘image/svg+xml’;
return $mimes;
}
add_filter(‘upload_mimes’, ‘cc_mime_types’);However, when trying to upload the file, wordpress says that the file it is not allowed due to security reasons…
Can you help?
Thanks!
I am using Icon. My site: http://www.staging4.ideasparatriunfar.com
November 2, 2015 at 9:37 pm #650180Hi @guirot
Thanks for updating. It should work –
function cc_mime_types($mimes) { $mimes['svg'] = 'image/svg+xml'; return $mimes; } add_filter('upload_mimes', 'cc_mime_types');
You can follow this for other solutions – https://css-tricks.com/snippets/wordpress/allow-svg-through-wordpress-media-uploader/
Also this third party plugin might help – https://wordpress.org/plugins/add-full-svg-support/
Hope this helps.
Cheers!
November 3, 2015 at 1:13 am #650365Hello!
I have pasted again and now is working.
However, one more question: I have seen that SVG files are said to be a security hole for the website due to XML. Which are your suggestions? Is it worth to use SVG??
Thanks for your help!
Oliver.
November 3, 2015 at 1:23 am #650378Hi Oliver,
You can some svg sanitizer, please refer to the link below for more information.
https://wordpress.org/support/topic/svg-security
Hope that helps.
November 3, 2015 at 1:58 am #650407OK. Great!
However, let´s see what do you think:
I have added your code, uploaded the svg file as logo, and later removed your code. SVG file still there as a logo, and security risk is gone due that I am not allowing more uploads. (code has been removed).
As soon as the svg logo displays correctly, maybe is better solution for me??
Thanks!
Olive.r
November 3, 2015 at 2:03 am #650411Hi Oliver,
Yes, that should work.
Have a great day!
November 3, 2015 at 2:12 am #650421You too. Thanks!!
Oliver.
November 3, 2015 at 2:15 am #650426You’re welcome! 🙂
-
AuthorPosts