Allow SVG to WordPress Media

in default svg media files are not allowed to upload svg media uploader. So we have to add additional function to our theme functions.svg based on vector graphics media. its not some kind of JPEG JPG  format file.

below code help to allow svg filet to the site. in theme folder open the functions.php on your editor and point the cursor to end of the line and add

function cc_mime_types($mimes) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'cc_mime_types');

this function allows to do upload svg as we want. without any uploading error.

by kushan


avatar
  Subscribe  
Notify of