e() { $css = ''; // Typography CSS. $css .= konte_typography_css(); // Header background. if ( is_home() && 'page' == get_option( 'show_on_front' ) && ( $blog_page_id = get_option( 'page_for_posts' ) ) && 'custom' == get_post_meta( $blog_page_id, 'header_background', true ) ) { $background = get_post_meta( $blog_page_id, 'header_background_color', true ); } elseif ( konte_get_option( 'header_background_blog_custom' ) && konte_is_blog_related_pages() && 'custom' == konte_get_option( 'header_background_blog' ) ) { $background = konte_get_option( 'header_background_blog_color' ); } elseif ( konte_get_option( 'header_background_shop_custom' ) && function_exists( 'WC' ) && is_woocommerce() && 'custom' == konte_get_option( 'header_background_shop' ) ) { $background = konte_get_option( 'header_background_shop_color' ); } elseif ( is_page() && 'custom' == get_post_meta( get_the_ID(), 'header_background', true ) ) { $background = get_post_meta( get_the_ID(), 'header_background_color', true ); } elseif ( 'custom' == konte_get_option( 'header_background' ) ) { $background = konte_get_option( 'header_background_color' ); } if ( ! empty( $background ) ) { if ( 'v10' == konte_get_header_layout() ) { $selector = '.header-v10.custom .header-main .header-left-items'; } else { $selector = '.site-header.custom, .custom .header-search.icon .search-field:focus, .custom .header-search.icon .search-field.focused'; } $css .= $selector . ' { background-color: ' . esc_attr( $background ) . '; }'; } // Topbar height. if ( $height = konte_get_option( 'topbar_height' ) ) { $css .= '.topbar {height: ' . intval( $height ) . 'px}'; } // Header height. $css .= '.header-main, .header-v10 .site-branding, .header-v10 .header-main .header-right-items { height: ' . intval( konte_get_option( 'header_main_height' ) ) . 'px; }'; $css .= '.header-bottom { height: ' . intval( konte_get_option( 'header_bottom_height' ) ) . 'px; }'; // Header width. if ( 'v10' == konte_get_header_layout() ) { $width = absint( konte_get_option( 'header_width' ) ); $width = $width ? $width : 360; $css .= '.header-v10 .header-main .header-left-items { width: ' . $width . 'px; }'; $css .= '.header-vertical .site, .header-vertical .sticky-cart-form { padding-left: ' . $width . 'px; }'; $css .= '.header-vertical .site-footer.transparent { padding-left: ' . $width . 'px; }'; $css .= '@media screen and (max-width: 1440px) { .header-v10 .header-main .header-left-items { width: ' . min( $width, 280 ) . 'px; } .header-vertical .site, .header-vertical .sticky-cart-form { padding-left: ' . min( $width, 280 ) . 'px; } }'; $css .= '@media screen and (max-width: 1280px) { .header-v10 .header-main .header-left-items { width: ' . min( $width, 200 ) . 'px; } .header-vertical .site, .header-vertical .sticky-cart-form { padding-left: ' . min( $width, 200 ) . 'px; } }'; } // Mobile header height. if ( $height = konte_get_option( 'mobile_header_height' ) ) { $css .= '.header-mobile {height: ' . intval( $height ) . 'px}'; } // Logo dimension. $logo_dimension = konte_get_option( 'logo_dimension' ); $logo_dimension = array_map( 'intval', (array) $logo_dimension ); if ( $logo_dimension['width'] > 0 || $logo_dimension['height'] > 0 ) { $width = 0 < $logo_dimension['width'] ? 'width: ' . $logo_dimension['width'] . 'px;' : ''; $height = 0 < $logo_dimension['height'] ? 'height: ' . $logo_dimension['height'] . 'px;' : ''; $css .= '.logo img {' . $width . $height . '}'; $width = $width ? $width : 'width: auto;'; $height = $height ? $height : 'height: auto;'; $css .= '.logo svg {' . $width . $height . '}'; } // Top & Bottom spacings if ( is_page() && 'custom' == get_post_meta( get_the_ID(), 'top_spacing', true ) ) { $top_padding = get_post_meta( get_the_ID(), 'top_padding', true ); if ( $top_padding ) { $css .= '.site-content { padding-top: ' . esc_attr( $top_padding ) . ' !important; }'; } } if ( is_page() && 'custom' == get_post_meta( get_the_ID(), 'bottom_spacing', true ) ) { $bottom_padding = get_post_meta( get_the_ID(), 'bottom_padding', true ); if ( $bottom_padding ) { $css .= '.site-content { padding-bottom: ' . esc_attr( $bottom_padding ) . ' !important; }'; } } // Hamburger menu background if ( $image = konte_get_option( 'hamburger_background' ) ) { $css .= '.hamburger-screen-background { background-image: url(' . esc_url( $image ) . '); }'; } // Blog header image if ( konte_has_blog_header() && ( $image = konte_get_blog_header_image() ) ) { $css .= '.blog-header-title { background-image: url(' . esc_url( $image ) . ')}'; } // Featured content slider's height if ( is_home() && konte_get_option( 'blog_featured_content' ) ) { $height = konte_get_option( 'blog_featured_slider_height' ); $ratio = 1920 / $height; $css .= '.featured-content-carousel, .featured-content-carousel .featured-item { height: ' . absint( $height ) . 'px }'; $css .= '@media screen and (max-width: 1440px) { .featured-content-carousel, .featured-content-carousel .featured-item { height: ' . absint( 1440 / $ratio ) . 'px } }'; $css .= '@media screen and (max-width: 1280px) { .featured-content-carousel, .featured-content-carousel .featured-item { height: ' . absint( 1280 / $ratio ) . 'px } }'; $css .= '@media screen and (max-width: 1199px) { .featured-content-carousel, .featured-content-carousel .featured-item { height: ' . absint( 1199 / $ratio ) . 'px } }'; $css .= '@media screen and (max-width: 991px) { .featured-content-carousel, .featured-content-carousel .featured-item { height: ' . absint( 991 / $ratio ) . 'px } }'; $css .= '@media screen and (max-width: 767px) { .featured-content-carousel, .featured-content-carousel .featured-item { height: ' . absint( 767 / $ratio ) . 'px } }'; } // Footer background if ( is_page() && 'custom' == get_post_meta( get_the_ID(), 'footer_background', true ) ) { $background = get_post_meta( get_the_ID(), 'footer_background_color', true ); } elseif ( konte_get_option( 'footer_background_blog_custom' ) && konte_is_blog_related_pages() && 'custom' == konte_get_option( 'footer_background_blog' ) ) { $background = konte_get_option( 'footer_background_blog_color' ); } elseif ( konte_get_option( 'footer_background_shop_custom' ) && function_exists( 'WC' ) && is_woocommerce() && 'custom' == konte_get_option( 'footer_background_shop' ) ) { $background = konte_get_option( 'footer_background_shop_color' ); } elseif ( 'custom' == konte_get_option( 'footer_background' ) ) { $background = konte_get_option( 'footer_background_color' ); } if ( ! empty( $background ) ) { $css .= '.site-footer.custom { background-color: ' . esc_attr( $background ) . '; }'; unset( $background ); } // Page header height. if ( is_page() ) { $height = get_post_meta( get_the_ID(), 'page_header_height', true ); if ( ! $height ) { if ( ! konte_get_option( 'page_header_full_height' ) ) { $height = intval( konte_get_option( 'page_header_height' ) ); $css .= '.page-header.title-front, .page-header .entry-thumbnail { height: ' . $height . 'px; }'; $css .= '@media (max-width: 991px) { max.page-header.title-front, .page-header .entry-thumbnail { height: ' . ( $height * 0.5 ) . 'px; } }'; $css .= '@media (max-width: 767px) { max.page-header.title-front, .page-header .entry-thumbnail { height: ' . ( $height * 0.375 ) . 'px; } }'; } } elseif ( 'manual' == $height ) { $css .= '.page-header.title-front, .page-header .entry-thumbnail { height: ' . intval( get_post_meta( get_the_ID(), 'page_header_manual_height', true ) ) . 'px; }'; } } // Preloader. Add default CSS to make it run as soon as page loads. if ( konte_get_option( 'preloader_enable' ) ) { $preloader_css = 'position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 99999999;'; $color = konte_get_option( 'preloader_background_color' ); $color = $color ? $color : '#fff'; $preloader_css .= 'background-color: ' . $color . ';'; $css .= '.preloader { ' . $preloader_css . ' }'; } return apply_filters( 'konte_inline_style', $css ); } endif;