Theme Twenty Fifteen: Customize Color Scheme Customizer

It seems that you are modifying directly the twentyfifteen_get_color_schemes() function on parent theme or redeclaring it on your child theme. You should avoid both cases.

In the original code from twenty fifteen can see this:

apply_filters( 'twentyfifteen_color_schemes', array(.....) );

That means that you can create a filter to add extra color schemes in this way:

add_filter('twentyfifteen_color_schemes', 'my_custom_color_schemes');
function my_custom_color_schemes( $schemes ) {
    $schemes['maroon'] = array(
        'label'  => __( 'Maroon', 'twentyfifteen' ),
        'colors' => array(
            '#f1f1f1',
            '#C32148',
            '#ffffff',
            '#333333',
            '#333333',
            '#f7f7f7',
        ),
    );
    return $schemes;
}

Add this code in the functions.php file of your child theme or in a plugin file.

Leave a Comment