'url("' . esc_url( $header_image ) . '")', 'background-repeat' => 'no-repeat', 'background-size' => $background_size, 'background-position' => $background_position, ); if ( ! $background_size ) { unset( $background_array['background-size'] ); } bizznis_get_css()->add( array( 'selectors' => $header_selector, 'declarations' => $background_array ) ); } //* Header text color CSS, if showing text if ( display_header_text() && $text_color ) { bizznis_get_css()->add( array( 'selectors' => $text_selectors, 'declarations' => array( 'color' => bizznis_add_string_filter( 'maybe_hash_hex_color', $text_color ), ) ) ); } } /** * Colors section */ add_action( 'bizznis_css', 'bizznis_css_add_color_rules' ); function bizznis_css_add_color_rules() { $color_primary = bizznis_add_string_filter( 'maybe_hash_hex_color', get_theme_mod( 'bizznis_primary_color' ) ); $color_secondary = bizznis_add_string_filter( 'maybe_hash_hex_color', get_theme_mod( 'bizznis_secondary_color' ) ); $color_link = bizznis_add_string_filter( 'maybe_hash_hex_color', get_theme_mod( 'bizznis_link_color' ) ); $color_text = bizznis_add_string_filter( 'maybe_hash_hex_color', get_theme_mod( 'bizznis_text_color' ) ); $color_detail = bizznis_add_string_filter( 'maybe_hash_hex_color', get_theme_mod( 'bizznis_detail_color' ) ); // Primary color if ( $color_primary ) { bizznis_get_css()->add( array( 'selectors' => array( '.color-primary-color', '.entry-title a', '.nav-primary a', ), 'declarations' => array( 'color' => $color_primary ) ) ); bizznis_get_css()->add( array( 'selectors' => array( '.color-primary-background', '.nav-secondary', '.footer-widgets', ), 'declarations' => array( 'background-color' => $color_primary, ) ) ); bizznis_get_css()->add( array( 'selectors' => array( 'input', 'select', 'textarea', '.color-primary-border', '.site-main', '.menu-bizznis .sub-menu a', '.nav-header .sub-menu', 'article.entry', '.archive-pagination', '.entry-pagination', '.entry-pings', ), 'declarations' => array( 'border-color' => $color_primary ) ) ); } // Secondary color if ( $color_secondary ) { bizznis_get_css()->add( array( 'selectors' => array( '.nav-primary', '.nav-primary a', '.footer-widgets', '.footer-widgets a', '.footer-creds', '.footer-creds a', ), 'declarations' => array( 'color' => $color_secondary ) ) ); bizznis_get_css()->add( array( 'selectors' => array( '.author-box', '.archive-description', 'li.comment', '.sidebar .widget', '.after-entry .widget', ), 'declarations' => array( 'background-color' => $color_secondary ) ) ); bizznis_get_css()->add( array( 'selectors' => array( '.footer-widgets', ), 'declarations' => array( 'border-color' => $color_secondary ), 'media' => 'screen and (min-width: 800px)' # Also define media query if needed ) ); } // Link color if ( $color_link ) { bizznis_get_css()->add( array( 'selectors' => array( '.bizznis_link_color', 'a', ), 'declarations' => array( 'color' => $color_link ) ) ); } // Text color if ( $color_text ) { bizznis_get_css()->add( array( 'selectors' => array( '.bizznis_text_color', 'body', ), 'declarations' => array( 'color' => $color_text ) ) ); } // Detail color if ( $color_detail ) { bizznis_get_css()->add( array( 'selectors' => array( '.bizznis_detail_color-text', '.entry-meta', '.breadcrumb', ), 'declarations' => array( 'color' => $color_detail ) ) ); } }