Site logo

Archived topic

Custom Colour Palette Options Not Displaying On Page

3 replies · Started by Kim on April 23, 2021

Viewing posts 1–4 of 4

Hi guys,

After following Tom's advice on this post I added some custom colours to our site's palette:
https://generatepress.com/forums/topic/customizing-generateblocks-color-palette/#post-1200829

Unfortunately the colours do not come into effect on the front end at the moment. I can see the element gains the class 'has-color-green' etc. but no styling is associated to it.

Here's the code I added to my functions.php file:

function mytheme_setup_theme_supported_features() {
add_theme_support( 'editor-color-palette', array(
array(
'name' => __( 'GRG Dark Green', 'themeLangDomain' ),
'slug' => 'grg-dark-green',
'color' => '#094B3B',
),
array(
'name' => __( 'GRG Green', 'themeLangDomain' ),
'slug' => 'grg-green',
'color' => '#2D9F73',
),
array(
'name' => __( 'GRG Navy', 'themeLangDomain' ),
'slug' => 'grg-navy',
'color' => '#212531',
),
array(
'name' => __( 'GRG Cornforth', 'themeLangDomain' ),
'slug' => 'grg-cornforth',
'color' => '#e1ddd4',
),
array(
'name' => __( 'GRG Mint', 'themeLangDomain' ),
'slug' => 'grg-mint',
'color' => '#C4D0CA',
),
) );
}

add_action( 'after_setup_theme', 'mytheme_setup_theme_supported_features' );

Many thanks for your help!

Thanks David!

You're welcome

This archived topic is closed to new replies.