Skip to content

Instantly share code, notes, and snippets.

@lyrathemes
Last active November 27, 2022 21:08
Show Gist options
  • Save lyrathemes/7f5c791b7351b7cadd7ab9faaba0b204 to your computer and use it in GitHub Desktop.
Save lyrathemes/7f5c791b7351b7cadd7ab9faaba0b204 to your computer and use it in GitHub Desktop.
<?php
add_action( 'wp_enqueue_scripts', 'kale_child_enqueue_styles' );
function kale_child_enqueue_styles() {
$parent_style = 'kale-style';
$deps = array('bootstrap', 'bootstrap-select', 'fontawesome', 'fontawesome-all', '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;
}
?>
@kylewensman
Copy link

Thank You!!

@Nembangkewal
Copy link

Does this work on kale pro too? I cannot find a kale pro-child-theme-functions anywhere. IF you can, can you please provide it.
Thank you

@lyrathemes
Copy link
Author

Yes, it works on Kale Pro as well

@pikuls
Copy link

pikuls commented Dec 10, 2021

Hi I have try added this code twice on my WP blog its made my site just blank white screen and I couldn't login to my blog unless I disabled the Kale child Theme via cPanel,

@SutatsaJantalert
Copy link

This what I got when I contacted Bluehost. I went to the PRO page but it doesn't tell me how to fix it. Please, see the comment below.

Based on the scan report your server is free from malware. I already found why we can't access the admin dashboard of your wordpress website because of the incompatibility issues of the current Kale-Child-Theme version to your plugins. Regardless if all plugins will be updated and we apply the theme Kale-Child again to your site it won't allow us again to login. So I decided to temporarily disable the theme called Kale-Child and apply the temporary theme Twenty Twenty-Two. You need to contact the vendor or the maker of the theme Kale-Child from this link https://www.lyrathemes.com/
Please do not reactivate the theme Kale-Child or else you won't be able to access the admin dashboard again.

@lyrathemes
Copy link
Author

I'm sorry this is a bit late, but if you run into any further issues with the child theme please feel free to contact our support team, and we'll be more than happy to help out:
https://www.lyrathemes.com/support/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment