Created
February 21, 2017 06:06
-
-
Save lyrathemes/5958dc522dcbe5768bc4a3a0d4a1c8f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_enqueue_scripts', 'vega_child_enqueue_styles' ); | |
function vega_child_enqueue_styles() { | |
$parent_style = 'vega-wp-style'; | |
$deps = array('bootstrap', 'font-awesome', 'bootstrap-social'); | |
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' , $deps); | |
$vega_wp_color_stylesheet = vega_wp_get_option('vega_wp_color_stylesheet'); | |
if($vega_wp_color_stylesheet != 'Custom') | |
wp_enqueue_style('vega-wp-color', get_template_directory_uri() . '/color-schemes/' . strtolower($vega_wp_color_stylesheet) . '.css', array() ); | |
wp_enqueue_style( 'vega-wp-style-child', | |
get_stylesheet_directory_uri() . '/style.css', | |
array( $parent_style, 'vega-wp-color' ), | |
wp_get_theme()->get('Version') | |
); | |
} | |
function vega_wp_get_option($key){ | |
global $vega_wp_defaults; | |
$parent_theme = get_template_directory(); | |
$parent_theme_slug = basename($parent_theme); | |
$parent_theme_mods = get_option( "theme_mods_{$parent_theme_slug}"); | |
$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 (array_key_exists($key, $vega_wp_defaults)) | |
$value = get_theme_mod($key, $vega_wp_defaults[$key]); | |
return $value; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment