Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Lili Stoyanova

    (@thefoodkooky)

    Hello, I disabled the Child Theme Configurator and replaced the old child theme’s functions.php code with the new one. Everything works well now. Thank you so much! Should I activate the Child Theme Configurator or leave it disabled? I really appreciate your help!

    Thread Starter Lili Stoyanova

    (@thefoodkooky)

    Sure, here it is

    <?php
    add_action( 'wp_enqueue_scripts', 'kale_child_enqueue_styles' );
    function kale_child_enqueue_styles() {

    $parent_style = 'kale-style';
    $deps = array('bootstrap', 'bootstrap-select', 'font-awesome', 'owl-carousel');
    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' , $deps);

    wp_enqueue_style( 'kale-style-child', get_stylesheet_directory_uri() . '/style.css', array( $parent_style ), wp_get_theme()->get('Version') );
    }

    function kale_get_option($key){
    global $kale_defaults;

    $parent_theme = get_template_directory();
    $parent_theme_slug = basename($parent_theme);
    $parent_theme_mods = get_option( "theme_mods_{$parent_theme_slug}");

    $value = '';
    $child_value = get_theme_mod($key);
    if(!empty($child_value)){
    $value = $child_value;
    }
    else if (!empty($parent_theme_mods) && isset($parent_theme_mods[$key])) {
    $value = $parent_theme_mods[$key];
    } else if (is_array($kale_defaults) && array_key_exists($key, $kale_defaults))
    $value = get_theme_mod($key, $kale_defaults[$key]);
    return $value;
    }

    // BEGIN ENQUEUE PARENT ACTION
    // AUTO GENERATED - Do not modify or remove comment markers above or below:

    if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):
    function chld_thm_cfg_locale_css( $uri ){
    if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )
    $uri = get_template_directory_uri() . '/rtl.css';
    return $uri;
    }
    endif;
    add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );

    if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
    function chld_thm_cfg_parent_css() {
    wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array( 'bootstrap','bootstrap-select','smartmenus-bootstrap','fontawesome','fontawesome-all','owl-carousel' ) );
    }
    endif;
    add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10 );

    if ( !function_exists( 'child_theme_configurator_css' ) ):
    function child_theme_configurator_css() {
    wp_enqueue_style( 'chld_thm_cfg_child', trailingslashit( get_stylesheet_directory_uri() ) . 'style.css', array( 'chld_thm_cfg_parent','kale-style' ) );
    }
    endif;
    add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css', 10 );

    // END ENQUEUE PARENT ACTION
Viewing 2 replies - 1 through 2 (of 2 total)