【发布时间】:2015-03-03 17:49:31
【问题描述】:
我想从我的 childscheme 中编辑 wordpress 主题二十五中的默认颜色方案。我知道如何在functions.php中添加这样的新colorsheme:
add_filter('twentyfifteen_color_schemes', 'my_custom_color_schemes');
function my_custom_color_schemes( $schemes ) {
$schemes['pinkscheme'] = array(
'label' => __( 'Pinkscheme', 'twentyfifteen' ),
'colors' => array(
'#f1f1f1',
'#C32148',
'#ffffff',
'#333333',
'#333333',
'#f7f7f7',
),
);
return $schemes;
}
但是如何更改默认方案?如果我这样做:
add_filter('twentyfifteen_color_schemes', 'my_custom_color_schemes');
function my_custom_color_schemes( $schemes ) {
$schemes['default'] = array(
'label' => __( 'Default', 'twentyfifteen' ),
'colors' => array(
'#f1f1f1',
'#C32148',
'#ffffff',
'#333333',
'#333333',
'#f7f7f7',
),
);
return $schemes;
}
我想我会得到一个错误,因为我试图声明一个函数两次?或者可能不给出错误但在加载父函数时改回来?
【问题讨论】:
标签: php wordpress color-scheme