Title: Child Theme &#8211; Colors
Last modified: May 19, 2017

---

# Child Theme – Colors

 *  Resolved [b…b](https://wordpress.org/support/users/bb-4/)
 * (@bb-4)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/child-theme-colors/)
 * I am working on a new website using Vega (great theme).
 * I have created a child theme and am looking for help with the colors.
 * Below is a screenshot comparing two code snippets for vega-child theme functions.
   php.
 * [https://www.currentinspiration.com/temp/Vega-child_functionsBluevsfunctions.JPG](https://www.currentinspiration.com/temp/Vega-child_functionsBluevsfunctions.JPG)
 * The code on the left forces a blue color no matter what color is chosen in the
   customizer. The code on the right allows the color choice from the customizer
   to work correctly.
 * Can you help me understand why?
 * Also, is it possible to reference my own /vega-child/color-schemes from functions.
   php?
    -  This topic was modified 8 years, 12 months ago by [b...b](https://wordpress.org/support/users/bb-4/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Theme Author [lyrathemes](https://wordpress.org/support/users/lyrathemes/)
 * (@lyrathemes)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/child-theme-colors/#post-9153960)
 * The vega_get_option function in your child theme should be:
 *     ```
       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;
       }
       ```
   
 *  Thread Starter [b…b](https://wordpress.org/support/users/bb-4/)
 * (@bb-4)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/child-theme-colors/#post-9157339)
 * Does not answer my question.
 * Why does code on the left side use the blue color scheme?
 * [https://www.currentinspiration.com/temp/Vega-child_functionsBluevsfunctions.JPG](https://www.currentinspiration.com/temp/Vega-child_functionsBluevsfunctions.JPG)
 *  Theme Author [lyrathemes](https://wordpress.org/support/users/lyrathemes/)
 * (@lyrathemes)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/child-theme-colors/#post-9157653)
 * The code on the left uses the parent theme option if it has been set. So if you
   saved the options once with the parent theme and then set up the child theme,
   the parent theme options will remain in effect.
 *  Thread Starter [b…b](https://wordpress.org/support/users/bb-4/)
 * (@bb-4)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/child-theme-colors/#post-9157982)
 * Thanks.
 * Can I use a child theme: vega-child/color-schemes/somefile.css ?
 *  Theme Author [lyrathemes](https://wordpress.org/support/users/lyrathemes/)
 * (@lyrathemes)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/child-theme-colors/#post-9168967)
 * You sure can, just be sure to enqueue it properly in the child theme functions.
   php file.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Child Theme – Colors’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/vega/3.0.0/screenshot.jpg)
 * Vega
 * [Support Threads](https://wordpress.org/support/theme/vega/)
 * [Active Topics](https://wordpress.org/support/theme/vega/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/vega/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/vega/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [lyrathemes](https://wordpress.org/support/users/lyrathemes/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/child-theme-colors/#post-9168967)
 * Status: resolved