如何添加更多默认颜色?

时间:2020-05-28 作者:Ooker

我刚刚用相同的主题重新安装了我的网站,现在其他默认颜色都消失了。只剩下黑色。

有没有办法添加更多默认颜色?

1 个回复
最合适的回答,由SO网友:Welcher 整理而成

您应该能够使用add_theme_support 按照文件功能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\',
    ),
) );
我希望这有帮助!