Skip to content

Instantly share code, notes, and snippets.

@dividezigns
Last active April 5, 2022 13:32
Show Gist options
  • Save dividezigns/31b2e3cdb4b298ac3652372c8d874097 to your computer and use it in GitHub Desktop.
Save dividezigns/31b2e3cdb4b298ac3652372c8d874097 to your computer and use it in GitHub Desktop.
This code will enable SVG upload in WordPress. Place this code in your functions.php file in the child theme directory.
<?php
function cc_mime_types($mimes) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'cc_mime_types');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment