1) { $variants .= '|'; } $variants .= $variant; } $variantText = ' (' . $variantCount . ' Varaints' . ')'; if ($variantCount <= 1) $variantText = ''; $options_fonts[ $item['family'] . ':' . $variants ] = $item['family']. $variantText; } $custom_typography = array( ".left_w" => "header_font", "#menu ul li a" => "menu_font", ".bottom .Copyright ul li a" => "footer_menu_font", ".bottom span,.bottom span a" => "footer_text_font", ".the_content,.the_content p,.center,.center p" => "content_font", ".center h1, .center h1 a" => "content_h1", ".center h2, .center h2 a" => "content_h2", ".center h3, .center h3 a" => "content_h3", ".center h4, .center h4 a" => "content_h4", ".center h5, .center h5 a" => "content_h5", ".center h6, .center h6 a" => "content_h6" ); add_action('wp_enqueue_scripts', 'sillver_typography'); function sillver_typography(){ global $custom_typography; foreach( $custom_typography as $selector => $value){ $option = sillver_get_option( $value); sillver_enqueue_font( $option['font'] ) ; } } function sillver_enqueue_font ( $got_font) { if ($got_font) { $font_pieces = explode(":", $got_font); $font_name = $font_pieces[0]; $font_name = str_replace (" ","+", $font_pieces[0] ); $font_variants = $font_pieces[1]; $font_variants = str_replace ("|",",", $font_pieces[1] ); wp_enqueue_style( $font_name , 'http://fonts.googleapis.com/css?family='.$font_name . ':' . $font_variants ); } } function sillver_get_font ( $got_font ) { if ($got_font) { $font_pieces = explode(":", $got_font); $font_name = $font_pieces[0]; $font_name = str_replace (" ","+", $font_pieces[0] ); return $font_name; } } add_action('wp_head', 'sillver_css_wp_head'); function sillver_css_wp_head() { global $custom_typography; echo ''; } $sillver_config['colorRules']['body_font'] = $body_font = sillver_get_option('body_font'); $sillver_config['colorRules']['primary'] = $primary = sillver_get_option('primary'); $sillver_config['colorRules']['body_bg'] = $body_bg = sillver_get_option('bg_color'); $sillver_config['colorRules']['boxed_bg'] = $boxed_bg = sillver_get_option('bg_color_boxed'); $sillver_config['colorRules']['border'] = $border = sillver_get_option('border'); $sillver_config['colorRules']['highlight'] = $highlight = sillver_get_option('highlight'); $sillver_config['colorRules']['bg_highlight']= $bg_highlight = sillver_get_option('bg_highlight'); $sillver_config['colorRules']['socket'] = $socket = sillver_get_option('socket_bg'); $sillver_config['colorRules']['socket_font'] = $socket_font = sillver_get_option('socket_font'); $sillver_config['colorRules']['footer'] = $footer = sillver_get_option('footer_bg'); $sillver_config['colorRules']['footer_font'] = $footer_font = sillver_get_option('footer_font'); $sillver_config['colorRules']['bg_image'] = $bg_image = sillver_get_option('bg_image') == "custom" ? sillver_get_option('bg_image_custom') : sillver_get_option('bg_image'); $sillver_config['style'] = array( //body font color array( 'elements' =>'#top .site-fontcolor, html, body, .blog-meta .post-meta-infos a, .blog-meta .post-meta-infos a span', 'key' =>'color', 'value' => $body_font ), //superlight color array( 'elements' =>'#top .search-result-counter', 'key' =>'color', 'value' => $bg_highlight ), ###################################################################### # Page background color ###################################################################### array( 'elements' =>'#top .site-background, html, body, .comment-reply-link, .main_menu .menu ul li, .title_container #searchsubmit:hover, .isotope .entry-content, .image_overlay_effect, .tagcloud a, .news-thumb, .tweet-thumb a, fieldset, pre', 'key' =>'background-color', 'value' => $body_bg ), array( 'elements' =>'tr:nth-child(even) td, tr:nth-child(even) th', 'key' =>'background-color', 'value' => $body_bg ), //font on elements with primary color, derived from background color array( 'elements' =>'#top .on-primary-color, #top .on-primary-color a, .dropcap2, div .button, input[type="submit"], #submit, .info_text_header, .info_text_header a, .info_text_header a:hover, .contentSlideControlls a.activeItem, #top .related_posts .contentSlideControlls a.activeItem, .contentSlideControlls a:hover, #top .related_posts .contentSlideControlls a:hover, #top th, #top th a, a.button:hover', 'key' =>'color', 'value' => $body_bg ), //body background color highlight array( 'elements' =>'#top .aside-background, div .gravatar img, .slideshow, #top .main_menu .menu li ul a:hover, .related_posts_default_image, div .numeric_controls a, .title_container #searchsubmit, .title_container #s, .tab_content.active_tab_content, .js_active #top .active_tab, .toggler.activeTitle, .contentSlideControlls a', 'key' =>'background-color', 'value' => $bg_highlight ), array( 'elements' =>'tr:nth-child(odd) td, tr:nth-child(odd) th', 'key' =>'background-color', 'value' => $bg_highlight ), //boxed background variations array( 'elements' =>'.boxed #wrap_all, #top.boxed .site-background, .boxed .comment-reply-link, .boxed .main_menu .menu ul li, .boxed .title_container #searchsubmit:hover, .boxed .isotope .entry-content, .boxed .image_overlay_effect, .boxed .tagcloud a, .boxed .news-thumb, .boxed fieldset, .boxed pre', 'key' =>'background-color', 'value' => $boxed_bg ), array( 'elements' =>'.boxed tr:nth-child(even) td, .boxed tr:nth-child(even) th', 'key' =>'background-color', 'value' => $boxed_bg ), array( 'elements' =>'#top.boxed .on-primary-color, #top.boxed .on-primary-color a, .boxed .dropcap2, .boxed div .button,.boxed input[type="submit"],.boxed #submit, .boxed .info_text_header,.boxed .info_text_header a,.boxed .info_text_header a:hover, .boxed .contentSlideControlls a.activeItem, #top.boxed .related_posts .contentSlideControlls a.activeItem, .boxed .contentSlideControlls a:hover, #top.boxed .related_posts .contentSlideControlls a:hover, .boxed th, .boxed .tweet-thumb a, #top.boxed th, #top.boxed th a, .boxed a.button:hover', 'key' =>'color', 'value' => $boxed_bg ), ###################################################################### # primary color ###################################################################### //background color array( 'elements' =>'#top .primary-background, .dropcap2, div .button, input[type="submit"], #submit, .info_text_header, .numeric_controls a:hover, .numeric_controls .active_item, .contentSlideControlls a.activeItem, #top th, #top .related_posts .contentSlideControlls a.activeItem, #top .arrow_controls a, #main .content #searchsubmit:hover, .callout a', 'key' =>'background-color', 'value' => $primary ), //color array( 'elements' =>'#top .primary-color, a, #cancel-comment-reply-link, .blog-tags a:hover, .relThumb a:hover strong, .flex_column h1, .flex_column h2, .flex_column h3, .flex_column h4, .flex_column h5, .flex_column h6, #top #wrap_all .tweet-text a, #top #js_sort_items a.active_sort', 'key' =>'color', 'value' => $primary ), //border color array( 'elements' =>'#top .primary-border, div .main_menu ul:first-child > li.current-menu-item > a, div .main_menu ul:first-child > li.current_page_item > a, div .button, input[type="submit"], #submit, #top .main_menu .menu ul, .info_text_header', 'key' =>'border-color', 'value' => $primary ), //google webfonts array( 'elements' => 'h1, h2, h3, h4, h5, h6, .hero-text, blockquote, legend, #top .slideshow_caption h1', 'key' => 'google_webfont', 'value' => sillver_get_option('google_webfont') ), ###################################################################### # border color ###################################################################### array( 'elements' =>'#top .extralight-border, div #header .container, div .pagination, #top .pagination span, div .pagination a, div .gravatar img, #top div .commentlist ul, div .children .children .says, div .commentlist>.comment, div .input-text, input[type="text"], input[type="password"], input[type="email"], textarea, select, #top .main_menu .menu li, pre, code, div .numeric_controls a, div .pullquote_boxed, div .news-thumb, div .tweet-thumb a, #top ul.borderlist>li, .post_nav, #top .wp-caption, .slideshow, .widget a, .widget li, .widget span, .widget div, table, td, tr, th, #footer .container, #socket .container, #top fieldset', 'key' =>'border-color', 'value' => $border ), ###################################################################### # highlight hover color ###################################################################### array( 'elements' =>'#top .highlight-background, div .button:hover, input[type="submit"]:hover, #submit:hover, .contentSlideControlls a:hover, #top .related_posts .contentSlideControlls a:hover, #top .caption-slideshow-button:hover, #top .arrow_controls a:hover, #main .content #searchsubmit', 'key' =>'background-color', 'value' => $highlight ), array( 'elements' =>'a:hover, #top .widget ul li a:hover, #top .widget ul li .news-link:hover strong, #top #wrap_all .tweet-text a:hover, #js_sort_items a:hover', 'key' =>'color', 'value' => $highlight ), array( 'elements' =>'#top .caption-slideshow-button:hover', 'key' =>'border-color', 'value' => $highlight ), ###################################################################### # footer ###################################################################### array( 'elements' =>'#footer', 'key' =>'background-color', 'value' => $footer ), array( 'elements' =>'#top #wrap_all #footer a, #footer h1, #footer h2, #footer h3, #footer h4, #footer h5, #footer h6, #footer strong, #footer .tabcontainer span, #top #footer table, #top #footer table td, #top #footer table caption', 'key' =>'color', 'value' => $footer_font ), ###################################################################### # socket ###################################################################### array( 'elements' =>'#socket, #socket a, html.html_stretched', 'key' =>'background-color', 'value' => $socket ), array( 'elements' =>'#socket, #socket a', 'key' =>'color', 'value' => $socket_font ), ###################################################################### # text selection ###################################################################### array( 'elements' =>'::-moz-selection', 'key' =>'background-color', 'value' => $primary ), array( 'elements' =>'::-webkit-selection', 'key' =>'background-color', 'value' => $primary ), array( 'elements' =>'::selection', 'key' =>'background-color', 'value' => $primary ), array( 'key' => 'direct_input', 'value' => sillver_get_option('quick_css') ), );