Inside the style.css file, add the following code:<\/li>\n<\/ol>\n\n\/* Theme Name: My Child Theme Template: parent-theme-directory-name-here *\/ \n@import url('..\/parent-theme-directory-name-here\/style.css');\n<\/pre>\nReplace parent-theme-directory-name-here with the name of the parent theme directory, then save the file and upload the my-child-theme directory to the wp-content\/themes\/ directory of your WordPress installation.<\/p>\n
<\/span>Step 2: Modify the Functions.php File<\/span><\/h3>\nYou need to modify your website’s theme’s functions.php file to allow SVG images to be uploaded. Here’s how:<\/p>\n
\n- Login to your WordPress dashboard and click on the Appearance menu, then the Editor submenu.<\/li>\n
- Select your child theme from the dropdown menu and click on the functions.php file located on the right-hand side of the editor screen.<\/li>\n
- Backup the original functions.php file, then add the following code to the file:<\/li>\n<\/ol>\n
\n\/* Allow SVG *\/ \nadd_filter('upload_mimes', 'my_custom_mimes'); \nfunction my_custom_mimes($mimes = array()) { \n $mimes['svg'] = 'image\/svg+xml'; \n return $mimes; \n}\n<\/pre>\nThis code adds the SVG image mime type to the list of allowed file types in WordPress.<\/p>\n
<\/span>Step 3: Upload SVG Image<\/span><\/h3>\nNow that you’ve modified the functions.php file, uploading SVG images to WordPress is easy!<\/p>\n
\n- Login to your WordPress dashboard and click on the Media menu, then the Add New submenu.<\/li>\n
- Click on the Select Files button and browse to the location of the SVG file on your computer.<\/li>\n
- Click on the Upload button to upload the SVG image to WordPress.<\/li>\n
- Once the SVG image is uploaded, click on the Edit button to view the image details.<\/li>\n
- Copy the URL of the SVG image.<\/li>\n<\/ol>\n
<\/span>Step 4: Insert SVG Image into Your Website<\/span><\/h3>\nIt’s time to showcase your SVG image on your website! Follow these steps:<\/p>\n
\n- Open the post or page where you want to add the SVG image.<\/li>\n
- Click on the Add Media button and select the Insert from URL tab.<\/li>\n
- Paste the URL of the SVG image in the text field.<\/li>\n
- Click on the Insert into post button to add the SVG image to your website.<\/li>\n<\/ol>\n
<\/span>Conclusion<\/span><\/h2>\nVoila! You can now easily upload and use SVG images on your WordPress website without a plugin. Remember to create a child theme before modifying the functions.php file to avoid losing any changes in future updates.<\/p>\n","protected":false},"excerpt":{"rendered":"
Unlocking the World of Vector Graphics: Uploading SVG Image in WordPress without a Plugin Have you ever wondered how to use high-quality vector images on…<\/p>\n","protected":false},"author":1,"featured_media":7209,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3287],"tags":[],"jetpack_featured_media_url":"https:\/\/mauricemuteti.info\/wp-content\/uploads\/2023\/03\/WORDPRESS-ULTIMATE-GUIDE-How-To-step-by-step-Tutorial.png","_links":{"self":[{"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/posts\/9698"}],"collection":[{"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/comments?post=9698"}],"version-history":[{"count":0,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/posts\/9698\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/media\/7209"}],"wp:attachment":[{"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/media?parent=9698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/categories?post=9698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/tags?post=9698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}