/** * Enqueue scripts and styles. */ function tesseract_scripts() { // Enqueue default style wp_enqueue_style('tesseract-style', get_stylesheet_uri(), array(), '1.0.0'); // Google fonts wp_enqueue_style('tesseract-fonts', tesseract_fonts_url(), array(), '1.0.0'); // Social icons style wp_enqueue_style('tesseract-icons', get_template_directory_uri() . '/css/typicons.css', array(), '1.0.0'); // Horizontal menu style wp_enqueue_style('tesseract-site-banner', get_template_directory_uri() . '/css/site-banner.css', array('tesseract-style'), '1.0.0'); wp_enqueue_style('tesseract-footer-banner', get_template_directory_uri() . '/css/footer-banner.css', array('tesseract-style'), '1.0.0'); wp_enqueue_style('dashicons'); wp_enqueue_style('tesseract-sidr-style', get_template_directory_uri() . '/css/jquery.sidr.css', array('tesseract-style'), '1.0.0'); // Fittext wp_enqueue_script('tesseract-fittext', get_template_directory_uri() . '/js/jquery.fittext.js', array('jquery'), '1.0.0', true); //Mobile menu wp_enqueue_script('tesseract-sidr', get_template_directory_uri() . '/js/jquery.sidr.min.js', array('tesseract-fittext'), '1.0.0', true); // Modernizr for old browsers wp_enqueue_script('tesseract-modernizr', get_template_directory_uri() . '/js/modernizr.custom.min.js', array(), '1.0.0', false); // JS helpers (This is also the place where we call the jQuery in array) wp_enqueue_script('tesseract-helpers-functions', get_template_directory_uri() . '/js/helpers-functions.js', array('tesseract-sidr'), '1.0.0', true); wp_enqueue_script('tesseract-helpers', get_template_directory_uri() . '/js/helpers.js', array('tesseract-helpers-functions'), '1.0.0', true); if (is_plugin_active('beaver-builder-lite-version/fl-builder.php') || is_plugin_active('beaver-builder/fl-builder.php')) { wp_enqueue_script('tesseract-helpers-beaver', get_template_directory_uri() . '/js/helpers-beaver.js', array('tesseract-helpers'), '1.0.0', true); } // Skip link fix wp_enqueue_script('tesseract-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '1.0.0', true); // Comments if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } // Register the script wp_register_script('tesseract_helpers', get_template_directory_uri() . '/js/helpers.js'); // Localize script (only few lines in helpers.js) // First things first: let's get a lighter version of the user-defined search input color applied in the mobile menu - tricky // See @ http://stackoverflow.com/questions/11091695/how-to-find-the-hex-code-for-a-lighter-or-darker-version-of-a-hex-code-in-php $watermarkColor = get_theme_mod('tesseract_mobmenu_search_color'); $col = array(hexdec(substr($watermarkColor, 1, 2)), hexdec(substr($watermarkColor, 3, 2)), hexdec(substr($watermarkColor, 5, 2))); $lighter = array(255 - (255 - $col[0]) * 0.8, 255 - (255 - $col[1]) * 0.8, 255 - (255 - $col[2]) * 0.8); $lighter = "#" . sprintf("%02X%02X%02X", $lighter[0], $lighter[1], $lighter[2]); wp_localize_script('tesseract_helpers', 'tesseract_vars', array('hpad' => get_theme_mod('tesseract_header_height'), 'fpad' => get_theme_mod('tesseract_footer_height'))); wp_enqueue_script('tesseract_helpers'); $header_bckRGB = get_theme_mod('tesseract_header_colors_bck_color') ? get_theme_mod('tesseract_header_colors_bck_color') : '#59bcd9'; $opValue = get_theme_mod('tesseract_header_colors_bck_color_opacity'); $header_bckOpacity = is_numeric($opValue) ? $opValue : 100; $hex = $header_bckRGB; $header_bckOpacity = $header_bckOpacity / 100; preg_match("/\\s*(rgba\\(\\s*[0-9]+\\s*,\\s*[0-9]+\\s*,\\s*[0-9]+\\s*,\\d+\\d*\\.\\d+\\))/", $hex, $match); $rgba = $match ? true : false; list($r, $g, $b) = sscanf($hex, "#%02x%02x%02x"); $header_bckColor = "rgb({$r}, {$g}, {$b})"; $header_bckColor_home = "rgba({$r}, {$g}, {$b}, {$header_bckOpacity})"; //HEADER and FOOTER $header_textColor = get_theme_mod('tesseract_header_colors_text_color') ? get_theme_mod('tesseract_header_colors_text_color') : '#ffffff'; $header_linkColor = get_theme_mod('tesseract_header_colors_link_color') ? get_theme_mod('tesseract_header_colors_link_color') : '#ffffff'; $header_linkHoverColor = get_theme_mod('tesseract_header_colors_link_hover_color') ? get_theme_mod('tesseract_header_colors_link_hover_color') : '#d1ecff'; $footer_bckColor = get_theme_mod('tesseract_footer_colors_bck_color') ? get_theme_mod('tesseract_footer_colors_bck_color') : '#1e73be'; $footer_textColor = get_theme_mod('tesseract_footer_colors_text_color') ? get_theme_mod('tesseract_footer_colors_text_color') : '#ffffff'; $footer_headingColor = get_theme_mod('tesseract_footer_colors_heading_color') ? get_theme_mod('tesseract_footer_colors_heading_color') : '#ffffff'; $footer_linkColor = get_theme_mod('tesseract_footer_colors_link_color') ? get_theme_mod('tesseract_footer_colors_link_color') : '#ffffff'; $footer_linkHoverColor = get_theme_mod('tesseract_footer_colors_link_hover_color') ? get_theme_mod('tesseract_footer_colors_link_hover_color') : '#d1ecff'; $add_content_borderColor_array = tesseract_hex2rgb($footer_linkColor); $add_content_borderColor = implode(', ', $add_content_borderColor_array); //MOBMENU $mobmenu_bckColor = get_theme_mod('tesseract_mobmenu_background_color') ? get_theme_mod('tesseract_mobmenu_background_color') : '#336ca6'; $mobmenu_linkColor = get_theme_mod('tesseract_mobmenu_link_color') ? get_theme_mod('tesseract_mobmenu_link_color') : '#fff'; $mobmenu_linkHoverColor = get_theme_mod('tesseract_mobmenu_link_hover_color') ? get_theme_mod('tesseract_mobmenu_link_hover_color') : '#fff'; list($lc_r, $lc_g, $lc_b) = sscanf($mobmenu_linkColor, "#%02x%02x%02x"); $mob_rgb_linkColor_submenu = "rgba({$lc_r}, {$lc_g}, {$lc_b}, 0.8)"; list($lhc_r, $lhc_g, $lhc_b) = sscanf($mobmenu_linkHoverColor, "#%02x%02x%02x"); $mob_rgb_linkHoverColor_submenu = "rgba({$lhc_r}, {$lhc_g}, {$lhc_b}, 0.8)"; $mobmenu_linkHoverBckColor_option = get_theme_mod('tesseract_mobmenu_link_hover_background_color') ? get_theme_mod('tesseract_mobmenu_link_hover_background_color') : 'dark'; $mobmenu_linkHoverBckColor_option_custom = get_theme_mod('tesseract_mobmenu_link_hover_background_color_custom'); switch ($mobmenu_linkHoverBckColor_option) { case 'custom': $mobmenu_linkHoverBckColor = $mobmenu_linkHoverBckColor_option_custom; break; case 'light': $mobmenu_linkHoverBckColor = 'rgba(255, 255, 255, 0.1)'; break; default: $mobmenu_linkHoverBckColor = 'rgba(0, 0, 0, 0.2)'; } $mobmenu_shadowColor_option = get_theme_mod('tesseract_mobmenu_shadow_color') ? get_theme_mod('tesseract_mobmenu_shadow_color') : 'dark'; $mobmenu_shadowColor_option_custom = get_theme_mod('tesseract_mobmenu_shadow_color_custom') ? get_theme_mod('tesseract_mobmenu_shadow_color_custom') : 'dark'; switch ($mobmenu_shadowColor_option) { case 'custom': list($shad_r, $shad_g, $shad_b) = sscanf($mobmenu_shadowColor_option_custom, "#%02x%02x%02x"); break; case 'light': $shad_r = 255; $shad_g = 255; $shad_b = 255; break; default: $shad_r = 0; $shad_g = 0; $shad_b = 0; } $mobmenu_searchColor = get_theme_mod('tesseract_mobmenu_search_color'); list($sc_r, $sc_g, $sc_b) = sscanf($mobmenu_searchColor, "#%02x%02x%02x"); $mobmenu_searchColorRgb = "rgba({$sc_r}, {$sc_g}, {$sc_b}, 0.6)"; $mobmenu_searchBckColor = get_theme_mod('tesseract_mobmenu_search_background_color'); $mobmenu_searchBckColor = $mobmenu_searchBckColor == 'dark' ? 'rgba(0, 0, 0, .15)' : 'rgba(255, 255, 255, 0.15)'; $mobmenu_socialBckColor = get_theme_mod('tesseract_mobmenu_social_background_color'); $mobmenu_socialBckColor = $mobmenu_socialBckColor == 'dark' ? 'rgba(0, 0, 0, .15)' : 'rgba(255, 255, 255, 0.15)'; $mobmenu_buttonsBckColor_option = get_theme_mod('tesseract_mobmenu_buttons_background_color') ? get_theme_mod('tesseract_mobmenu_buttons_background_color') : 'dark'; $mobmenu_buttonsBckColor_option_custom = get_theme_mod('tesseract_mobmenu_buttons_background_color_custom'); switch ($mobmenu_buttonsBckColor_option) { case 'custom': $mobmenu_buttonsBckColor = $mobmenu_buttonsBckColor_option_custom; break; case 'light': $mobmenu_buttonsBckColor = 'rgba(255, 255, 255, 0.1)'; break; default: $mobmenu_buttonsBckColor = 'rgba(0, 0, 0, 0.2)'; } $mobmenu_buttons_textColor = get_theme_mod('tesseract_mobmenu_buttons_text_color'); $mobmenu_buttons_linkColor = get_theme_mod('tesseract_mobmenu_buttons_link_color'); $mobmenu_buttons_linkHoverColor = get_theme_mod('tesseract_mobmenu_buttons_link_hover_color'); $mobmenu_buttons_maxbtnSepColor = get_theme_mod('tesseract_mobmenu_maxbtn_sep_color'); $mobmenu_buttons_maxbtnSepColor = $mobmenu_buttons_maxbtnSepColor == 'dark' ? 'inset 0 -1px rgba(0, 0, 0, .1)' : 'inset 0 -1px rgba(255, 255, 255, 0.1)'; $dynamic_styles_mobmenu = ".sidr {\n\t\tbackground-color: " . $mobmenu_bckColor . ";\n\t\t}\n\n\t.sidr .sidr-class-menu-item a,\n\t.sidr .sidr-class-menu-item span { color: " . $mobmenu_linkColor . "; }\n\n\n\t.sidr .sidr-class-menu-item ul li a,\n\t.sidr .sidr-class-menu-item ul li span {\n\t\tcolor: " . $mob_rgb_linkColor_submenu . ";\n\t}\n\n\t.sidr .sidr-class-menu-item a:hover,\n\t.sidr .sidr-class-menu-item span:hover,\n\t.sidr .sidr-class-menu-item:first-child a:hover,\n\t.sidr .sidr-class-menu-item:first-child span:hover { color: " . $mobmenu_linkHoverColor . "; }\n\n\t.sidr .sidr-class-menu-item ul li a:hover,\n\t.sidr .sidr-class-menu-item ul li span:hover,\n\t.sidr .sidr-class-menu-item ul li:first-child a:hover,\n\t.sidr .sidr-class-menu-item ul li:first-child span:hover { color: " . $mob_rgb_linkHoverColor_submenu . "; }\n\n\t.sidr ul li > a:hover,\n\t.sidr ul li > span:hover,\n\t.sidr > div > ul > li:first-child > a:hover,\n\t.sidr > div > ul > li:first-child > span:hover,\n\t.sidr ul li ul li:hover > a,\n\t.sidr ul li ul li:hover > span {\n\t\tbackground: " . $mobmenu_linkHoverBckColor . ";\n\n\t\t}\n\n\t/* Shadows and Separators */\n\n\t.sidr ul li > a,\n\t.sidr ul li > span,\n\t#sidr-id-header-button-container-inner > * {\n\t\t-webkit-box-shadow: inset 0 -1px rgba( " . $shad_r . " ," . $shad_g . " ," . $shad_b . " , 0.2);\n\t\t-moz-box-shadow: inset 0 -1px rgba( " . $shad_r . " ," . $shad_g . " ," . $shad_b . " , 0.2);\n\t\tbox-shadow: inset 0 -1px rgba( " . $shad_r . " ," . $shad_g . " ," . $shad_b . " , 0.2);\n\t}\n\n\t.sidr > div > ul > li:last-of-type > a,\n\t.sidr > div > ul > li:last-of-type > span,\n\t#sidr-id-header-button-container-inner > *:last-of-type {\n\t\tbox-shadow: none;\n\t\t}\n\n\t.sidr ul.sidr-class-hr-social li a,\n\t.sidr ul.sidr-class-hr-social li a:first-child {\n\t\t-webkit-box-shadow: 0 1px 0 0px rgba( " . $shad_r . " ," . $shad_g . " ," . $shad_b . ", .25);\n\t\t-moz-box-shadow: 0 1px 0 0px rgba( " . $shad_r . " ," . $shad_g . " ," . $shad_b . ", .25);\n\t\tbox-shadow: 0 1px 0 0px rgba( " . $shad_r . " ," . $shad_g . " ," . $shad_b . ", .25);\n\t}\n\n\t/* Header Right side content */\n\n\t.sidr-class-search-field,\n\t.sidr-class-search-form input[type='search'] {\n\t\tbackground: " . $mobmenu_searchBckColor . ";\n\t\tcolor: " . $mobmenu_searchColor . ";\n\t}\n\n\t.sidr-class-hr-social {\n\t\tbackground: " . $mobmenu_socialBckColor . ";\n\t}\n\n\t#sidr-id-header-button-container-inner,\n\t#sidr-id-header-button-container-inner > h1,\n\t#sidr-id-header-button-container-inner > h2,\n\t#sidr-id-header-button-container-inner > h3,\n\t#sidr-id-header-button-container-inner > h4,\n\t#sidr-id-header-button-container-inner > h5,\n\t#sidr-id-header-button-container-inner > h6 {\n\t\tbackground: " . $mobmenu_buttonsBckColor . ";\n\t\tcolor: " . $mobmenu_buttons_textColor . ";\n\t}\n\n\t#sidr-id-header-button-container-inner a,\n\t#sidr-id-header-button-container-inner button {\n\t\tcolor: " . $mobmenu_buttons_linkColor . ";\n\t}\n\n\t#sidr-id-header-button-container-inner a:hover,\n\t#sidr-id-header-button-container-inner button:hover {\n\t\tcolor: " . $mobmenu_buttons_linkHoverColor . ";\n\t}\n\n\t.sidr ul li > a,\n\t.sidr ul li > span,\n\t#sidr-id-header-button-container-inner > *,\n\t#sidr-id-header-button-container-inner button {\n\t\t-webkit-box-shadow: " . $mobmenu_buttons_maxbtnSepColor . ";\n\t\t-moz-box-shadow: " . $mobmenu_buttons_maxbtnSepColor . ";\n\t\tbox-shadow: " . $mobmenu_buttons_maxbtnSepColor . ";\n\t}\n\n\t"; wp_add_inline_style('tesseract-sidr-style', $dynamic_styles_mobmenu); // HEADER & HEADER LOGO HEIGHT, HEADER WIDTH PROPS $header_logoHeight = get_theme_mod('tesseract_header_logo_height') ? get_theme_mod('tesseract_header_logo_height') : 40; $headerHeightInit = get_theme_mod('tesseract_header_height'); $headerHeight = is_numeric($headerHeightInit) ? $headerHeightInit : 10; $headerWidthProp = is_integer(get_theme_mod('tesseract_header_blocks_width_prop')) ? get_theme_mod('tesseract_header_blocks_width_prop') : 60; $dynamic_styles_header = ".site-header,\n\t.main-navigation ul ul a,\n\t#header-right-menu ul ul a,\n\t.site-header .cart-content-details { background-color: " . $header_bckColor . "; }\n\t.site-header .cart-content-details:after { border-bottom-color: " . $header_bckColor . "; }\n\n\t.home .site-header,\n\t.home .main-navigation ul ul a,\n\t.home #header-right ul ul a,\n\t.home .site-header .cart-content-details { background-color: " . $header_bckColor_home . "; }\n\t.home .site-header .cart-content-details:after { border-bottom-color: " . $header_bckColor_home . "; }\n\n\t.site-header,\n\t.site-header h1,\n\t.site-header h2,\n\t.site-header h3,\n\t.site-header h4,\n\t.site-header h5,\n\t.site-header h6 { color: " . $header_textColor . "!important; }\n\n\t#masthead .search-field { color: " . $header_textColor . "; }\n\t#masthead .search-field.watermark { color: #ccc; }\n\n\t.site-header a,\n\t.main-navigation ul ul a,\n\t#header-right-menu ul ul a,\n\t.menu-open,\n\t.dashicons.menu-open,\n\t.menu-close,\n\t.dashicons.menu-close { color: " . $header_linkColor . "; }\n\n\t.site-header a:hover,\n\t.main-navigation ul ul a:hover,\n\t#header-right-menu ul ul a:hover,\n\t.menu-open:hover,\n\t.dashicons.menu-open:hover,\n\t.menu-close:hover,\n\t.dashicons.menu-open:hover { color: " . $header_linkHoverColor . "; }\n\n\t/* Header logo height */\n\n\t#site-banner .site-logo img {\n\t\theight: " . $header_logoHeight . "px;\n\t\t}\n\n\t#masthead {\n\t\tpadding-top: " . $headerHeight . "px;\n\t\tpadding-bottom: " . $headerHeight . "px;\n\t\t}\n\n\t/* Header width props */\n\n\t#site-banner-left {\n\t\twidth: " . $headerWidthProp . "%;\n\t\t}\n\n\t#site-banner-right {\n\t\twidth: " . (100 - $headerWidthProp) . "%;\n\t\t}\n\n\t"; $hcContent = get_theme_mod('tesseract_header_right_content'); $wooCart = get_theme_mod('tesseract_woocommerce_headercart'); $displayWooCart = is_plugin_active('woocommerce/woocommerce.php') && $wooCart == 1; $hcContent = !$displayWooCart && $hcContent == 'nothing'; if (true == $hcContent) { $dynamic_styles_header .= "#site-banner-left {\n\t\t\t\twidth: 100%;\n\t\t\t}\n\n\t\t\t#site-banner-right {\n\t\t\t\tdisplay: none;\n\t\t\t\tpadding: 0;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t"; } //Horizontal - fullwidth header if (get_theme_mod('tesseract_header_width') == 'fullwidth') { $dynamic_styles_header .= "#site-banner {\n\t\t\tmax-width: 100%;\n\t\t\tpadding-left: 0;\n\t\t\tpadding-right: 0;\n\t\t}\n\n\t\t"; } wp_add_inline_style('tesseract-site-banner', $dynamic_styles_header); // FOOTER & FOOTER LOGO HEIGHT, FOOTER WIDTH PROPS $footerWidthProp = get_theme_mod('tesseract_footer_blocks_width_prop') ? get_theme_mod('tesseract_footer_blocks_width_prop') : 60; $footer_logoHeight = get_theme_mod('tesseract_footer_logo_height') ? get_theme_mod('tesseract_footer_logo_height') : 40; $footerHeightInit = get_theme_mod('tesseract_footer_height'); $footerHeight = is_numeric($footerHeightInit) ? $footerHeightInit : 10; $dynamic_styles_footer = "#colophon {\n\t\tbackground-color: " . $footer_bckColor . ";\n\t\tcolor: " . $footer_textColor . "\n\t}\n\n\t#colophon .search-field { color: " . $footer_textColor . "; }\n\t#colophon .search-field.watermark { color: #ccc; }\n\n\t#colophon h1,\n\t#colophon h2,\n\t#colophon h3,\n\t#colophon h4,\n\t#colophon h5,\n\t#colophon h6 { color: " . $footer_headingColor . "; }\n\n\t#colophon a { color: " . $footer_linkColor . "; }\n\n\t#colophon a:hover { color: " . $footer_linkHoverColor . "; }\n\n\t#horizontal-menu-before,\n\t#horizontal-menu-after { border-color: rgba(" . $add_content_borderColor . ", 0.25); }\n\n\t#footer-banner.footbar-active { border-color: rgba(" . $add_content_borderColor . ", 0.15); }\n\n\t#footer-banner .site-logo img { height: " . $footer_logoHeight . "px; }\n\n\t#colophon {\n\t\tpadding-top: " . $footerHeight . "px;\n\t\tpadding-bottom: " . $footerHeight . "px;\n\t\t}\n\n\t#horizontal-menu-wrap {\n\t\twidth: " . $footerWidthProp . "%;\n\t\t}\n\n\t#footer-banner-right\t{\n\t\twidth: " . (100 - intval($footerWidthProp)) . "%;\n\t\t}\n\n\t"; //Horizontal - fullwidth footer if (get_theme_mod('tesseract_footer_width') == 'fullwidth') { $dynamic_styles_footer .= "#footer-banner {\n\t\t\tmax-width: 100%;\n\t\t\tpadding: 0 20px;\n\t\t}"; } wp_add_inline_style('tesseract-footer-banner', $dynamic_styles_footer); }
/** * Enqueue scripts and styles. */ function tesseract_scripts() { // Localize script (only few lines in helpers.js) wp_localize_script('tesseract-helpers', 'tesseract-vars', array('author' => __('Your Name', 'tesseract'), 'email' => __('E-mail', 'tesseract'), 'url' => __('Website', 'tesseract'), 'comment' => __('Your Comment', 'tesseract'))); // Enqueue default style wp_enqueue_style('tesseract-style', get_stylesheet_uri(), array(), '1.0.0'); // Google fonts wp_enqueue_style('tesseract-fonts', tesseract_fonts_url(), array(), '1.0.0'); // Social icons style wp_enqueue_style('tesseract-icons', get_template_directory_uri() . '/css/typicons.css', array(), '1.0.0'); // Horizontal menu style wp_enqueue_style('tesseract-site-banner', get_template_directory_uri() . '/css/site-banner.css', array('tesseract-style'), '1.0.0'); wp_enqueue_style('tesseract-footer-banner', get_template_directory_uri() . '/css/footer-banner.css', array('tesseract-style'), '1.0.0'); wp_enqueue_style('dashicons'); // Fittext wp_enqueue_script('tesseract-fittext', get_template_directory_uri() . '/js/jquery.fittext.js', array('jquery'), '1.0.0', true); // JS helpers (This is also the place where we call the jQuery in array) wp_enqueue_script('tesseract-helpers', get_template_directory_uri() . '/js/helpers.js', array('jquery', 'tesseract-fittext'), '1.0.0', true); // Skip link fix wp_enqueue_script('tesseract-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '1.0.0', true); // Comments if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } $header_bckRGB = get_theme_mod('tesseract_tho_header_colors_bck_color') ? get_theme_mod('tesseract_tho_header_colors_bck_color') : '#59bcd9'; $header_bckOpacity = get_theme_mod('tesseract_tho_header_colors_bck_color_opacity') ? get_theme_mod('tesseract_tho_header_colors_bck_color_opacity') : 100; $header_textColor = get_theme_mod('tesseract_tho_header_colors_text_color') ? get_theme_mod('tesseract_tho_header_colors_text_color') : '#ffffff'; $header_linkColor = get_theme_mod('tesseract_tho_header_colors_link_color') ? get_theme_mod('tesseract_tho_header_colors_link_color') : '#ffffff'; $header_linkHoverColor = get_theme_mod('tesseract_tho_header_colors_link_hover_color') ? get_theme_mod('tesseract_tho_header_colors_link_hover_color') : '#d1ecff'; $footer_bckColor = get_theme_mod('tesseract_tfo_footer_colors_bck_color') ? get_theme_mod('tesseract_tfo_footer_colors_bck_color') : '#1e73be'; $footer_textColor = get_theme_mod('tesseract_tfo_footer_colors_text_color') ? get_theme_mod('tesseract_tfo_footer_colors_text_color') : '#ffffff'; $footer_headingColor = get_theme_mod('tesseract_tfo_footer_colors_heading_color') ? get_theme_mod('tesseract_tfo_footer_colors_heading_color') : '#ffffff'; $footer_linkColor = get_theme_mod('tesseract_tfo_footer_colors_link_color') ? get_theme_mod('tesseract_tfo_footer_colors_link_color') : '#ffffff'; $footer_linkHoverColor = get_theme_mod('tesseract_tfo_footer_colors_link_hover_color') ? get_theme_mod('tesseract_tfo_footer_colors_link_hover_color') : '#d1ecff'; $hex = $header_bckRGB; $header_bckOpacity = $header_bckOpacity / 100; preg_match("/\\s*(rgba\\(\\s*[0-9]+\\s*,\\s*[0-9]+\\s*,\\s*[0-9]+\\s*,\\d+\\d*\\.\\d+\\))/", $hex, $match); $rgba = $match ? true : false; list($r, $g, $b) = sscanf($hex, "#%02x%02x%02x"); $header_bckColor = "rgb({$r}, {$g}, {$b})"; $header_bckColor_home = "rgba({$r}, {$g}, {$b}, {$header_bckOpacity})"; $add_content_borderColor_array = tesseract_hex2rgb($footer_linkColor); $add_content_borderColor = implode(', ', $add_content_borderColor_array); $dynamic_styles_header = ".site-header,\r\n\t.main-navigation ul ul a { background-color: " . $header_bckColor . "; }\r\n\t\r\n\t.home .site-header,\r\n\t.home .main-navigation ul ul a { background-color: " . $header_bckColor_home . "; }\r\n\t\r\n\t.site-header,\r\n\t.site-header h1, \r\n\t.site-header h2,\r\n\t.site-header h3,\r\n\t.site-header h4,\r\n\t.site-header h5,\r\n\t.site-header h6 { color: " . $header_textColor . "; }\r\n\t\r\n\t.site-header a,\r\n\t.main-navigation ul ul a,\r\n\t.menu-open,\r\n\t.dashicons.menu-open,\r\n\t.menu-close,\r\n\t.dashicons.menu-close { color: " . $header_linkColor . "; }\r\n\t\r\n\t.site-header a:hover,\r\n\t.main-navigation ul ul a:hover,\r\n\t.menu-open:hover,\r\n\t.dashicons.menu-open:hover,\r\n\t.menu-close:hover,\r\n\t.dashicons.menu-open:hover { color: " . $header_linkHoverColor . "; }"; wp_add_inline_style('tesseract-site-banner', $dynamic_styles_header); $dynamic_styles_footer = "#colophon { \r\n\t\tbackground-color: " . $footer_bckColor . ";\r\n\t\tcolor: " . $footer_textColor . " \r\n\t}\r\n\t#colophon h1, \r\n\t#colophon h2,\r\n\t#colophon h3,\r\n\t#colophon h4,\r\n\t#colophon h5,\r\n\t#colophon h6 { color: " . $footer_headingColor . "; }\r\n\t\r\n\t#colophon a { color: " . $footer_linkColor . "; }\r\n\t\r\n\t#colophon a:hover { color: " . $footer_linkHoverColor . "; }\t\r\n\t\r\n\t#horizontal-menu-before,\r\n\t#horizontal-menu-after { border-color: rgba(" . $add_content_borderColor . ", 0.25); }\r\n\t\r\n\t#footer-banner.footbar-active { border-color: rgba(" . $add_content_borderColor . ", 0.15); };"; wp_add_inline_style('tesseract-footer-banner', $dynamic_styles_footer); }