function cc_mime_types($mimes) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'cc_mime_types');
add in functions.php in your active theme
define('ALLOW_UNFILTERED_UPLOADS', true);
add in wp-config.php
Related Posts:
- Upload Multiple Files With media_handle_upload
- Issue with wp_get_attachment_image() and SVG file type
- Extract image from content and set it as the featured image
- How to get the image EXIF date/time and use it for the WP post date/time
- delete uploaded file
- Edit the_content function
- How to save Uploaded image in custom option panel?
- Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons
- Max file size not updating
- Remove image from post_content on save_post
- Make WordPress size and name images for Retina.js
- WordPress function/template tag to get first n words of the content
- Pinterest Integration Using functions.php
- Custom image size in Media Dropdown
- Unable to get_the_content(); of a post in WordPress via AJAX
- Images uploaded using media uploader are appearing upside down
- How can I enable uploading excel files?
- Can I hide certain upload folders in media library [duplicate]
- WordPress upload_mimes not working for front-end uploads of 3D files
- Automatically wrap multiple images in div
- How can I add text to all posts/pages/categories/homepage etc
- Display post shortcode content in the sidebar?
- Disable auto-resizing of uploaded images, but only for certain filename
- Add other social networks to TwentyNineteen_SVG_Icons class in child theme?
- When sale price is 0.00 show only regular price
- Can’t generate thumbnail images
- If user is logged-in display/hide something
- Tags break custom Excerpt function
- How to stop media_sideload_image from running when deleting a post?
- Possible to hook into Media Library preview File column and use a custom image?
- Function that prevents users from uploading photos more photos
- the_excerpt function not showing image
- Is it possible to limit number of files a non-admin user can upload via the WordPress media library?
- How to add HTML into error message
- Serving cache from multiple domain names
- restrict uploaded image size and fixed image display size
- What is best practices to move the following code into a function?
- Function image_send_to_editor returns emty title tag
- Zip all (original) images from media gallery
- Regex works in regexr, but not if I filter content [closed]
- Problem in outputting shortcode
- Problem in shortcode outputting content
- Figure inlined width trigger distorted layout
- wp_upload_bits – define (sub)folder / (sub)directory before filename?
- Integrating custom API for post content into Admin interface & Public Website [closed]
- Trying to get this function to show below the content
- Rename file after title , one small problem
- When the WP_EDITOR button is pressed, the user is prompted to select a photo from their device
- How to overwrite image if it already exists – WordPress, Gravity form
- Convert Image to Webp on upload without plugin
- Order posts (across the whole site) by metadata date
- Disable visual editor on one specific page
- How to move wp-content (or uploads) outside of the WordPress directory
- How to display random users with avatars
- Can the wp-plugins (Must Use Plugins) URL be targeted for use in functions.php?
- In a WordPress plugin, how do you output HTML code inside the DOM header? [closed]
- Different ‘WP_CONTENT_URL’ for different subsites in Multisite setup?
- Linking thumbnail to full size image
- Preferred Use of home_url()?
- How to display most viewed post in my sidebar?
- Customizer field value into functions.php variable
- wp_insert_posts keeps adding multiple pages
- Best practice when altering a parent theme function inside a child theme?
- list tags with count in author profile page
- Breadcrumbs – Exclude Child Categories
- Why won’t my scripts load?
- Is it OK to include files using ABSPATH?
- Overwriting Parent Theme’s Image Sizes
- Limit length of first excerpt in the loop
- check if the user is owner of current page
- How to set the default avatar of buddypress avatar [closed]
- Publishing just a Facebook URL without full code snippet
- Filter an WordPress Function in (general-template.php)
- attachment page template? only show attachments for current post?
- Conditional statement not working in function
- Remove the month and year from a WordPress Date?
- How to insert class in each list of categories?
- The correct way to add a JavaScript in the functions.php [closed]
- How to remove some item from WordPress Dashboard for user Author
- How to make a new function that includes a template
- Disabling Author Page only for subscribers
- Showing user profile data on front-end
- How to register a menu based on a ACF condition
- Why is this function crashing my wordpress installation? [closed]
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- How to Override Page Template if URL matches query?
- Woocommerce Display Discount On cart
- how to remove a tag in the_category function
- WordPress undefined function error on using add_action() in functions.php
- How to create admin ajax function for my contact form
- how to display featured image for single post for a specific category
- Database Query not working
- save_post hook – headers already sent?
- How to use WP_rewrite?
- Wp get archive only text not link
- can not call functions in function.php
- Display post_meta-by_key on product catalogue
- What are the parameters are used in add_action and filters?
- Does functions.php apply to every page?
- WordPress Custom wp mail template return full template