Support » Theme: Twenty Nineteen » Override Color Palette in Child Theme

  • Resolved earthbranding

    (@earthbranding)


    Hello,

    I have set up a child theme and I am trying to override the default color palette defined in /twentynineteen/functions.php but for some reasons the code in /twentynineteen-child/functions.php doesn’t override the parent theme function.

    I don’t want to hack the core as then I have to keep editing the parent theme functions.php every time I update the theme.

    This is the code I am using:

    add_action( ‘after_setup_theme’, ‘twentynineteen_child_setup’ );

    function twentynineteen_child_setup() {

    // Editor color palette.
    add_theme_support(
    ‘editor-color-palette’,
    array(
    array(
    ‘name’ => esc_html__( ‘My Red’, ‘twentynineteen’ ),
    ‘slug’ => ‘my-red’,
    ‘color’ => ‘#8D0F03’
    ),
    array(
    ‘name’ => esc_html__( ‘My Green’, ‘twentynineteen’ ),
    ‘slug’ => ‘my-green’,
    ‘color’ => ‘#3B6C73’
    )
    )
    );
    }

    Can anyone help?

    Also, when customising the theme in [Appearance -> Customize -> Colors] it doesn’t allow to enter an Hex value for the colour, you have to use the drag tool which is very limiting.

    It would be great to have at least three level of colour choice.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Override Color Palette in Child Theme’ is closed to new replies.