Add SVG Support Function to Your Wordpress Website | Without Plugin

wp-svg-support


How to add svg support function to my wordpress website?

Wordpress has default function that block svg file upload. You may facing the problem when you try to upload svg animation in your media upload and here is the solution for the problem.

Just follow the step below...

1. You need to place the svg support code to your theme functions.php file.

//SVG Support Function
function add_file_types_to_uploads($file_types){
$new_filetypes = array();
$new_filetypes['svg'] = 'image/svg+xml';
$file_types = array_merge($file_types, $new_filetypes );
return $file_types;
}
add_filter('upload_mimes', 'add_file_types_to_uploads');


You are done.
Now you can upload svg file.

If you need more help then leave a comment.

0 Comments

Contact Us

Leave a message for further information