Php 具有Redux框架的动态样式表

Php 具有Redux框架的动态样式表,php,html,css,wordpress,redux-framework,Php,Html,Css,Wordpress,Redux Framework,我遇到了一个通过redux使样式表动态化的问题。在我的config.php中,我编写了以下代码 array( 'id' => 'scheme', 'type' => 'select', 'title' => __('Theme Stylesheet', 'redux-framework-demo'), 'subtitle' => __('Select a predefined color scheme. T

我遇到了一个通过redux使样式表动态化的问题。在我的config.php中,我编写了以下代码

array(
    'id'        => 'scheme',
    'type'      => 'select',
    'title'     => __('Theme Stylesheet', 'redux-framework-demo'),
    'subtitle'  => __('Select a predefined color scheme. They`re located in `/css/color-schemes/` theme folder', 'redux-framework-demo'),
    'options'   => array('orange.css' => 'orange.css', 'red.css' => 'red.css', 'blue.css' => 'blue.css'),
    'default'   => 'orange.css',
),
我试图通过在functions.php上编写下面的代码将样式表排队

if(!isset($redux_demo['scheme'])) {
    wp_enqueue_style( 'pm-color-scheme', get_stylesheet_directory_uri() . '/css/color-schemes/orange.css' );
}
else {
    wp_enqueue_style( 'pm-color-scheme', get_stylesheet_directory_uri() . '/css/color-schemes/'.$redux_demo['scheme'] );
}
但是当我像这样从主题选项中选择blue.css时

我每次都会得到默认值orange.css,就像这样


我现在能做什么?

$redux\u演示在运行redux配置之前不会工作。确保先运行它。

是否将该排队样式添加到操作中?例如:add_action('wp_enqueue_scripts'、'my_scripts');是的,我使用过下面的代码(!function_exists('delicious_enqueue_scripts')){add_action('wp_enqueue_scripts','delicious_enqueue_scripts');function delicious_enqueue_scripts(){if(!isset($redux_demo['scheme')){wp_enqueue_样式('pm color scheme',get_样式表_目录_uri()./css/color schemes/orange.css');}其他{wp_enqueue_style('pm color schemes',get_stylesheet_directory_uri()。/css/color schemes/'.$redux_demo['scheme']);}}