Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save macgraphic/fb987bc73e9cd03a113d47ae06d0af22 to your computer and use it in GitHub Desktop.
Save macgraphic/fb987bc73e9cd03a113d47ae06d0af22 to your computer and use it in GitHub Desktop.
// Theme colour palette
function xyz_setup_theme_supported_features() {
add_theme_support( 'editor-color-palette', array(
array(
'name' => __( 'Navy', 'xyz' ),
'slug' => 'navy',
'color' => '#032f3c',
),
array(
'name' => __( 'Orange', 'xyz' ),
'slug' => 'orange',
'color' => '#fd8204',
),
array(
'name' => __( 'Green', 'xyz' ),
'slug' => 'green',
'color' => '#b8bf0d',
),
array(
'name' => __( 'Magenta', 'xyz' ),
'slug' => 'magenta',
'color' => '#e60088',
),
array(
'name' => __( 'Purple', 'xyz' ),
'slug' => 'purple',
'color' => '#87319a',
),
array(
'name' => __( 'Red', 'xyz' ),
'slug' => 'red',
'color' => '#e01f1d',
),
array(
'name' => __( 'Cyan', 'xyz' ),
'slug' => 'cyan',
'color' => '#00aeef',
),
array(
'name' => __( 'Light Green', 'xyz' ),
'slug' => 'light-green',
'color' => '#03783d',
),
array(
'name' => __( 'Blue', 'xyz' ),
'slug' => 'blue',
'color' => '#0032a0',
),
array(
'name' => __( 'White', 'xyz' ),
'slug' => 'white',
'color' => '#fff',
),
) );
}
add_action( 'after_setup_theme', 'xyz_setup_theme_supported_features' );
// Disable custom colours
add_theme_support( 'disable-custom-colors' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment