urlencode( implode( '|',$fonts ) ), 'subset' => urlencode( 'latin,latin-ext' ), 'display' => urlencode( 'fallback' ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); } return esc_url_raw($fonts_url); } endif; // Theme custom style function theme_custom_css() { $primary_color = get_theme_mod('primary_color'); $secondary_color = get_theme_mod('secondary_color'); $heading_color = get_theme_mod('heading_color'); $font_color = get_theme_mod('font_color'); $body_bg = get_theme_mod('body_bg'); $custom_css = ''; if(class_exists( 'kirki' )){ if(!empty( $primary_color)){ $custom_css .= ' :root { --theme-primary-color:'.esc_attr($primary_color).'; --theme-secondary-color:'.esc_attr($secondary_color).'; --theme-heading-color:'.esc_attr($heading_color).'; --theme-font-color:'.esc_attr($primary_color).'; } '; } if(!empty( $font_color)){ $custom_css .= ' p,body{ color:'.esc_attr($font_color).'; } '; } if(!empty( $body_bg['background-image'])){ $custom_css .= ' body{ background:'.esc_attr($body_bg['background-image']).'; } '; } // Menu Color Option $header_padding = get_theme_mod('header_padding'); $menu_bg_color = get_theme_mod('menu_bg_color'); $menu_color = get_theme_mod('menu_color'); $menu_hover_color = get_theme_mod('menu_hover_color'); $menu_btn_color = get_theme_mod('menu_btn_color'); $menu_btn_color = get_theme_mod('menu_btn_color'); $menu_btn_hover_color = get_theme_mod('menu_btn_hover_color'); $menu_btn_bg = get_theme_mod('menu_btn_bg'); $menu_btn_hover_bg = get_theme_mod('menu_btn_hover_bg'); if(!empty( $header_padding)){ $custom_css .= ' .header-navbar{ padding-top:'.esc_attr($header_padding['padding-top']).'px; padding-bottom:'.esc_attr($header_padding['padding-bottom']).'px; } '; } if(!empty($menu_bg_color )){ $custom_css .= ' .header-navbar{ background:'.esc_attr($menu_bg_color).'; } '; } if(!empty( $menu_color)){ $custom_css .= ' .header-navbar .primary-menu li a{ color:'.esc_attr($menu_color).'; } .header-navbar .primary-menu li .sub-menu li a{ color:'.esc_attr($menu_color).'; } '; } if(!empty($menu_hover_color)){ $custom_css .= ' .header-navbar .primary-menu li a:hover{ color:'.esc_attr($menu_hover_color).'; } .header-navbar .primary-menu li .sub-menu li a:hover{ color:'.esc_attr($menu_hover_color).'; } '; } if(!empty($menu_btn_color )){ $custom_css .= ' .header-btn .btn{ color:'.esc_attr($menu_btn_color ).'; } '; } if(!empty($menu_btn_hover_color)){ $custom_css .= ' .header-btn .btn:hover{ color:'.esc_attr($menu_btn_hover_color).'; } '; } if(!empty($menu_btn_bg)){ $custom_css .= ' .header-btn .btn{ background:'.esc_attr($menu_btn_bg).'; border-color:'.esc_attr($menu_btn_bg).'; } '; } if(!empty($menu_btn_hover_bg )){ $custom_css .= ' .header-btn .btn:hover{ background:'.esc_attr($menu_btn_hover_bg ).'; border-color:'.esc_attr($menu_btn_hover_bg ).'; } '; } // Blog sidebar $sidebar_box_radius = get_theme_mod('sidebar_box_radius'); $sidebar_box_bg_color = get_theme_mod('sidebar_box_bg_color'); $sidebar_box_title = get_theme_mod('sidebar_box_title'); $sidebar_box_text = get_theme_mod('sidebar_box_text'); $sidebar_box_link_hover = get_theme_mod('sidebar_box_link_hover'); if(!empty($sidebar_box_radius)){ $custom_css .= ' .sidebar .widget{ border-radius:'.esc_attr($sidebar_box_radius).'px; } '; } if(!empty($sidebar_box_bg_color)){ $custom_css .= ' .sidebar .widget{ color:'.esc_attr( $sidebar_box_bg_color).'; } '; } if(!empty($sidebar_box_title)){ $custom_css .= ' .sidebar .widget .wp-block-heading, .sidebar .widget label{ color:'.esc_attr( $sidebar_box_title).'; } '; } if(!empty($sidebar_box_text)){ $custom_css .= ' .sidebar .widget a, .sidebar .widget p{ color:'.esc_attr($sidebar_box_text).'; } '; } if(!empty( $sidebar_box_link_hover)){ $custom_css .= ' .sidebar .widget a:hover{ color:'.esc_attr( $sidebar_box_link_hover).'; } '; } // Page Banner $banner_bg_color = get_theme_mod('banner_bg_color'); $banner_page_overlay_color = get_theme_mod('banner_page_overlay_color'); $banner_title_color = get_theme_mod('banner_title_color'); $breadcrumb_text_color = get_theme_mod('breadcrumb_text_color'); if(!empty($banner_bg_color)){ $custom_css .= ' .banner-solid{ background:'.esc_attr($banner_bg_color).'; } '; } if(!empty($banner_page_overlay_color)){ $custom_css .= ' .banner-bg:before{ background:'.esc_attr($banner_page_overlay_color).'; } '; } if(!empty($banner_title_color)){ $custom_css .= ' .page-header .banner-title { color:'.esc_attr($banner_title_color).'; } '; } if(!empty($breadcrumb_text_color)){ $custom_css .= ' .page-header ul li{ color:'.esc_attr($breadcrumb_text_color).'; } .page-header ul li a{ color:'.esc_attr($breadcrumb_text_color).'; } '; } // Footer Settings $footer_title_color = get_theme_mod('footer_title_color'); $footer_text_color = get_theme_mod('footer_text_color'); $footer_link_color = get_theme_mod('footer_text_link_color'); $footer_bg_color = get_theme_mod('footer_bg_color'); $footer_link_hover_color = get_theme_mod('footer_link_hover_color'); if(!empty($footer_bg_color)){ $custom_css .= ' .footer,.footer-2{ background:'.esc_attr($footer_bg_color).'; } '; } if(!empty($footer_title_color)){ $custom_css .= ' .footer .footer-widget .widget-title{ color:'.esc_attr($footer_title_color).'; } '; } if(!empty($footer_text_color)){ $custom_css .= ' .footer-widget .textwidget, .footer-widget p{ color:'.esc_attr($footer_text_color).'; } '; } if(!empty($footer_text_link_color)){ $custom_css .= ' .footer ul a, .footer-2 ul a{ color:'.esc_attr($footer_text_link_color).'; } '; } if(!empty($footer_link_hover_color)){ $custom_css .= ' .footer ul a:hover, .footer-2 ul a:hover{ color:'.esc_attr($footer_link_hover_color).'; } '; } // padding-bottom:'.//esc_attr($topbar_padding['padding-bottom']).'px; // Header Topbar $topbar_padding = get_theme_mod('topbar_padding'); $topbar_bg_color = get_theme_mod('topbar_bg_color'); $topbar_font_color = get_theme_mod('topbar_font_color'); $topbar_hover_color = get_theme_mod('topbar_hover_color'); $topbar_icon_color = get_theme_mod('topbar_icon_color'); $top_social_icon_color = get_theme_mod('top_social_icon_color'); $top_social_hover_color = get_theme_mod('top_social_hover_color'); $top_social_icon_bg_color = get_theme_mod('top_social_icon_bg_color'); $top_social_icon_hover_bg = get_theme_mod('top_social_icon_hover_bg'); if(!empty( $topbar_padding)){ $custom_css .= ' .header-top{ padding-top:'.esc_attr($topbar_padding['padding-top']).'px; } '; } if(!empty($topbar_bg_color )){ $custom_css .= ' .header-top{ background:'.esc_attr($topbar_bg_color).'; } '; } if(!empty( $topbar_font_color)){ $custom_css .= ' .header-contact li a,.header-contact li{ color:'.esc_attr($topbar_font_color).'; } '; } if(!empty( $topbar_hover_color)){ $custom_css .= ' .header-contact li a:hover{ color:'.esc_attr( $topbar_hover_color).'; } '; } if(!empty( $topbar_icon_color)){ $custom_css .= ' .header-contact li i{ color:'.esc_attr($topbar_icon_color).'; } '; } if(!empty($top_social_icon_color)){ $custom_css .= ' .header-socials a{ color:'.esc_attr($top_social_icon_color).'; } '; } if(!empty($top_social_icon_bg_color )){ $custom_css .= ' .header-socials a{ background:'.esc_attr($top_social_icon_bg_color ).'; } '; } if(!empty($top_social_hover_color)){ $custom_css .= ' .header-socials a:hover{ color:'.esc_attr($top_social_hover_color).'; } '; } if(!empty( $top_social_icon_hover_bg)){ $custom_css .= ' .header-socials a:hover{ background:'.esc_attr( $top_social_icon_hover_bg).'; } '; } } wp_enqueue_style( 'custom-theme-style', get_template_directory_uri() . '/assets/css/custom.css' ); wp_add_inline_style( 'custom-theme-style', $custom_css ); } add_action( 'wp_enqueue_scripts', 'theme_custom_css' ); ?>