Using SVG Files in WordPress

When using responsive themes in WordPress I highly recommend getting away from using bit-mapped image files. In order to make your logo look really sharp in any viewport save it as an SVG file. Before you can upload your file though you will need to open your functions.php file and add the following code which tells WordPress to recognize the SVG file format.

//Make SVG files approved. 

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

Submit a Comment

Your email address will not be published. Required fields are marked *