• I would like to replace default WordPress color palette, displayed below Astra theme palette, but I failed even though I used this code simple code, which looks to be fine:

    function my_theme_add_new_features() {
        // The new colors we are going to add
        $newColorPalette = [
            [
                'name' => esc_attr__('Magenta', 'default'),
                'slug' => 'magenta',
                'color' => '#ff00ff',
            ],
            [
                'name' => esc_attr__('Cyan', 'default'),
                'slug' => 'cyan',
                'color' => '#00ffff',
            ],
        ];
        // Apply the color palette containing the original colors and 2 new colors:
        add_theme_support( 'editor-color-palette', $newColorPalette);
    }
    add_action( 'after_setup_theme', 'my_theme_add_new_features', 30 );

    I am attaching a picture of which palette I mean. The first palette from Astra is fine, I would like to change the colors of the second palette, as the default WordPress palette.

    Thank you for your help!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Cannot replace default color palette’ is closed to new replies.