themes - How to add more default colors?

I just reinstalled my website with the same theme and now the other default colors are gone. Only black is left.Is there

I just reinstalled my website with the same theme and now the other default colors are gone. Only black is left.

Is there a way to add more default colors?

I just reinstalled my website with the same theme and now the other default colors are gone. Only black is left.

Is there a way to add more default colors?

Share Improve this question asked May 28, 2020 at 6:23 OokerOoker 3324 silver badges23 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

You should be able to add more colors using the add_theme_support function as per the docs here

add_theme_support( 'editor-color-palette', array(
    array(
        'name' => __( 'strong magenta', 'themeLangDomain' ),
        'slug' => 'strong-magenta',
        'color' => '#a156b4',
    ),
    array(
        'name' => __( 'light grayish magenta', 'themeLangDomain' ),
        'slug' => 'light-grayish-magenta',
        'color' => '#d0a5db',
    ),
    array(
        'name' => __( 'very light gray', 'themeLangDomain' ),
         'slug' => 'very-light-gray',
        'color' => '#eee',
    ),
    array(
        'name' => __( 'very dark gray', 'themeLangDomain' ),
        'slug' => 'very-dark-gray',
        'color' => '#444',
    ),
) );

I hope it helps!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742389451a4434720.html

相关推荐

  • themes - How to add more default colors?

    I just reinstalled my website with the same theme and now the other default colors are gone. Only black is left.Is there

    2天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信