Archived topic
How to add a site logo in SVG
2 replies · Started by Peter Islin Nielsen on August 20, 2015
Hi! Love working with this theme... But, is there a way to upload a site logo in SVG format? WordPress doesn't allow SVG files to be uploaded in the media library by default, so can it be done without coding the logo URL directly in my header.php file.
Thanks in advance :-)
This is a wordpress core issue, as far as I know.
You could add the SVG-Mimetype to the functions.php of your theme:
add_filter( 'upload_mimes', 'generate_svg' );
function generate_svg( $svg_mime ) {
$svg_mime['svg'] = 'image/svg+xml';
return $svg_mime;
}
https://css-tricks.com/snippets/wordpress/allow-svg-through-wordpress-media-uploader/
or use a plugin i.e:
https://wordpress.org/plugins/svg-support/
Thanks, I'll try that. And yes, the SVG upload restrictions has nothing to do with GeneratePress – it's due to some security measures in WordPress.
