$value) { if( in_array( $key , $key_exceptions ) ) { switch( $key ) { case 'background-color' : $css .= 'background: '.$value.';'; break; case 'background-image' : $css .= $key . ':' . 'url("'.$value.'");'; break; case 'background-size' : $css .= $key . ':' . $value . ' !important;'; } } else { $css .= $key . ':' . $value . ' !important;'; } } $css .= '}'; return $css; } } /* |-------------------------------------------------------------------------- | Create Global Headline Style ( Fallback Function ) |-------------------------------------------------------------------------- */ if ( !function_exists( 'ut_create_global_headline_font_style' ) ) { function ut_create_global_headline_font_style( $object = '', $font_style = '' ) { if( empty($object) ) { return; } $font = NULL; $google_fonts = ut_recognized_google_fonts(); $ut_recognized_font_styles = ut_recognized_font_styles(); $font_styles = array( 'regular' => 'normal', 'normal' => 'normal', 'italic' => 'italic' ); if( !empty( $font_style ) && $font_style != 'global' ) { return $object . '{ font-family: ' . $ut_recognized_font_styles[$font_style] . ', "Helvetica Neue", Helvetica, Arial, sans-serif; }'. "\n"; } else { if( ot_get_option('ut_global_headline_font_type' , 'ut-font') == 'ut-google' ) { $ut_global_google_headline_font_style = ot_get_option('ut_global_google_headline_font_style'); if( !empty($google_fonts[$ut_global_google_headline_font_style['font-id']]['family']) ) { $font .= $object . ' {'; $font .= 'font-family:'.$google_fonts[$ut_global_google_headline_font_style['font-id']]['family'].', "Helvetica Neue", Helvetica, Arial, sans-serif;'; if( !empty($ut_global_google_headline_font_style['font-weight']) ) { $font .= ' font-weight: ' . $ut_global_google_headline_font_style['font-weight'] . ';'; } if( !empty($ut_global_google_headline_font_style['font-size']) ) { $font .= ' font-size: ' . $ut_global_google_headline_font_style['font-size'] . ';'; } if( !empty($ut_global_google_headline_font_style['font-style']) && isset($font_styles[$ut_global_google_headline_font_style['font-style']]) ) { $font .= ' font-style: ' . $font_styles[$ut_global_google_headline_font_style['font-style']] . ';'; } if( !empty($ut_global_google_headline_font_style['line-height']) ) { $font .= ' line-height: ' . $ut_global_google_headline_font_style['line-height'] . ';'; } if( !empty($ut_global_google_headline_font_style['text-transform']) ) { $font .= ' text-transform: ' . $ut_global_google_headline_font_style['text-transform'] . ';'; } $font .= '}'; return $font; } else { /* fallback if user has not chosen a google font yet */ $font_style = ot_get_option('ut_global_headline_font_style' , 'semibold'); return $object . '{ font-family: ' . $ut_recognized_font_styles[$font_style] . ', "Helvetica Neue", Helvetica, Arial, sans-serif; }'. "\n"; } } else { $font_style = ot_get_option('ut_global_headline_font_style' , 'semibold'); return $object . '{ font-family: ' . $ut_recognized_font_styles[$font_style] . ', "Helvetica Neue", Helvetica, Arial, sans-serif; }'. "\n"; } } } } /* |-------------------------------------------------------------------------- | Start Custom CSS |-------------------------------------------------------------------------- */ if ( !function_exists( 'unitedthemes_custom_css' ) ) { function unitedthemes_custom_css() { global $detect; /* some needed variables first */ $accentcolor = get_option('ut_accentcolor' , '#F1C40F'); $sitelogo = get_theme_mod( 'ut_site_logo' ); $google_fonts = ut_recognized_google_fonts(); $ut_recognized_font_styles = ut_recognized_font_styles(); $font_styles = array( 'regular' => 'normal', 'normal' => 'normal', 'italic' => 'italic' ); /* styleswitcher */ if( !empty( $_GET['color'] ) ) { $accentcolor = '#'.$_GET['color']; } /* start css */ $css = ''; echo apply_filters( 'ut-custom-css', $css ); } add_action('wp_head', 'unitedthemes_custom_css' ); } ?>