Settings for functions.php (Child Theme folder):
Unfortunately, the media library does not support SVG vector files. However, these are important if you want to display graphics sharply on all devices (PNG and GIF files usually reach their limits on mobile devices). SVG support can be activated with the plugin SVG Support or with the following code in the theme’s functions.php file:
function cc_mime_types($mimes) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'cc_mime_types');
Unfortunately, there is NOT YET a preview for SVG files in the media library.
Settings for config.php:
define('ALLOW_UNFILTERED_UPLOADS', true);
Allows uploading other file formats such as .svg for, for example, the logo.
However, for security reasons, this parameter should only be used temporarily.
ATTENTION: New plugin available that makes the above steps NO longer necessary!
Safe SVG
function remove_emoji()
{
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('admin_print_scripts', 'print_emoji_detection_script');
remove_action('admin_print_styles', 'print_emoji_styles');
remove_action('wp_print_styles', 'print_emoji_styles');
remove_filter('the_content_feed', 'wp_staticize_emoji');
remove_filter('comment_text_rss', 'wp_staticize_emoji');
remove_filter('wp_mail', 'wp_staticize_emoji_for_email');
add_filter('tiny_mce_plugins', 'remove_tinymce_emoji');
}
add_action('init', 'remove_emoji');
function remove_tinymce_emoji($plugins)
{
if (!is_array($plugins))
{
return array();
}
return array_diff($plugins, array(
'wpemoji'
));
}