Skip to content

emka.web.id

Menu
  • Home
  • Indeks Artikel
  • Tutorial
  • Tentang Kami
Menu

Cara Menambahkan File SVG di File Upload WordPress

Posted on May 05, 2020 by Syauqi Wiryahasana
Untuk urusan upload file, WordPress sudah cukup lengkap. Namun, ada satu hal yang memang tidak didukung oleh WordPress secara native, yaitu kemampuan mengupload file SVG. SVG sendiri adalah file gambar dalam bentuk vektor. Untuk menambahkan file type SVG baru di File Upload WordPress, silakan edit functions.php di theme yang sedang aktif, lalu tambahkan: [sourcecode language="php"] // Enable Wordpress to load SVG function add_file_types_to_uploads($file_types){ $new_filetypes = array(); $new_filetypes['svg'] = 'image/svg+xml'; $file_types = array_merge($file_types, $new_filetypes ); return $file_types; } add_filter('upload_mimes', 'add_file_types_to_uploads'); [/sourcecode]
Seedbacklink

Recent Posts

TENTANG EMKA.WEB>ID

EMKA.WEB.ID adalah blog seputar teknologi informasi, edukasi dan ke-NU-an yang hadir sejak tahun 2011. Kontak: kontak@emka.web.id.

©2024 emka.web.id Proudly powered by wpStatically