Skip to content

Instantly share code, notes, and snippets.

@andresglx
andresglx / function.php
Created September 30, 2016 12:00 — forked from mattclements/function.php
Wordpress Disable Comments (add to function.php)
<?php
// Add to existing function.php file
// Disable support for comments and trackbacks in post types
function df_disable_comments_post_types_support() {
$post_types = get_post_types();
foreach ($post_types as $post_type) {
if(post_type_supports($post_type, 'comments')) {
remove_post_type_support($post_type, 'comments');
@andresglx
andresglx / gist:16a8d1950e25e21bb46da33f027a7313
Created January 23, 2018 20:36 — forked from nathaningram/gist:035b4c6b25738c9805d14495b80ce907
Adding SVG Format to Allowed WordPress File Types
//Adding SVG Format to Allowed WordPress File Types
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_action('upload_mimes', 'add_file_types_to_uploads');