%PDF- %PDF-
| Direktori : /home/opti/public_html/stlc/wp-content/themes/insur/inc/ |
| Current File : /home/opti/public_html/stlc/wp-content/themes/insur/inc/theme-customizer-styles.php |
<?php
/**
* insur functions for getting inline styles from theme customizer
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package insur
*/
if (!function_exists('insur_theme_customizer_styles')) :
function insur_theme_customizer_styles()
{
// insur color option
$insur_inline_style = '';
$insur_inline_style .= ':root {
--insur-primary: ' . get_theme_mod('theme_primary_color', sanitize_hex_color('#0ce0ff')) . ';
--insur-primary-rgb: ' . insur_hex_to_rgb(get_theme_mod('theme_primary_color', sanitize_hex_color('#0ce0ff'))) . ';
--insur-base: ' . get_theme_mod('theme_base_color', sanitize_hex_color('#015fc9')) . ';
--insur-base-rgb: ' . insur_hex_to_rgb(get_theme_mod('theme_base_color', sanitize_hex_color('#015fc9'))) . ';
}';
$insur_inner_banner_bg = get_theme_mod('page_header_bg_image');
$insur_inline_style .= '.page-header-bg { background-image: url(' . $insur_inner_banner_bg . '); } ';
$insur_preloader_icon = get_theme_mod('preloader_image');
if ($insur_preloader_icon) {
$insur_inline_style .= '.preloader .preloader__image { background-image: url(' . $insur_preloader_icon . '); } ';
}
if (is_page()) {
$insur_page_base_color = empty(get_post_meta(get_the_ID(), 'theme_primary_color', true)) ? get_theme_mod('theme_primary_color', sanitize_hex_color('#0ce0ff')) : get_post_meta(get_the_ID(), 'theme_primary_color', true);
$insur_page_black_color = empty(get_post_meta(get_the_ID(), 'theme_base_color', true)) ? get_theme_mod('theme_base_color', sanitize_hex_color('#015fc9')) : get_post_meta(get_the_ID(), 'theme_base_color', true);
$insur_inline_style .= ':root {
--insur-primary: ' . $insur_page_base_color . ';
--insur-primary-rgb: ' . insur_hex_to_rgb($insur_page_base_color) . ';
--insur-base: ' . $insur_page_black_color . ';
--insur-base-rgb: ' . insur_hex_to_rgb($insur_page_black_color) . ';
}';
$insur_page_header_bg = empty(get_post_meta(get_the_ID(), 'insur_set_header_image', true)) ? get_theme_mod('page_header_bg_image') : get_post_meta(get_the_ID(), 'insur_set_header_image', true);
$insur_inline_style .= '.page-header-bg { background-image: url(' . $insur_page_header_bg . '); }';
}
wp_add_inline_style('insur-style', $insur_inline_style);
}
endif;
add_action('wp_enqueue_scripts', 'insur_theme_customizer_styles');