term_id). '_color' ); echo "body .post-categories .cat-item.cat-" . absint($singleCat->term_id) . " a{ color : " .blogcast_get_color_format( $category_color['color'] ). "} \n"; echo "body .post-categories .cat-item.cat-" . absint($singleCat->term_id) . " a:hover { color : " .blogcast_get_color_format( $category_color['hover'] ). "} \n"; echo "body.archive.category.category-" . absint($singleCat->term_id) . " #blogcast-main-wrap .page-header .blogcast-container i{ color : " .blogcast_get_color_format( $category_color['color'] ). "} \n"; echo "body.archive.category.category-" . absint($singleCat->term_id) . " #blogcast-main-wrap .page-header .blogcast-container i:hover { color : " .blogcast_get_color_format( $category_color['hover'] ). "} \n"; $category_color_bk = json_decode( BD\blogcast_get_customizer_option( 'category_background_' .absint($singleCat->term_id). '_color' ), true ); if(isset($category_color_bk['initial'] )): if( isset( $category_color_bk['initial']['type'] ) ) : $type = $category_color_bk['initial']['type']; if( isset( $category_color_bk['initial'][$type] ) ) { echo "body .post-categories .cat-item.cat-" . absint($singleCat->term_id) . " a{ background : " .blogcast_get_color_format( $category_color_bk['initial'][$type] ). "} \n"; echo "body.archive.category.category-". absint($singleCat->term_id) . " #blogcast-main-wrap .page-header .blogcast-container i{ background : " .blogcast_get_color_format( $category_color_bk['initial'][$type] ). "}\n"; } endif; endif; if(isset($category_color_bk['hover'] )) : if( isset( $category_color_bk['hover']['type'] ) ) : $type = $category_color_bk['hover']['type']; if( isset( $category_color_bk['hover'][$type] ) ) { echo "body .post-categories .cat-item.cat-" . absint($singleCat->term_id) . " a:hover{ background : " .blogcast_get_color_format( $category_color_bk['hover'][$type] ). "} \n"; echo "body.archive.category.category-". absint($singleCat->term_id) . " #blogcast-main-wrap .page-header .blogcast-container i:hover{ background : " .blogcast_get_color_format( $category_color_bk['hover'][$type] ). "} \n"; } endif; endif; endforeach; endif; } endif; // tags colors if( ! function_exists( 'blogcast_tags_bk_colors_styles' ) ) : /** * Generates css code for font size * * @package blogcast * @since 1.0.0 */ function blogcast_tags_bk_colors_styles() { $totalTags = get_tags(); if( $totalTags ) : foreach( $totalTags as $singleTag ) : $tag_color = BD\blogcast_get_customizer_option( 'tag_' .absint($singleTag->term_id). '_color' ); echo "body .tags-wrap .tags-item.tag-" . absint($singleTag->term_id) . " span{ color : " .blogcast_get_color_format( $tag_color['color'] ). "} \n"; echo "body .tags-wrap .tags-item.tag-" . absint($singleTag->term_id) . ":hover span { color : " .blogcast_get_color_format( $tag_color['hover'] ). "} \n"; echo "body.archive.tag.tag-" . absint($singleTag->term_id) . " #blogcast-main-wrap .page-header .blogcast-container i{ color : " .blogcast_get_color_format( $tag_color['color'] ). "} \n"; echo "body.archive.tag.tag-" . absint($singleTag->term_id) . " #blogcast-main-wrap .page-header .blogcast-container i:hover { color : " .blogcast_get_color_format( $tag_color['hover'] ). "} \n"; $tag_color_bk = json_decode( BD\blogcast_get_customizer_option( 'tag_background_' .absint($singleTag->term_id). '_color' ), true ); if(isset($tag_color_bk['initial'] )) : if( isset( $tag_color_bk['initial']['type'] ) ) : $type = $tag_color_bk['initial']['type']; if( isset( $tag_color_bk['initial'][$type] ) ){ echo "body .tags-wrap .tags-item.tag-" . absint($singleTag->term_id) . "{ background : " .blogcast_get_color_format( $tag_color_bk['initial'][$type] ). "} \n"; echo "body.archive.tag.tag-" . absint($singleTag->term_id) . " #blogcast-main-wrap .page-header .blogcast-container i{ background : " .blogcast_get_color_format( $tag_color_bk['initial'][$type] ). "} \n"; } endif; endif; if(isset($tag_color_bk['hover'] )) : if( isset( $tag_color_bk['hover']['type'] ) ) : $type = $tag_color_bk['hover']['type']; if( isset( $tag_color_bk['hover'][$type] ) ) { echo "body .tags-wrap .tags-item.tag-" . absint($singleTag->term_id) . " #blogcast-main-wrap .page-header .blogcast-container i:hover{ background : " .blogcast_get_color_format( $tag_color_bk['hover'][$type] ). "} \n"; echo "body.archive.tag.tag-" . absint($singleTag->term_id) . " #blogcast-main-wrap .page-header .blogcast-container i:hover{ background : " .blogcast_get_color_format( $tag_color_bk['hover'][$type] ). "} \n"; } endif; endif; endforeach; endif; } endif; /** ================================ Border Options ================================ **/ if( ! function_exists( 'blogcast_border_option' ) ) : /** * Generate css code for Top header Text Color * * @package Blogcast * @since 1.0.0 */ function blogcast_border_option( $selector, $control, $property="border" ) { $decoded_control = BD\blogcast_get_customizer_option( $control ); if( ! $decoded_control ) return; if( isset( $decoded_control['type'] ) || isset( $decoded_control['width'] ) || isset( $decoded_control['color'] ) ) : echo $selector. "{ ".$property.": ". $decoded_control['width'] ."px ".$decoded_control['type']." ". blogcast_get_color_format($decoded_control['color']) .";}"; endif; } endif; /** ================================ Box Shadow ================================ **/ if( ! function_exists( 'blogcast_box_shadow_styles' ) ) : /** * Generates css code for block box shadow size * * @package Blogcast * @since 1.0.0 */ function blogcast_box_shadow_styles($selector,$value) { $blogcast_box_shadow = BD\blogcast_get_customizer_option($value); if( $blogcast_box_shadow['option'] == 'none' ) { echo $selector."{ box-shadow: 0px 0px 0px 0px; }\n"; } else { if( $blogcast_box_shadow['type'] == 'outset'){ $blogcast_box_shadow['type'] = ''; } echo $selector."{ box-shadow : ".esc_html( $blogcast_box_shadow['type'] ) ." ".esc_html( $blogcast_box_shadow['hoffset'] ). "px ". esc_html( $blogcast_box_shadow['voffset'] ). "px ".esc_html( $blogcast_box_shadow['blur'] ). "px ".esc_html( $blogcast_box_shadow['spread'] ). "px ".blogcast_get_color_format( $blogcast_box_shadow['color'] ). "; }\n"; } } endif; /** ================================ Image ratio change ================================ **/ if( ! function_exists( 'blogcast_image_ratio' ) ) : /** * Generate css code for variable change with responsive * * @package Blogcast * @since 1.0.0 */ function blogcast_image_ratio( $selector, $control ) { $decoded_control = BD\blogcast_get_customizer_option( $control ); if( ! $decoded_control ) return; if( isset( $decoded_control['desktop'] ) && $decoded_control['desktop'] > 0 ) : $desktop = $decoded_control['desktop']; echo $selector . "{ padding-bottom : calc(".esc_html( $desktop ). " * 100%); }"; endif; if( isset( $decoded_control['tablet'] ) && $decoded_control['tablet'] > 0 ) : $tablet = $decoded_control['tablet']; echo "@media(max-width: 940px) { " .$selector . "{ padding-bottom : calc(".esc_html( $tablet ). "* 100%); } }\n"; endif; if( isset( $decoded_control['smartphone'] ) && $decoded_control['smartphone'] > 0 ) : $smartphone = $decoded_control['smartphone']; echo "@media(max-width: 610px) { " .$selector . "{ padding-bottom : calc(".esc_html($smartphone). " * 100%); } }\n"; endif; } endif; /** ================================ Image ratio Variable change ================================ **/ if( ! function_exists( 'blogcast_image_ratio_variable' ) ) : /** * Generate css code for variable change with responsive * * @package Blogcast * @since 1.0.0 */ function blogcast_image_ratio_variable ( $selector, $control ) { $decoded_control = BD\blogcast_get_customizer_option( $control ); if( ! $decoded_control ) return; if( isset( $decoded_control['desktop'] ) && $decoded_control['desktop'] > 0 ) : $desktop = $decoded_control['desktop']; echo "body { ". $selector . " : ".esc_html( $desktop )."}\n"; endif; if( isset( $decoded_control['tablet'] ) && $decoded_control['tablet'] > 0 ) : $tablet = $decoded_control['tablet']; echo "body { " .$selector . "-tab : ".esc_html( $tablet ). " } }\n"; endif; if( isset( $decoded_control['smartphone'] ) && $decoded_control['smartphone'] > 0 ) : $smartphone = $decoded_control['smartphone']; echo "body { " .$selector . "-mobile : ".esc_html($smartphone). " } \n"; endif; } endif; /** ================================ Background Color (Initial) ================================ **/ if( ! function_exists( 'blogcast_initial_bk_color' ) ) : /** * Generate css code for top header color options * * @package Blogcast * @since 1.0.0 */ function blogcast_initial_bk_color( $selector, $control) { $decoded_control = json_decode( BD\blogcast_get_customizer_option( $control ), true); if( ! $decoded_control ) return; echo $selector. " { background: " .blogcast_get_color_format( $decoded_control[$decoded_control ['type']]). "}\n"; } endif; /** ================================ Site Background Color ================================ **/ if( ! function_exists( 'blogcast_get_background_style' ) ) : /** * Generate css code for background control. * * @package blogcast * @since 1.0.0 */ function blogcast_get_background_style( $selector, $control, $var = '' ) { $decoded_control = json_decode( BD\blogcast_get_customizer_option( $control ), true ); if( ! $decoded_control ) return; if( isset( $decoded_control['type'] ) ) : $type = $decoded_control['type']; switch( $type ) { case 'image' : if( isset( $decoded_control[$type]['media_id'] ) ) echo $selector . " { background-image: url(" .esc_url( wp_get_attachment_url( $decoded_control[$type]['media_id'] ) ). ") }"; if( isset( $decoded_control['repeat'] ) ) echo $selector . "{ background-repeat: " .esc_html( $decoded_control['repeat'] ). "}"; if( isset( $decoded_control['position'] ) ) echo $selector . "{ background-position:" .esc_html( $decoded_control['position'] ). "}"; if( isset( $decoded_control['attachment'] ) ) echo $selector . "{ background-attachment: " .esc_html( $decoded_control['attachment'] ). "}"; if( isset( $decoded_control['size'] ) ) echo $selector . "{ background-size: " .esc_html( $decoded_control['size'] ). "}"; break; default: if( isset( $decoded_control[$type] ) ) echo $selector . "{ background: " .blogcast_get_color_format( $decoded_control[$type] ). "}"; } endif; } endif;