Esempio n. 1
0
 static function style($ot)
 {
     # category styling
     if (is_category()) {
         if (is_object(get_queried_object()) and !empty(get_queried_object()->term_id)) {
             $term = get_term(get_queried_object()->term_id, 'category');
             $cat_color = get_field('category_color', $term);
             if (!empty($cat_color)) {
                 $ot['main_color'] = $cat_color;
             }
         }
     }
     # signle article inherit first category style
     if (is_single()) {
         $cat_object = current(get_the_category());
         if (is_object($cat_object) and !empty($cat_object->term_id)) {
             $term = get_term($cat_object->term_id, 'category');
             $cat_color = get_field('category_color', $term);
             if (!empty($cat_color)) {
                 $ot['main_color'] = $cat_color;
             }
         }
     }
     $style = "\n\t\t\t::selection {background:{$ot['main_color']};color:#fff;}\n\t\t\t::-moz-selection {background:{$ot['main_color']};color:#fff;}\n\t\t";
     # bg elements
     $style .= ".bargraph li span, .post-categories a, .post-tags a, .billboard-slider .info .read-more a:hover, .bw-slider .owl-buttons div:hover, .article-thumb:hover .icon, .woocommerce #content input.button.alt, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce-page #content input.button.alt, .woocommerce-page #respond input#submit.alt, .woocommerce-page a.button.alt, .woocommerce-page button.button.alt, .woocommerce-page input.button.alt, #footer .reviews article .bar .progress, .reviews article .bar .progress, .widget_tag_cloud a, #header.version-3 .right-content.black .search-submit:hover, #header.version-3 .search-form .search-submit, .page .search-form .search-submit:hover, #header.version-3 .search-form .search-submit:hover, .cat-tags a, .score-box .score, .review-score .bar .progress, .article-thumb .rate, #header .social a:hover {background-color:{$ot['main_color']}!important}";
     $style .= "#footer .widget_tag_cloud a:hover {background-color:{$ot['main_color']}!important;}";
     # color elements
     $style .= ".bw-button, .bw-slider .title h3:hover, .article-title h3.bb a:hover, #sidebar .reviews article .bar .score-label a:hover, .bw-megamenu .article-title span:hover, .bw-megamenu .megamenu-slider .item:hover .title h3, .bw-megamenu .small-link:hover, .woocommerce .cart-collaterals .shipping_calculator .shipping-calculator-button, .woocommerce-page .cart-collaterals .shipping_calculator .shipping-calculator-button, .woocommerce .product_meta a, #footer .bw-popular-widget-nav a.active, .widget_archive ul a, .widget_categories ul a, .widget_pages ul a, #content .post table th, .post-author .cont h4 a:hover, .cat-tags-list a, .header-parallax .date strong a:hover, .post-subtitle a:hover, a, a:visited {color:{$ot['main_color']}}";
     # other
     $style .= ".post-tags a:before, .cat-tags a:before {border-right-color:{$ot['main_color']}}";
     $style .= "blockquote {border-left:8px solid:{$ot['main_color']}}";
     $style .= "#footer #wp-calendar tbody td {border-top:1px solid {$ot['main_color']}}";
     $style .= "#footer #wp-calendar tfoot tr td {border-top:1px solid {$ot['main_color']}}";
     $style .= ".billboard-slider .info .read-more a:hover, .bw-slider .owl-buttons div:hover, .article-thumb:hover .icon {border-color:{$ot['main_color']}}";
     $style .= "blockquote {border-color:{$ot['main_color']}}";
     $style .= "\n\t\t\tbody {background-color:{$ot['background_color']}}\n\t\t\t#header .row-holder {background-color:{$ot['header_nav_color']}}\n\t\t\tbody.boxed #header .row-holder .row.for-sub-header {background-color:{$ot['header_nav_color']};}\n\t\t";
     $style .= ".papa-grid h3 a {color:#000}";
     $style .= ".post-categories a:hover, .post-tags a:hover {background-color:#000!important}";
     $style .= ".article-thumb .rate:after {border-color:rgba(" . Bw::color_saturation(Bw::hex2rgb($ot['main_color']), -60) . ",1) transparent}";
     if (Bw::get_option('header_white')) {
         $style .= '#header {background-color:#fff;}';
     }
     if (Bw::get_option('header_nav_color') or Bw::get_option('invert_header_nav_color')) {
         $style .= '.bw-megamenu {padding-top:15px;}';
     }
     if (Bw::get_option('header_color') and !Bw::get_option('header_white')) {
         $style .= "#header {background-color:{$ot['header_color']};}";
     }
     if ($ot['background_image']) {
         $style .= "#bw-bg {background:url('{$ot['background_image']}') no-repeat center center;background-size:cover;background-attachment:fixed;}";
     }
     $style .= self::get_shadow($ot['container_shadow']);
     printf("<style>%s</style>", $style);
 }