meta_data = get_post_meta( get_the_ID(), "rt_layout_meta_data", true ); $dynamic_css = $this->inline_style(); wp_register_style( 'wtbigshop-dynamic', false, 'wtbigshop-main' ); wp_enqueue_style( 'wtbigshop-dynamic' ); wp_add_inline_style( 'wtbigshop-dynamic', $this->minify_css( $dynamic_css ) ); } function minify_css( $css ) { $css = preg_replace( '/\/\*[^*]*\*+([^\/][^*]*\*+)*\//', '', $css ); // Remove comments $css = preg_replace( '/\s+/', ' ', $css ); // Remove multiple spaces $css = preg_replace( '/\s*([\{\};])\s*/', '$1', $css ); // Remove spaces around { } ; : , return $css; } private function inline_style() { $primary_color = wtbigshop_option( 'rt_primary_color', '#f96565' ); $primary_light_color = wtbigshop_option( 'rt_primary_light_color', '#f96565' ); $secondary_color = wtbigshop_option( 'rt_secondary_color', '#d35656' ); $body_color = wtbigshop_option( 'rt_body_color', '#8C8C8C' ); $body_bg_color = wtbigshop_option( 'rt_body_bg_color', '#ffffff' ); $title_color = wtbigshop_option( 'rt_title_color', '#1E1E1E' ); $rating_color = wtbigshop_option( 'rt_rating_color', '#F9BA19' ); $meta_color = wtbigshop_option( 'rt_meta_color', '#8C8C8C' ); $meta_light = wtbigshop_option( 'rt_meta_light', '#d3d9e1' ); $gray10 = wtbigshop_option( 'rt_gray10_color', '#f8f8f7' ); $gray20 = wtbigshop_option( 'rt_gray20_color', '#696969' ); ob_start(); ?> :root { --rt-primary-color: ; --rt-primary-light-color: ; --rt-secondary-color: ; --rt-body-color: ; --rt-body-bg-color: ; --rt-title-color: ; --rt-rating-color: ; --rt-meta-color: ; --rt-meta-light: ; --rt-gray10: ; --rt-gray20: ; --rt-body-rgb: ; --rt-title-rgb: ; --rt-primary-rgb: ; --rt-secondary-rgb: ; --rt-container-width: px; } body { color: ; } site_fonts(); $this->topbar_css(); $this->header_css(); $this->breadcrumb_css(); $this->content_padding_css(); $this->footer_css(); $this->site_background(); return ob_get_clean(); } /** * Topbar Settings * @return void */ protected function topbar_css() { $_topbar_active_color = wtbigshop_option( 'rt_topbar_active_color' ); echo self::css( 'body .site-header .wtbigshop-topbar .topbar-container *:not(.dropdown-menu *)', 'color', 'rt_topbar_color' ); echo self::css( 'body .site-header .wtbigshop-topbar .topbar-container svg:not(.dropdown-menu svg)', 'fill', 'rt_topbar_color', ' !important' ); if ( ! empty( $_topbar_active_color ) ) : ?> body .site-header .wtbigshop-topbar .topbar-container a:hover:not(.dropdown-menu a:hover), body .wtbigshop-topbar #topbar-menu ul ul li.current_page_item > a, body .wtbigshop-topbar #topbar-menu ul ul li.current-menu-ancestor > a, body .wtbigshop-topbar #topbar-menu ul.wtbigshop-topbar-menu > li.current-menu-item > a, body .wtbigshop-topbar #topbar-menu ul.wtbigshop-topbar-menu > li.current-menu-ancestor > a { color: !important; } body .site-header .wtbigshop-topbar .topbar-container a:hover:not(.dropdown-menu a:hover svg) svg, body .wtbigshop-topbar #topbar-menu ul ul li.current-menu-ancestor > a svg, body .wtbigshop-topbar #topbar-menu ul.wtbigshop-topbar-menu > li.current-menu-item > a svg, body .wtbigshop-topbar #topbar-menu ul.wtbigshop-topbar-menu > li.current-menu-ancestor > a svg { fill: !important; } 768 ) { $h_width = $header_width . 'px'; } ?> .header-container, .topbar-container {width: ;max-width: 100%;} .site-header .site-branding img { max-width: ; max-height: ; object-fit: contain; } body .main-header-section .wtbigshop-navigation ul li a {color: ;} body .main-header-section svg {fill: ;} body .main-header-section .menu-icon-wrapper .menu-bar span, body .menu-icon-wrapper .has-separator li:not(:last-child):after {background-color: ;} body .main-header-section .wtbigshop-navigation ul li a:hover, body .main-header-section .wtbigshop-navigation ul li.current-menu-item > a, body .main-header-section .wtbigshop-navigation ul li.current-menu-ancestor > a {color: ;} body .main-header-section .wtbigshop-navigation ul li.current-menu-item > a svg,body .main-header-section .wtbigshop-navigation ul li.current-menu-ancestor > a svg {fill: ;} body .main-header-section .menu-icon-wrapper .menu-bar:hover span {background-color: ;} body .main-header-section a:hover [class*=rticon] svg {fill: ;} .wtbigshop-navigation ul > li > ul {background-color: ;} body .wtbigshop-topbar { border-bottom-color: ; } body .main-header-section {border-bottom: none;} body .wtbigshop-breadcrumb-wrapper {border-bottom: none;} .wtbigshop-header-2 .icon-item .text .label, .wtbigshop-header-1 .icon-item .text .label{ color: } .wtbigshop-header-2 .menu-icon-wrapper .item-icon i, .wtbigshop-header-2 .icon-item .icon i, .site-header .menu-icon-wrapper i{ color: } .wtbigshop-breadcrumb-wrapper .entry-title {color: !important;} body .wtbigshop-breadcrumb-wrapper, .wtbigshop-banner-2 .wtbigshop-breadcrumb-wrapper {background-color: ;} .wtbigshop-banner-2 .wtbigshop-breadcrumb-wrapper .breadcrumb a, body .wtbigshop-breadcrumb-wrapper .breadcrumb a, .has-trheader .wtbigshop-breadcrumb-wrapper .breadcrumb a {color: ;} body .wtbigshop-breadcrumb-wrapper .breadcrumb li::after {border-color: ;} .wtbigshop-banner-2 .wtbigshop-breadcrumb-wrapper .breadcrumb .raquo path{ stroke: } .wtbigshop-banner-2 .wtbigshop-breadcrumb-wrapper .breadcrumb li.active .title, body .wtbigshop-breadcrumb-wrapper .breadcrumb li.active .title, body .wtbigshop-breadcrumb-wrapper .breadcrumb a:hover, .has-trheader .wtbigshop-breadcrumb-wrapper .breadcrumb li.active .title, .has-trheader .wtbigshop-breadcrumb-wrapper .breadcrumb a:hover {color: ;} .content-area {padding-top: px;} .content-area {padding-bottom: px;} 1400 ) { echo self::css( '.site-footer .footer-container', 'width', 'rt_footer_max_width', 'px;max-width: 100%' ); } echo self::css( 'body .site-footer *:not(a)', 'color', 'rt_footer_text_color' ); echo self::css( 'body .site-footer a, .wtbigshop-footer-1 .site-footer .widget a', 'color', 'rt_footer_link_color' ); echo self::css( 'body .site-footer a:hover, .wtbigshop-footer-1 .footer-sidebar a:hover', 'color', 'rt_footer_link_hover_color' ); echo self::css( '.wtbigshop-footer-1 .site-footer .footer-widgets-wrapper', 'background-color', 'rt_footer_bg' ); echo self::css( '.wtbigshop-footer-1 .footer-copyright-wrapper', 'border-color', 'rt_footer_input_border_color' ); echo self::css( 'body .site-footer .widget-title, .wtbigshop-footer-1 .footer-widgets .widget-title', 'color', 'rt_footer_widget_title_color' ); echo self::css( 'body .footer-copyright-wrapper .copyright-text', 'color', 'rt_copyright_text_color' ); echo self::css( 'body .site-footer .footer-copyright-wrapper a', 'color', 'rt_copyright_link_color' ); echo self::css( 'body .site-footer .footer-copyright-wrapper a:hover', 'color', 'rt_copyright_link_hover_color' ); echo self::css( 'body .site-footer .footer-copyright-wrapper', 'background-color', 'rt_copyright_bg' ); echo self::css( '.footer-copyright-wrapper .social-icon a', 'background', 'rt_copyright_social_bg_color' ); } /** * Load site fonts * @return void */ protected function site_fonts() { $typo_body = json_decode( wtbigshop_option( 'rt_body_typo' ), true ); $typo_menu = json_decode( wtbigshop_option( 'rt_menu_typo' ), true ); $typo_heading = json_decode( wtbigshop_option( 'rt_all_heading_typo' ), true ); $body_font_family = $typo_body['font'] ?? 'Inter'; $heading_font_family = $typo_heading['font'] ?? $body_font_family; ?> :root{ --rt-body-font: '', sans-serif;; --rt-heading-font: '', sans-serif; --rt-menu-font: '', sans-serif; } $typo_menu['font'] ] ); echo self::font_css( '.wtbigshop-navigation ul li a', [ 'size' => $typo_menu['size'], 'regularweight' => $typo_menu['regularweight'], 'lineheight' => $typo_menu['lineheight'] ] ); echo self::font_css( '.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6', [ 'font' => $typo_heading['font'], 'regularweight' => $typo_heading['regularweight'] ] ); $heading_fonts = [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ]; foreach ( $heading_fonts as $heading ) { $font = json_decode( wtbigshop_option( "rt_heading_{$heading}_typo" ), true ); if ( ! empty( $font['font'] ) ) { $selector = "$heading, .$heading"; echo self::font_css( $selector, $font ); } } } /** * Generate CSS * * @param $selector * @param $property * @param $theme_mod * * @return string|void */ public static function css( $selector, $property, $theme_mod, $after_css = '' ) { $theme_mod = wtbigshop_option( $theme_mod ); if ( ! empty( $theme_mod ) ) { return sprintf( '%s { %s:%s%s; }', $selector, $property, $theme_mod, $after_css ); } } /** * Font CSS * * @param $selector * @param $property * @param $theme_mod * @param $after_css * * @return string */ public static function font_css( $selector, $font ) { $css = ''; $css .= $selector . '{'; //Start CSS $css .= ! empty( $font['font'] ) ? "font-family: '" . $font['font'] . "', sans-serif;" : ''; $css .= ! empty( $font['size'] ) ? "font-size: {$font['size']}px;" : ''; $css .= ! empty( $font['lineheight'] ) ? "line-height: {$font['lineheight']}px;" : ''; $css .= ! empty( $font['regularweight'] ) ? "font-weight: {$font['regularweight']};" : ''; $css .= '}'; //End CSS return $css; } /** * Site background * * @return string */ function site_background() { if ( ! empty( Opt::$pagebgimg ) ) { $bg = wp_get_attachment_image_src( Opt::$pagebgimg, 'full' ); if ( ! empty( $bg[0] ) ) { ?> body { background-image: url(); background-repeat: repeat; background-position: top center; background-size: cover; } body { background-color: ; }