I have fall a problem to make stylesheet dynamic by redux. In my config.php I have write this code.
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',
),
and I have tried to enqueue stylesheet by writting bellow code on 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'] );
}
But when I select blue.css from theme option like this http://prntscr.com/3s5td0
I get default value that is orange.css everytime like this http://prntscr.com/3s5ucm.
what can I do now?
$redux_demo won’t work until after your Redux Config has been run. Make sure you run it first.