/** * Updates the color pickers using javascript each time the user changes the theme color scheme. */ function _cp_enqueue_customizer_color_previewer() { global $cp_options; $suffix_js = cp_get_enqueue_suffix(); wp_enqueue_script('cp_themecustomizer', get_template_directory_uri() . "/includes/js/theme-customizer{$suffix_js}.js", array('customize-controls'), CP_VERSION, true); $params = array('color_scheme' => $cp_options->stylesheet, 'colors' => cp_get_customizer_color_defaults('all')); wp_localize_script('cp_themecustomizer', 'customizer_params', $params); }
function cp_style_changer() { global $cp_options; $suffix_css = cp_get_enqueue_suffix(); if (!wp_style_is('app-form-progress') && current_theme_supports('app-form-progress')) { // enqueue the form progress before the main stylesheet to be able to override it _appthemes_enqueue_form_progress_styles(); } $main_css = get_stylesheet_uri(); if (!is_child_theme()) { $main_css = str_replace('.css', "{$suffix_css}.css", $main_css); } wp_enqueue_style('at-main', $main_css, false); // turn off stylesheets if customers want to use child themes if (!$cp_options->disable_stylesheet) { $child_theme = $cp_options->stylesheet ? $cp_options->stylesheet : 'aqua.css'; $stylesheet = '/styles/' . $child_theme; $from_child_theme = is_child_theme() && file_exists(get_stylesheet_directory() . $stylesheet); $stylesheet = !$from_child_theme ? str_replace('.css', "{$suffix_css}.css", $stylesheet) : $stylesheet; $stylesheet_url = ($from_child_theme ? get_stylesheet_directory_uri() : get_template_directory_uri()) . $stylesheet; wp_enqueue_style('at-color', $stylesheet_url, array('at-main')); } if (file_exists(get_template_directory() . '/styles/custom.css')) { wp_enqueue_style('at-custom', get_template_directory_uri() . '/styles/custom.css', false); } wp_enqueue_style('dashicons'); }