Skip to content

Instantly share code, notes, and snippets.

View alexwoollam's full-sized avatar
:octocat:

Alexander King Woollam alexwoollam

:octocat:
View GitHub Profile
@alexwoollam
alexwoollam / function.php
Last active March 10, 2022 00:29 — forked from mattclements/function.php
Wordpress Disable Comments (add to function.php)
<?php
/**
* Disables comments, Add below 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' ) ) {