Skip to content

Instantly share code, notes, and snippets.

View kuznacic's full-sized avatar

Eric Kuznacic kuznacic

View GitHub Profile
@kuznacic
kuznacic / wp-colors.php
Created September 23, 2021 19:34
WordPress Block Editor Color Palette
add_action( 'after_setup_theme', function() {
add_theme_support( 'editor-color-palette', array(
array(
'name' => __( 'one' ),
'slug' => 'one',
'color' => '#000000',
),
array(
'name' => __( 'two' ),
'slug' => 'two',
@kuznacic
kuznacic / disable-comments.php
Last active February 21, 2021 16:54 — forked from mattclements/function.php
Wordpress Disable Comments (add to function.php)
<?php
// Add to existing function.php file
// Disables support for comments and trackbacks in post types
function ewk_disable_comments_post_types_support() {
$post_types = get_post_types();
foreach ($post_types as $post_type) {
if(post_type_supports($post_type, 'comments')) {