File: /home/defaultwebsite/public/wp-content/themes/webgatha/includes/dynamic-css.php
<?php
/**
* Generate Dynamic Css property base on theme setting.
*
* @package WebGatha
* @since 1.0.0
*/
add_action( 'wp_enqueue_scripts', 'webgatha_dynamic_css', 50 );
/**
* WebGatha dynamic css functions.
*
* @since 1.0.0
*
* @return void
*/
function webgatha_dynamic_css() {
global $webgatha_dynamic_css, $webgatha_options;
$webgatha_dynamic_css = array();
/**
* Hook: webgatha_dynamic_css_init.
*
* @visible false
* @ignore
*/
do_action( 'webgatha_dynamic_css_init', $webgatha_options );
get_template_part( 'includes/dynamic-css-helper' );
/**
* Fires before webgatha_dynamic_css action hook.
*
* @visible false
* @ignore
*/
do_action( 'webgatha_before_dynamic_css', $webgatha_options );
/**
* Hook: webgatha_dynamic_css
*
* @Functions hooked in to webgatha_dynamic_css action hook.
* @hooked webgatha_site_layout_css - 10
* @hooked webgatha_logo_css - 20
* @hooked webgatha_menu_font_css - 30
* @hooked webgatha_topbar_css - 40
* @hooked webgatha_preloader_css - 50
* @hooked webgatha_header_main_css - 60
* @hooked webgatha_page_header_css - 70
* @hooked webgatha_content_css - 80
* @hooked webgatha_footer_css - 90
*
* @param array $webgatha_options Contains webgatha options data.
*
* @visible false
* @ignore
*/
do_action( 'webgatha_dynamic_css', $webgatha_options );
/**
* Fires after webgatha_dynamic_css action hook.
*
* @visible false
* @ignore
*/
do_action( 'webgatha_after_dynamic_css', $webgatha_options );
$parsed_css = webgatha_generate_css_properties( $webgatha_dynamic_css );
if ( function_exists( 'webgathacore_custom_fonts_css' ) ) {
$parsed_css .= webgathacore_custom_fonts_css();
}
if ( ! empty( $parsed_css ) ) {
wp_add_inline_style( 'webgatha-main-style', $parsed_css );
}
}
if ( ! function_exists( 'webgatha_dynamic_css_page_id' ) ) {
/**
* Dynamic css page id.
*
* @since 1.0.0
*
* @return int
*/
function webgatha_dynamic_css_page_id() {
global $post;
$post_id = 0;
if ( $post ) {
$post_id = $post->ID;
}
if ( is_404() ) {
$post_id = 0;
} elseif ( is_search() ) {
$post_id = 0;
}
if ( function_exists( 'is_shop' ) && is_shop() ) {
$post_id = get_option( 'woocommerce_shop_page_id' );
}
if ( is_home() && ! is_front_page() ) {
$page_for_posts = get_option( 'page_for_posts' );
if ( $page_for_posts ) {
$post_id = $page_for_posts;
}
}
return $post_id;
}
}
add_action( 'webgatha_dynamic_css', 'webgatha_site_layout_css', 10 );
add_action( 'webgatha_dynamic_css', 'webgatha_logo_css', 20 );
add_action( 'webgatha_dynamic_css', 'webgatha_menu_font_css', 30 );
add_action( 'webgatha_dynamic_css', 'webgatha_topbar_css', 40 );
add_action( 'webgatha_dynamic_css', 'webgatha_preloader_css', 50 );
add_action( 'webgatha_dynamic_css', 'webgatha_header_main_css', 60 );
add_action( 'webgatha_dynamic_css', 'webgatha_page_header_css', 70 );
add_action( 'webgatha_dynamic_css', 'webgatha_content_css', 80 );
add_action( 'webgatha_dynamic_css', 'webgatha_footer_css', 90 );
if ( ! function_exists( 'webgatha_site_layout_css' ) ) {
/**
* Function for site layout CSS settings
*
* @since 1.0.0
*
* @param array $webgatha_options theme options.
* @return void
*/
function webgatha_site_layout_css( $webgatha_options ) {
global $webgatha_dynamic_css;
// Site Layout CSS.
$site_layout = webgatha_site_layout();
if ( ! isset( $webgatha_options['body_background'] ) ) {
$webgatha_options['body_background'] = 'image';
}
$fixed_width = '1300';
$container_width = '1300';
$auto_padding = ( $fixed_width - $container_width ) / 2;
$auto_margin = ( $auto_padding ) + 15;
$body_background = array();
if ( ( isset( $webgatha_options['body_background_image'] ) && ! empty( $webgatha_options['body_background_image'] ) ) && ( isset( $webgatha_options['body_background'] ) && 'image' === $webgatha_options['body_background'] ) ) {
$body_background = $webgatha_options['body_background_image'];
} else {
$body_background['background-color'] = ( isset( $webgatha_options['body_background_color'] ) ) ? $webgatha_options['body_background_color'] : '#ffffff';
}
// Site layout body background option.
if ( 'fullwidth' !== $site_layout && ! empty( $body_background ) ) {
$body_background_params = array(
'background-color',
'background-repeat',
'background-size',
'background-attachment',
'background-position',
'background-image',
);
$body_background_css = array();
foreach ( $body_background_params as $body_background_param ) {
if ( isset( $body_background[ $body_background_param ] ) && ! empty( $body_background[ $body_background_param ] ) ) {
if ( 'background-image' === $body_background_param ) {
$body_background_css[ $body_background_param ] = 'url(\'' . $body_background[ $body_background_param ] . '\')';
} else {
$body_background_css[ $body_background_param ] = $body_background[ $body_background_param ];
}
}
}
$webgatha_dynamic_css['body_background_css'] = $body_background_css;
/**
* Filters body background css.
*
* @param string $body_background_css Body backgroud CSS.
*
* @visible false
* @ignore
*/
$body_background_css = apply_filters( 'webgatha_body_background_css', $body_background_css, $webgatha_options );
if ( ! empty( $body_background_css ) ) {
$webgatha_dynamic_css['body'] = $body_background_css;
}
}
$webgatha_dynamic_css['.webgatha-site-layout-boxed #page,.webgatha-site-layout-framed #page,.webgatha-site-layout-rounded #page']['max-width'] = "{$fixed_width}px";
if ( 'fullwidth' !== $site_layout ) {
$webgatha_dynamic_css['.webgatha-site-layout-boxed #page,.webgatha-site-layout-framed #page,.webgatha-site-layout-rounded #page']['margin-left'] = 'auto';
$webgatha_dynamic_css['.webgatha-site-layout-boxed #page,.webgatha-site-layout-framed #page,.webgatha-site-layout-rounded #page']['margin-right'] = 'auto';
// Default Headers.
$webgatha_dynamic_css[ '.webgatha-site-layout-' . $site_layout . ' header .fixed-top' ]['max-width'] = "{$fixed_width}px";
$webgatha_dynamic_css[ '.webgatha-site-layout-' . $site_layout . ' header .fixed-top' ]['margin-left'] = 'auto';
$webgatha_dynamic_css[ '.webgatha-site-layout-' . $site_layout . ' header .fixed-top' ]['margin-right'] = 'auto';
// Header Builder.
$webgatha_dynamic_css[ '.webgatha-site-layout-' . $site_layout . ' .header-main-wrapper.whb-header-sticky' ]['max-width'] = "{$fixed_width}px";
$webgatha_dynamic_css[ '.webgatha-site-layout-' . $site_layout . ' .header-main-wrapper.whb-header-sticky' ]['margin-left'] = 'auto';
$webgatha_dynamic_css[ '.webgatha-site-layout-' . $site_layout . ' .header-main-wrapper.whb-header-sticky' ]['margin-right'] = 'auto';
// Header Builder.
$webgatha_dynamic_css[ '.webgatha-site-layout-' . $site_layout . ' .webgatha_menu_nav-sublist-dropdown' ]['max-width'] = "{$fixed_width}px";
$webgatha_dynamic_css[ '.webgatha-site-layout-' . $site_layout . ' .webgatha_menu_nav-sublist-dropdown' ]['margin-left'] = 'auto';
$webgatha_dynamic_css[ '.webgatha-site-layout-' . $site_layout . ' .webgatha_menu_nav-sublist-dropdown' ]['margin-right'] = 'auto';
$webgatha_dynamic_css[ '.webgatha-site-layout-' . $site_layout . ' .webgatha-menu-html-block' ]['max-width'] = "{$fixed_width}px";
$webgatha_dynamic_css[ '.webgatha-site-layout-' . $site_layout . ' .webgatha-menu-html-block' ]['margin-left'] = 'auto';
$webgatha_dynamic_css[ '.webgatha-site-layout-' . $site_layout . ' .webgatha-menu-html-block' ]['margin-right'] = 'auto';
}
$webgatha_dynamic_css['.webgatha-site-layout-boxed .vc_row[data-vc-full-width="true"]:not([data-vc-stretch-content="true"])']['padding-right'] = "{$auto_padding}px !important";
$webgatha_dynamic_css['.webgatha-site-layout-boxed .vc_row[data-vc-full-width="true"]:not([data-vc-stretch-content="true"])']['padding-left'] = "{$auto_padding}px !important";
$webgatha_dynamic_css['.webgatha-site-layout-boxed .vc_row[data-vc-full-width="true"]']['margin-left'] = "-{$auto_margin}px !important";
$webgatha_dynamic_css['.webgatha-site-layout-boxed .vc_row[data-vc-full-width="true"]']['margin-right'] = "-{$auto_margin}px !important";
}
}
/**
* WebGatha Header logo CSS
*
* @since 1.0.0
*
* @param array $webgatha_options theme options.
* @return void
*/
function webgatha_logo_css( $webgatha_options ) {
global $webgatha_dynamic_css;
// Logo type "Text" font and color setttings.
if ( isset( $webgatha_options['logo_type'] ) && 'text' === $webgatha_options['logo_type'] ) {
$logo_text_typo_attrs = array(
'font-family',
'font-options',
'font-weight',
'font-style',
'font-size',
'color',
);
if ( isset( $webgatha_options['logo_font'] ) && ! empty( $webgatha_options['logo_font'] ) ) {
foreach ( $logo_text_typo_attrs as $logo_text_typo_attr ) {
if ( isset( $webgatha_options['logo_font'][ $logo_text_typo_attr ] ) && ! empty( $webgatha_options['logo_font'][ $logo_text_typo_attr ] ) ) {
$webgatha_dynamic_css['.site-title .logo-text'][ $logo_text_typo_attr ] = $webgatha_options['logo_font'][ $logo_text_typo_attr ];
}
}
}
/* Mobile Site Logo text settings*/
if ( ! empty( $webgatha_options['logo_font'] ) && $webgatha_options['logo_font']['font-family'] ) {
$webgatha_dynamic_css['.device-type-mobile .site-title .logo-text']['font-family'] = $webgatha_options['logo_font']['font-family'];
}
if ( ! empty( $webgatha_options['mobile_logo_font'] ) && $webgatha_options['mobile_logo_font']['font-size'] ) {
$webgatha_dynamic_css['.device-type-mobile .site-title .logo-text']['font-size'] = $webgatha_options['mobile_logo_font']['font-size'];
}
if ( ! empty( $webgatha_options['mobile_logo_font'] ) && $webgatha_options['mobile_logo_font']['color'] ) {
$webgatha_dynamic_css['.device-type-mobile .site-title .logo-text']['color'] = $webgatha_options['mobile_logo_font']['color'];
}
/* Sticky Site Logo text settings*/
if ( ! empty( $webgatha_options['logo_font'] ) && $webgatha_options['logo_font']['font-family'] ) {
$webgatha_dynamic_css['.fixed-top .site-title .logo-text']['font-family'] = $webgatha_options['logo_font']['font-family'];
$webgatha_dynamic_css['.sticky-site-title .logo-text']['font-family'] = $webgatha_options['logo_font']['font-family'];
}
if ( ! empty( $webgatha_options['sticky_logo_font'] ) && $webgatha_options['sticky_logo_font']['font-size'] ) {
$webgatha_dynamic_css['.fixed-top .site-title .logo-text']['font-size'] = $webgatha_options['sticky_logo_font']['font-size'];
$webgatha_dynamic_css['.sticky-site-title .logo-text']['font-size'] = $webgatha_options['sticky_logo_font']['font-size'];
}
if ( ! empty( $webgatha_options['sticky_logo_font'] ) && $webgatha_options['sticky_logo_font']['color'] ) {
$webgatha_dynamic_css['.fixed-top .site-title .logo-text']['color'] = $webgatha_options['sticky_logo_font']['color'];
$webgatha_dynamic_css['.sticky-site-title .logo-text']['color'] = $webgatha_options['sticky_logo_font']['color'];
}
}
/*End Site logo font settings */
/* Site Logo Height*/
if ( isset( $webgatha_options['site-logo-max-height'] ) && ! empty( $webgatha_options['site-logo-max-height'] ) ) {
$site_logo_dimension = webgatha_parse_redux_dimension( $webgatha_options['site-logo-max-height'], 'px' );
if ( $site_logo_dimension ) {
if ( isset( $site_logo_dimension['height'] ) ) {
$webgatha_dynamic_css['.site-header .site-title img']['max-height'] = $site_logo_dimension['height'];
}
}
}
/* Site Mobile Logo Height*/
if ( isset( $webgatha_options['mobile-logo-max-height'] ) && ! empty( $webgatha_options['mobile-logo-max-height'] ) ) {
$mobile_logo_dimension = webgatha_parse_redux_dimension( $webgatha_options['mobile-logo-max-height'], 'px' );
if ( $mobile_logo_dimension ) {
if ( isset( $mobile_logo_dimension['height'] ) ) {
$webgatha_dynamic_css['.device-type-mobile .site-header .site-title img']['max-height'] = $mobile_logo_dimension['height'];
}
}
}
/* Sticky Logo height */
if ( isset( $webgatha_options['sticky-logo-max-height'] ) && ! empty( $webgatha_options['sticky-logo-max-height'] ) ) {
$sticky_logo_dimension = webgatha_parse_redux_dimension( $webgatha_options['sticky-logo-max-height'], 'px' );
if ( $sticky_logo_dimension ) {
if ( isset( $sticky_logo_dimension['height'] ) ) {
$webgatha_dynamic_css['.site-header .sticky-site-title img']['max-height'] = $sticky_logo_dimension['height'];
}
}
}
}
if ( ! function_exists( 'webgatha_preloader_css' ) ) {
/**
* Preloader dynamic css
*
* @since 1.0.0
*
* @param array $webgatha_options theme options.
* @return void
*/
function webgatha_preloader_css( $webgatha_options ) {
global $webgatha_dynamic_css;
if ( isset( $webgatha_options['preloader_background_color'] ) && ! empty( $webgatha_options['preloader_background_color'] ) ) {
$webgatha_dynamic_css['#preloader']['background-color'] = $webgatha_options['preloader_background_color'];
}
}
}
if ( ! function_exists( 'webgatha_menu_font_css' ) ) {
/**
* Preloader dynamic css
*
* @since 1.0.0
*
* @param array $webgatha_options theme options.
* @return void
*/
function webgatha_menu_font_css( $webgatha_options ) {
global $webgatha_dynamic_css;
if ( isset( $webgatha_options['menu_font_style_enable'] ) && 'custom' === $webgatha_options['menu_font_style_enable'] ) {
$menu_text_typo_attrs = array(
'font-family',
'font-weight',
'letter-spacing',
'line-height',
'font-style',
'font-size',
);
if ( isset( $webgatha_options['menu_fonts'] ) && ! empty( $webgatha_options['menu_fonts'] ) ) {
foreach ( $menu_text_typo_attrs as $menu_text_typo_attr ) {
if ( isset( $webgatha_options['menu_fonts'][ $menu_text_typo_attr ] ) && ! empty( $webgatha_options['menu_fonts'][ $menu_text_typo_attr ] ) ) {
$webgatha_dynamic_css['.site-header .main-navigation .primary-menu > li > a, .site-header #site-navigation-mobile .mobile-menu > li > a'][ $menu_text_typo_attr ] = $webgatha_options['menu_fonts'][ $menu_text_typo_attr ];
}
}
}
if ( isset( $webgatha_options['sub_menu_fonts'] ) && ! empty( $webgatha_options['sub_menu_fonts'] ) ) {
if ( isset( $webgatha_options['menu_fonts']['font-family'] ) && ! empty( $webgatha_options['menu_fonts']['font-family'] ) ) {
$webgatha_dynamic_css['.site-header .main-navigation .primary-menu > li .sub-menu li a, .site-header #site-navigation-mobile .mobile-menu > li .sub-menu li a']['font-family'] = $webgatha_options['menu_fonts']['font-family'];
}
foreach ( $menu_text_typo_attrs as $menu_text_typo_attr ) {
if ( isset( $webgatha_options['sub_menu_fonts'][ $menu_text_typo_attr ] ) && ! empty( $webgatha_options['sub_menu_fonts'][ $menu_text_typo_attr ] ) ) {
$webgatha_dynamic_css['.site-header .main-navigation .primary-menu > li .sub-menu li a, .site-header #site-navigation-mobile .mobile-menu > li .sub-menu li a'][ $menu_text_typo_attr ] = $webgatha_options['sub_menu_fonts'][ $menu_text_typo_attr ];
}
}
}
}
}
}
if ( ! function_exists( 'webgatha_topbar_css' ) ) {
/**
* Topbar css
*
* @since 1.0.0
*
* @param array $webgatha_options theme options.
* @return void
*/
function webgatha_topbar_css( $webgatha_options ) {
global $webgatha_dynamic_css;
$topbar_bg_type = isset( $webgatha_options['topbar_bg_type'] ) && ! empty( $webgatha_options['topbar_bg_type'] ) ? $webgatha_options['topbar_bg_type'] : 'default';
if ( 'default' !== $topbar_bg_type ) {
if ( 'custom' === $topbar_bg_type ) {
$topbar_bg_color = isset( $webgatha_options['topbar_bg_color'] ) && ! empty( $webgatha_options['topbar_bg_color'] ) ? $webgatha_options['topbar_bg_color'] : array( 'rgba' => '#ffffff' );
$webgatha_dynamic_css['.site-header .topbar']['background-color'] = $topbar_bg_color['rgba'];
}
$topbar_text_color = isset( $webgatha_options['topbar_text_color'] ) && ! empty( $webgatha_options['topbar_text_color'] ) ? $webgatha_options['topbar_text_color'] : '#323232';
$webgatha_dynamic_css['.site-header .topbar ul li i']['color'] = $topbar_text_color;
$webgatha_dynamic_css['.site-header .topbarclass']['border-top-color'] = $topbar_text_color;
$webgatha_dynamic_css['.site-header .topbarclass']['border-bottom-color'] = $topbar_text_color;
$topbar_link_color = isset( $webgatha_options['topbar_link_color'] ) && ! empty( $webgatha_options['topbar_link_color'] ) ? $webgatha_options['topbar_link_color'] : array(
'regular' => '#323232',
'hover' => '#04d39f',
);
if ( isset( $topbar_link_color['regular'] ) && ! empty( $topbar_link_color['regular'] ) ) {
$webgatha_dynamic_css['
.site-header .topbar ul li a,
.site-header .topbar-social_profiles-wrapper ul li i,
.site-header .topbar .woocommerce-currency-switcher-form select,
.site-header.header-above-content .topbar ul li a']['color'] = $topbar_link_color['regular'];
}
if ( isset( $topbar_link_color['hover'] ) && ! empty( $topbar_link_color['hover'] ) ) {
$webgatha_dynamic_css['
.site-header .topbar ul li a:hover,
.site-header .topbar-social_profiles-wrapper ul li a:hover i,
.site-header.header-above-content .woocommerce-currency-switcher-form select:hover,
.site-header.header-above-content .topbar ul li a:hover']['color'] = $topbar_link_color['hover'];
}
}
}
}
if ( ! function_exists( 'webgatha_header_main_css' ) ) {
/**
* Main header css.
*
* @since 1.0.0
*
* @param array $webgatha_options theme options.
* @return void
*/
function webgatha_header_main_css( $webgatha_options ) {
global $webgatha_dynamic_css;
$header_main_bg_type = isset( $webgatha_options['header_main_bg_type'] ) && 'default' === $webgatha_options['header_type_select'] && ! empty( $webgatha_options['header_main_bg_type'] ) ? $webgatha_options['header_main_bg_type'] : 'default';
if ( 'default' !== $header_main_bg_type ) {
if ( 'custom' === $header_main_bg_type ) {
// Background Color.
$header_main_bg_color = isset( $webgatha_options['header_main_bg_color'] ) && ! empty( $webgatha_options['header_main_bg_color'] ) ? $webgatha_options['header_main_bg_color'] : array( 'rgba' => '#FFFFFF' );
if ( isset( $header_main_bg_color['rgba'] ) && $header_main_bg_color['rgba'] ) {
$webgatha_dynamic_css['
.header-main-wrapper,
.site-header.header-above-content .header-main-wrapper']['background-color'] = $header_main_bg_color['rgba'];
$webgatha_dynamic_css['.add-class-for-header-main-bg']['color'] = $header_main_bg_color['rgba'];
$webgatha_dynamic_css['.header-main-wrapper']['background-color'] = $header_main_bg_color['rgba'];
}
}
// Text Color.
$header_main_text_color = isset( $webgatha_options['header_main_text_color'] ) && ! empty( $webgatha_options['header_main_text_color'] ) ? $webgatha_options['header_main_text_color'] : '#323232';
$webgatha_dynamic_css['
.header-main-wrapper,
.woo-tools .woo-tools-actions li.woo-tools-action > a .cart-count,
.woo-tools .woo-tools-actions li.woo-tools-action > a .webgatha-wishlist-count']['color'] = $header_main_text_color;
$webgatha_dynamic_css['.add-class-for-header-main-bg']['background-color'] = $header_main_text_color;
// Link Color.
$header_main_link_color = isset( $webgatha_options['header_main_link_color'] ) && ! empty( $webgatha_options['header_main_link_color'] ) ? $webgatha_options['header_main_link_color'] : array(
'regular' => '#323232',
'hover' => '#04d39f',
);
if ( isset( $header_main_link_color['regular'] ) && ! empty( $header_main_link_color['regular'] ) ) {
$webgatha_dynamic_css['
.site-header #primary-menu > li > a,
.site-header .woo-tools .woo-tools-actions li.woo-tools-action > a,
.site-header .woo-tools .woo-tools-actions li.woo-tools-action .search-button-wrap-inner > a']['color'] = $header_main_link_color['regular'];
}
if ( isset( $header_main_link_color['hover'] ) && ! empty( $header_main_link_color['hover'] ) ) {
$webgatha_dynamic_css['
.site-header #primary-menu > li.current-menu-item > a,
.site-header #primary-menu > li > a:hover,
.site-header .woo-tools .woo-tools-actions li.woo-tools-action > a:hover,
.site-header .woo-tools .woo-tools-actions li.woo-tools-action .search-button-wrap-inner > a:hover']['color'] = $header_main_link_color['hover'];
}
if ( isset( $header_main_link_color['hover'] ) && ! empty( $header_main_link_color['hover'] ) ) {
$webgatha_dynamic_css['
.woo-tools .woo-tools-actions li.woo-tools-action > a .cart-count,
.woo-tools .woo-tools-actions li.woo-tools-action > a .webgatha-wishlist-count']['background-color'] = $header_main_link_color['hover'];
}
}
}
}
if ( ! function_exists( 'webgatha_page_header_css' ) ) {
/**
* Page header css.
*
* @since 1.0.0
*
* @param array $webgatha_options theme options.
* @return void
*/
function webgatha_page_header_css( $webgatha_options ) {
global $webgatha_dynamic_css, $post;
$banner_image_repeat = '';
$banner_image_size = '';
$banner_image_attachment = '';
$banner_image_position = '';
$banner_image_color = '';
$banner_image_url = '';
$post_id = webgatha_dynamic_css_page_id();
// Page header height.
$pageheader_height = ( isset( $webgatha_options['pageheader_height'] ) ) ? $webgatha_options['pageheader_height'] : '380';
// Page header height.
$mobile_pageheader_height = ( isset( $webgatha_options['mobile_pageheader_height'] ) ) ? $webgatha_options['mobile_pageheader_height'] : '380';
$page_header_settings = '';
if ( $post_id ) {
$page_header_settings = get_post_meta( $post_id, 'webgatha_page_header_settings', true );
}
if ( isset( $page_header_settings['header_enable'] ) && 'enable' === $page_header_settings['header_enable'] ) {
if ( isset( $page_header_settings['height'] ) ) {
$pageheader_height = $page_header_settings['height'];
}
if ( isset( $page_header_settings['mobile_height'] ) ) {
$mobile_pageheader_height = $page_header_settings['mobile_height'];
}
}
if ( $pageheader_height ) {
$webgatha_dynamic_css['.page-header.header-intro']['height'] = $pageheader_height . 'px';
}
if ( wp_is_mobile() && $mobile_pageheader_height ) {
$webgatha_dynamic_css['.page-header.header-intro']['height'] = $mobile_pageheader_height . 'px';
}
// Generate Banner CSS from Options.
$banner_type = ( isset( $webgatha_options['banner_type'] ) ) ? $webgatha_options['banner_type'] : 'image';
if ( ! empty( $page_header_settings['header_enable'] ) && ! empty( $page_header_settings['background-type'] ) ) {
$banner_type = $page_header_settings['background-type'];
}
if ( 'image' === $banner_type ) {
$banner_image_url = '';
$banner_image_repeat = '';
$banner_image_size = '';
$banner_image_attachment = '';
$banner_image_position = '';
if ( isset( $webgatha_options['banner_image']['background-image'] ) && ! empty( $webgatha_options['banner_image']['background-image'] ) ) {
$banner_image_url = $webgatha_options['banner_image']['background-image'];
}
if ( isset( $webgatha_options['banner_image']['background-repeat'] ) && ! empty( $webgatha_options['banner_image']['background-repeat'] ) ) {
$banner_image_repeat = $webgatha_options['banner_image']['background-repeat'];
}
if ( isset( $webgatha_options['banner_image']['background-size'] ) && ! empty( $webgatha_options['banner_image']['background-size'] ) ) {
$banner_image_size = $webgatha_options['banner_image']['background-size'];
}
if ( isset( $webgatha_options['banner_image']['background-attachment'] ) && ! empty( $webgatha_options['banner_image']['background-attachment'] ) ) {
$banner_image_attachment = $webgatha_options['banner_image']['background-attachment'];
}
if ( isset( $webgatha_options['banner_image']['background-position'] ) && ! empty( $webgatha_options['banner_image']['background-position'] ) ) {
$banner_image_position = $webgatha_options['banner_image']['background-position'];
}
if ( isset( $page_header_settings['header_enable'] ) && 'enable' === $page_header_settings['header_enable'] ) {
if ( ! empty( $page_header_settings['background-image-url'] ) && ! empty( $page_header_settings['background-type'] ) ) {
$banner_image_url = $page_header_settings['background-image-url'];
}
if ( ! empty( $page_header_settings['background-repeat'] ) && ! empty( $page_header_settings['background-type'] ) ) {
$banner_image_repeat = $page_header_settings['background-repeat'];
}
if ( ! empty( $page_header_settings['background-size'] ) && ! empty( $page_header_settings['background-type'] ) ) {
$banner_image_size = $page_header_settings['background-size'];
}
if ( ! empty( $page_header_settings['background-attachment'] ) && ! empty( $page_header_settings['background-type'] ) ) {
$banner_image_attachment = $page_header_settings['background-attachment'];
}
if ( ! empty( $page_header_settings['background-position'] ) && ! empty( $page_header_settings['background-type'] ) ) {
$banner_image_position = $page_header_settings['background-position'];
}
}
// Set other properties.
if ( $banner_image_repeat ) {
$webgatha_dynamic_css['.header_intro_bg-image']['background-repeat'] = $banner_image_repeat;
}
if ( $banner_image_size ) {
$webgatha_dynamic_css['.header_intro_bg-image']['background-size'] = $banner_image_size;
}
if ( $banner_image_attachment ) {
$webgatha_dynamic_css['.header_intro_bg-image']['background-attachment'] = $banner_image_attachment;
}
if ( $banner_image_position ) {
$webgatha_dynamic_css['.header_intro_bg-image']['background-position'] = $banner_image_position;
}
if ( $banner_image_url ) {
$webgatha_dynamic_css['.header_intro_bg-image']['background-image'] = 'url(\'' . $banner_image_url . '\')';
}
} elseif ( 'color' === $banner_type ) {
$banner_image_color = '';
if ( ! empty( $webgatha_options['banner_image_color'] ) ) {
$banner_image_color = $webgatha_options['banner_image_color'];
}
if ( isset( $page_header_settings['header_enable'] ) && 'enable' === $page_header_settings['header_enable'] ) {
if ( ! empty( $page_header_settings['background-color'] ) && ! empty( $page_header_settings['background-type'] ) ) {
$banner_image_color = $page_header_settings['background-color'];
}
}
if ( $banner_image_color ) {
$webgatha_dynamic_css['.header_intro_bg-color']['background-color'] = $banner_image_color;
} else {
$webgatha_dynamic_css['.header_intro_bg-color']['background-color'] = '#000000';
}
}
if ( 'video' === $banner_type || 'image' === $banner_type ) {
$banner_image_opacity_custom_color = array();
$opacity_color = '';
$banner_image_opacity = ( isset( $webgatha_options['banner_image_opacity'] ) ) ? $webgatha_options['banner_image_opacity'] : 'black';
$banner_image_opacity_custom_color = isset( $webgatha_options['banner_image_opacity_custom_color'] ) ? $webgatha_options['banner_image_opacity_custom_color'] : '';
if ( isset( $page_header_settings['header_enable'] ) && 'enable' === $page_header_settings['header_enable'] ) {
if ( isset( $page_header_settings['background-opacity-color'] ) ) {
$opacity_color = $page_header_settings['background-opacity-color'];
}
if ( isset( $opacity_color ) && 'custom' === $opacity_color ) {
$banner_image_opacity = $opacity_color;
$banner_image_opacity_custom_color['rgba'] = $page_header_settings['background-opacity-custom-color'];
}
}
if ( ! empty( $banner_image_opacity ) && 'custom' === $banner_image_opacity ) {
if ( ! empty( $banner_image_opacity_custom_color ) ) {
if ( isset( $banner_image_opacity_custom_color['rgba'] ) ) {
$header_intro_opacity_background_color = $banner_image_opacity_custom_color['rgba'];
} else {
$header_intro_opacity_background_color = webgatha_hex2rgba( $banner_image_opacity_custom_color['color'], $banner_image_opacity_custom_color['alpha'] );
}
$webgatha_dynamic_css['.header_intro_opacity::before']['background-color'] = $header_intro_opacity_background_color;
}
}
}
}
}
if ( ! function_exists( 'webgatha_content_css' ) ) {
/**
* Typography.
*
* @since 1.0.0
*
* @param array $webgatha_options theme options.
* @return void
*/
function webgatha_content_css( $webgatha_options ) {
global $webgatha_dynamic_css, $webgatha_options, $webgatha_body_typo, $webgatha_h1_typo, $webgatha_h2_typo, $webgatha_h3_typo, $webgatha_h4_typo, $webgatha_h5_typo, $webgatha_h6_typo;
/* Body Typography*/
if ( isset( $webgatha_options['typography-body'] ) && ! empty( $webgatha_options['typography-body'] ) && ! empty( $webgatha_body_typo['family'] ) ) {
/*Body Font family, font weight, letter spacing */
if ( isset( $webgatha_options['typography-body']['font-family'] ) && ! empty( $webgatha_options['typography-body']['font-family'] ) ) {
if ( isset( $webgatha_options['typography-body']['font-backup'] ) && ! empty( $webgatha_options['typography-body']['font-backup'] ) ) {
$webgatha_dynamic_css[ $webgatha_body_typo['family'] ]['font-family'] = '"' . $webgatha_options['typography-body']['font-family'] . '", ' . $webgatha_options['typography-body']['font-backup'];
} else {
$webgatha_dynamic_css[ $webgatha_body_typo['family'] ]['font-family'] = $webgatha_options['typography-body']['font-family'];
}
}
if ( isset( $webgatha_options['enable_typekit_fonts'] ) && 'enable' === $webgatha_options['enable_typekit_fonts'] ) {
if ( isset( $webgatha_options['typekit_id'] ) && ! empty( $webgatha_options['typekit_id'] ) ) {
if ( isset( $webgatha_options['typekit_body_typography'] ) && ! empty( $webgatha_options['typekit_body_typography'] ) ) {
$webgatha_dynamic_css[ $webgatha_body_typo['family'] ]['font-family'] = $webgatha_options['typekit_body_typography'];
}
}
}
if ( isset( $webgatha_options['typography-body']['font-style'] ) && ! empty( $webgatha_options['typography-body']['font-style'] ) ) {
$webgatha_dynamic_css[ $webgatha_body_typo['family'] ]['font-style'] = $webgatha_options['typography-body']['font-style'];
}
if ( isset( $webgatha_options['typography-body']['font-weight'] ) && ! empty( $webgatha_options['typography-body']['font-weight'] ) ) {
$webgatha_dynamic_css[ $webgatha_body_typo['family'] ]['font-weight'] = $webgatha_options['typography-body']['font-weight'];
}
if ( isset( $webgatha_options['typography-body']['letter-spacing'] ) && ! empty( $webgatha_options['typography-body']['letter-spacing'] ) ) {
$webgatha_dynamic_css[ $webgatha_body_typo['family'] ]['letter-spacing'] = $webgatha_options['typography-body']['letter-spacing'];
}
/* Body Line Height */
if ( isset( $webgatha_options['typography-body']['line-height'] ) && ! empty( $webgatha_options['typography-body']['line-height'] ) ) {
$body_line_hight = ( strpos( $webgatha_options['typography-body']['line-height'], 'px' ) !== false ) ? $webgatha_options['typography-body']['line-height'] : $webgatha_options['typography-body']['line-height'] . 'px';
$webgatha_dynamic_css[ $webgatha_body_typo['line-height'] ]['line-height'] = $body_line_hight;
}
/* Body Font Size */
if ( isset( $webgatha_options['typography-body']['font-size'] ) && ! empty( $webgatha_options['typography-body']['font-size'] ) ) {
$body_font_size = ( strpos( $webgatha_options['typography-body']['font-size'], 'px' ) !== false ) ? $webgatha_options['typography-body']['font-size'] : $webgatha_options['typography-body']['font-size'] . 'px';
$webgatha_dynamic_css[ $webgatha_body_typo['font-size'] ]['font-size'] = $body_font_size;
}
}
/* h1 Typography*/
if ( isset( $webgatha_options['h1-typography'] ) && ! empty( $webgatha_options['h1-typography'] ) && ! empty( $webgatha_h1_typo['family'] ) ) {
/* h1 Typography Font family, font weight, letter spacing */
if ( isset( $webgatha_options['h1-typography']['font-backup'] ) && ! empty( $webgatha_options['h1-typography']['font-backup'] ) ) {
$webgatha_dynamic_css[ $webgatha_h1_typo['family'] ]['font-family'] = '"' . $webgatha_options['h1-typography']['font-family'] . '", ' . $webgatha_options['h1-typography']['font-backup'];
} elseif ( ! empty( $webgatha_options['webgatha_h1_typo']['font-family'] ) ) {
$webgatha_dynamic_css[ $webgatha_h1_typo['family'] ]['font-family'] = $webgatha_options['webgatha_h1_typo']['font-family'];
}
if ( isset( $webgatha_options['enable_typekit_fonts'] ) && 'enable' === $webgatha_options['enable_typekit_fonts'] ) {
if ( isset( $webgatha_options['typekit_id'] ) && ! empty( $webgatha_options['typekit_id'] ) ) {
if ( isset( $webgatha_options['typekit_headings_typography'] ) && ! empty( $webgatha_options['typekit_headings_typography'] ) ) {
$webgatha_dynamic_css[ $webgatha_h1_typo['family'] ]['font-family'] = $webgatha_options['typekit_headings_typography'];
}
}
}
if ( isset( $webgatha_options['h1-typography']['font-style'] ) && ! empty( $webgatha_options['h1-typography']['font-style'] ) ) {
$webgatha_dynamic_css[ $webgatha_h1_typo['family'] ]['font-style'] = $webgatha_options['h1-typography']['font-style'];
}
if ( isset( $webgatha_options['h1-typography']['font-weight'] ) && ! empty( $webgatha_options['h1-typography']['font-weight'] ) ) {
$webgatha_dynamic_css[ $webgatha_h1_typo['family'] ]['font-weight'] = $webgatha_options['h1-typography']['font-weight'];
}
if ( isset( $webgatha_options['h1-typography']['letter-spacing'] ) && ! empty( $webgatha_options['h1-typography']['letter-spacing'] ) ) {
$webgatha_dynamic_css[ $webgatha_h1_typo['family'] ]['letter-spacing'] = $webgatha_options['h1-typography']['letter-spacing'];
}
/* h1 Typography Line Height */
if ( isset( $webgatha_options['h1-typography']['line-height'] ) && ! empty( $webgatha_options['h1-typography']['line-height'] ) ) {
$h1_line_hight = ( strpos( $webgatha_options['h1-typography']['line-height'], 'px' ) !== false ) ? $webgatha_options['h1-typography']['line-height'] : $webgatha_options['h1-typography']['line-height'] . 'px';
$webgatha_dynamic_css[ $webgatha_h1_typo['line-height'] ]['line-height'] = $h1_line_hight;
}
/* h1 Typography Font Size */
if ( isset( $webgatha_options['h1-typography']['font-size'] ) && ! empty( $webgatha_options['h1-typography']['font-size'] ) ) {
$h1_font_size = ( strpos( $webgatha_options['h1-typography']['font-size'], 'px' ) !== false ) ? $webgatha_options['h1-typography']['font-size'] : $webgatha_options['h1-typography']['font-size'] . 'px';
$webgatha_dynamic_css[ $webgatha_h1_typo['font-size'] ]['font-size'] = $h1_font_size;
}
}
/* h2 Typography*/
if ( isset( $webgatha_options['h2-typography'] ) && ! empty( $webgatha_options['h2-typography'] ) && ! empty( $webgatha_h2_typo['family'] ) ) {
/* h2 Typography Font family, font weight, letter spacing */
if ( isset( $webgatha_options['h2-typography']['font-backup'] ) && ! empty( $webgatha_options['h2-typography']['font-backup'] ) ) {
$webgatha_dynamic_css[ $webgatha_h2_typo['family'] ]['font-family'] = '"' . $webgatha_options['h2-typography']['font-family'] . '", ' . $webgatha_options['h2-typography']['font-backup'];
} else {
$webgatha_dynamic_css[ $webgatha_h2_typo['family'] ]['font-family'] = $webgatha_options['h2-typography']['font-family'];
}
if ( isset( $webgatha_options['enable_typekit_fonts'] ) && 'enable' === $webgatha_options['enable_typekit_fonts'] ) {
if ( isset( $webgatha_options['typekit_id'] ) && ! empty( $webgatha_options['typekit_id'] ) ) {
if ( isset( $webgatha_options['typekit_headings_typography'] ) && ! empty( $webgatha_options['typekit_headings_typography'] ) ) {
$webgatha_dynamic_css[ $webgatha_h2_typo['family'] ]['font-family'] = $webgatha_options['typekit_headings_typography'];
}
}
}
if ( isset( $webgatha_options['h2-typography']['font-style'] ) && ! empty( $webgatha_options['h2-typography']['font-style'] ) ) {
$webgatha_dynamic_css[ $webgatha_h2_typo['family'] ]['font-style'] = $webgatha_options['h2-typography']['font-style'];
}
if ( isset( $webgatha_options['h2-typography']['font-weight'] ) && ! empty( $webgatha_options['h2-typography']['font-weight'] ) ) {
$webgatha_dynamic_css[ $webgatha_h2_typo['family'] ]['font-weight'] = $webgatha_options['h2-typography']['font-weight'];
}
if ( isset( $webgatha_options['h2-typography']['letter-spacing'] ) && ! empty( $webgatha_options['h2-typography']['letter-spacing'] ) ) {
$webgatha_dynamic_css[ $webgatha_h2_typo['family'] ]['letter-spacing'] = $webgatha_options['h2-typography']['letter-spacing'];
}
/* h2 Typography Line Height */
if ( isset( $webgatha_options['h2-typography']['line-height'] ) && ! empty( $webgatha_options['h2-typography']['line-height'] ) ) {
$h2_line_hight = ( strpos( $webgatha_options['h2-typography']['line-height'], 'px' ) !== false ) ? $webgatha_options['h2-typography']['line-height'] : $webgatha_options['h2-typography']['line-height'] . 'px';
$webgatha_dynamic_css[ $webgatha_h2_typo['line-height'] ]['line-height'] = $h2_line_hight;
}
/* h2 Typography Font Size */
if ( isset( $webgatha_options['h2-typography']['font-size'] ) && ! empty( $webgatha_options['h2-typography']['font-size'] ) ) {
$h2_font_size = ( strpos( $webgatha_options['h2-typography']['font-size'], 'px' ) !== false ) ? $webgatha_options['h2-typography']['font-size'] : $webgatha_options['h2-typography']['font-size'] . 'px';
$webgatha_dynamic_css[ $webgatha_h2_typo['font-size'] ]['font-size'] = $h2_font_size;
}
}
/* h3 Typography*/
if ( isset( $webgatha_options['h3-typography'] ) && ! empty( $webgatha_options['h3-typography'] ) && ! empty( $webgatha_h3_typo['family'] ) ) {
/* h3 Typography Font family, font weight, letter spacing */
if ( isset( $webgatha_options['h3-typography']['font-backup'] ) && ! empty( $webgatha_options['h3-typography']['font-backup'] ) ) {
$webgatha_dynamic_css[ $webgatha_h3_typo['family'] ]['font-family'] = '"' . $webgatha_options['h3-typography']['font-family'] . '", ' . $webgatha_options['h3-typography']['font-backup'];
} else {
$webgatha_dynamic_css[ $webgatha_h3_typo['family'] ]['font-family'] = $webgatha_options['h3-typography']['font-family'];
}
if ( isset( $webgatha_options['enable_typekit_fonts'] ) && 'enable' === $webgatha_options['enable_typekit_fonts'] ) {
if ( isset( $webgatha_options['typekit_id'] ) && ! empty( $webgatha_options['typekit_id'] ) ) {
if ( isset( $webgatha_options['typekit_headings_typography'] ) && ! empty( $webgatha_options['typekit_headings_typography'] ) ) {
$webgatha_dynamic_css[ $webgatha_h3_typo['family'] ]['font-family'] = $webgatha_options['typekit_headings_typography'];
}
}
}
if ( isset( $webgatha_options['h3-typography']['font-style'] ) && ! empty( $webgatha_options['h3-typography']['font-style'] ) ) {
$webgatha_dynamic_css[ $webgatha_h3_typo['family'] ]['font-style'] = $webgatha_options['h3-typography']['font-style'];
}
if ( isset( $webgatha_options['h3-typography']['font-weight'] ) && ! empty( $webgatha_options['h3-typography']['font-weight'] ) ) {
$webgatha_dynamic_css[ $webgatha_h3_typo['family'] ]['font-weight'] = $webgatha_options['h3-typography']['font-weight'];
}
if ( isset( $webgatha_options['h3-typography']['letter-spacing'] ) && ! empty( $webgatha_options['h3-typography']['letter-spacing'] ) ) {
$webgatha_dynamic_css[ $webgatha_h3_typo['family'] ]['letter-spacing'] = $webgatha_options['h3-typography']['letter-spacing'];
}
/* h3 Typography Line Height */
if ( isset( $webgatha_options['h3-typography']['line-height'] ) && ! empty( $webgatha_options['h3-typography']['line-height'] ) ) {
$h3_line_hight = ( strpos( $webgatha_options['h3-typography']['line-height'], 'px' ) !== false ) ? $webgatha_options['h3-typography']['line-height'] : $webgatha_options['h3-typography']['line-height'] . 'px';
$webgatha_dynamic_css[ $webgatha_h3_typo['line-height'] ]['line-height'] = $h3_line_hight;
}
/* h3 Typography Font Size */
if ( isset( $webgatha_options['h3-typography']['font-size'] ) && ! empty( $webgatha_options['h3-typography']['font-size'] ) ) {
$h3_font_size = ( strpos( $webgatha_options['h3-typography']['font-size'], 'px' ) !== false ) ? $webgatha_options['h3-typography']['font-size'] : $webgatha_options['h3-typography']['font-size'] . 'px';
$webgatha_dynamic_css[ $webgatha_h3_typo['font-size'] ]['font-size'] = $h3_font_size;
}
}
/* h4 Typography*/
if ( isset( $webgatha_options['h4-typography'] ) && ! empty( $webgatha_options['h4-typography'] ) && ! empty( $webgatha_h4_typo['family'] ) ) {
/* h4 Typography Font family, font weight, letter spacing */
if ( isset( $webgatha_options['h4-typography']['font-backup'] ) && ! empty( $webgatha_options['h4-typography']['font-backup'] ) ) {
$webgatha_dynamic_css[ $webgatha_h4_typo['family'] ]['font-family'] = '"' . $webgatha_options['h4-typography']['font-family'] . '", ' . $webgatha_options['h4-typography']['font-backup'];
} else {
$webgatha_dynamic_css[ $webgatha_h4_typo['family'] ]['font-family'] = $webgatha_options['h4-typography']['font-family'];
}
if ( isset( $webgatha_options['enable_typekit_fonts'] ) && 'enable' === $webgatha_options['enable_typekit_fonts'] ) {
if ( isset( $webgatha_options['typekit_id'] ) && ! empty( $webgatha_options['typekit_id'] ) ) {
if ( isset( $webgatha_options['typekit_headings_typography'] ) && ! empty( $webgatha_options['typekit_headings_typography'] ) ) {
$webgatha_dynamic_css[ $webgatha_h4_typo['family'] ]['font-family'] = $webgatha_options['typekit_headings_typography'];
}
}
}
if ( isset( $webgatha_options['h4-typography']['font-style'] ) && ! empty( $webgatha_options['h4-typography']['font-style'] ) ) {
$webgatha_dynamic_css[ $webgatha_h4_typo['family'] ]['font-style'] = $webgatha_options['h4-typography']['font-style'];
}
if ( isset( $webgatha_options['h4-typography']['font-weight'] ) && ! empty( $webgatha_options['h4-typography']['font-weight'] ) ) {
$webgatha_dynamic_css[ $webgatha_h4_typo['family'] ]['font-weight'] = $webgatha_options['h4-typography']['font-weight'];
}
if ( isset( $webgatha_options['h4-typography']['letter-spacing'] ) && ! empty( $webgatha_options['h4-typography']['letter-spacing'] ) ) {
$webgatha_dynamic_css[ $webgatha_h4_typo['family'] ]['letter-spacing'] = $webgatha_options['h4-typography']['letter-spacing'];
}
/* h4 Typography Line Height */
if ( isset( $webgatha_options['h4-typography']['line-height'] ) && ! empty( $webgatha_options['h4-typography']['line-height'] ) ) {
$h4_line_hight = ( strpos( $webgatha_options['h4-typography']['line-height'], 'px' ) !== false ) ? $webgatha_options['h4-typography']['line-height'] : $webgatha_options['h4-typography']['line-height'] . 'px';
$webgatha_dynamic_css[ $webgatha_h4_typo['line-height'] ]['line-height'] = $h4_line_hight;
}
/* h4 Typography Font Size */
if ( isset( $webgatha_options['h4-typography']['font-size'] ) && ! empty( $webgatha_options['h4-typography']['font-size'] ) ) {
$h4_font_size = ( strpos( $webgatha_options['h4-typography']['font-size'], 'px' ) !== false ) ? $webgatha_options['h4-typography']['font-size'] : $webgatha_options['h4-typography']['font-size'] . 'px';
$webgatha_dynamic_css[ $webgatha_h4_typo['font-size'] ]['font-size'] = $h4_font_size;
}
}
/* h5 Typography*/
if ( isset( $webgatha_options['h5-typography'] ) && ! empty( $webgatha_options['h5-typography'] ) && ! empty( $webgatha_h5_typo['family'] ) ) {
/* h5 Typography Font family, font weight, letter spacing */
if ( isset( $webgatha_options['h5-typography']['font-backup'] ) && ! empty( $webgatha_options['h5-typography']['font-backup'] ) ) {
$webgatha_dynamic_css[ $webgatha_h5_typo['family'] ]['font-family'] = '"' . $webgatha_options['h5-typography']['font-family'] . '", ' . $webgatha_options['h5-typography']['font-backup'];
} else {
$webgatha_dynamic_css[ $webgatha_h5_typo['family'] ]['font-family'] = $webgatha_options['h5-typography']['font-family'];
}
if ( isset( $webgatha_options['enable_typekit_fonts'] ) && 'enable' === $webgatha_options['enable_typekit_fonts'] ) {
if ( isset( $webgatha_options['typekit_id'] ) && ! empty( $webgatha_options['typekit_id'] ) ) {
if ( isset( $webgatha_options['typekit_headings_typography'] ) && ! empty( $webgatha_options['typekit_headings_typography'] ) ) {
$webgatha_dynamic_css[ $webgatha_h5_typo['family'] ]['font-family'] = $webgatha_options['typekit_headings_typography'];
}
}
}
if ( isset( $webgatha_options['h5-typography']['font-style'] ) && ! empty( $webgatha_options['h5-typography']['font-style'] ) ) {
$webgatha_dynamic_css[ $webgatha_h5_typo['family'] ]['font-style'] = $webgatha_options['h5-typography']['font-style'];
}
if ( isset( $webgatha_options['h5-typography']['font-weight'] ) && ! empty( $webgatha_options['h5-typography']['font-weight'] ) ) {
$webgatha_dynamic_css[ $webgatha_h5_typo['family'] ]['font-weight'] = $webgatha_options['h5-typography']['font-weight'];
}
if ( isset( $webgatha_options['h5-typography']['letter-spacing'] ) && ! empty( $webgatha_options['h5-typography']['letter-spacing'] ) ) {
$webgatha_dynamic_css[ $webgatha_h5_typo['family'] ]['letter-spacing'] = $webgatha_options['h5-typography']['letter-spacing'];
}
/* h5 Typography Line Height */
if ( isset( $webgatha_options['h5-typography']['line-height'] ) && ! empty( $webgatha_options['h5-typography']['line-height'] ) ) {
$h5_line_hight = ( strpos( $webgatha_options['h5-typography']['line-height'], 'px' ) !== false ) ? $webgatha_options['h5-typography']['line-height'] : $webgatha_options['h5-typography']['line-height'] . 'px';
$webgatha_dynamic_css[ $webgatha_h5_typo['line-height'] ]['line-height'] = $h5_line_hight;
}
/* h5 Typography Font Size */
if ( isset( $webgatha_options['h5-typography']['font-size'] ) && ! empty( $webgatha_options['h5-typography']['font-size'] ) ) {
$h5_font_size = ( strpos( $webgatha_options['h5-typography']['font-size'], 'px' ) !== false ) ? $webgatha_options['h5-typography']['font-size'] : $webgatha_options['h5-typography']['font-size'] . 'px';
$webgatha_dynamic_css[ $webgatha_h5_typo['font-size'] ]['font-size'] = $h5_font_size;
}
}
/* h6 Typography*/
if ( isset( $webgatha_options['h6-typography'] ) && ! empty( $webgatha_options['h6-typography'] ) && ! empty( $webgatha_h6_typo['family'] ) ) {
/* h6 Typography Font family, font weight, letter spacing */
if ( isset( $webgatha_options['h6-typography']['font-backup'] ) && ! empty( $webgatha_options['h6-typography']['font-backup'] ) ) {
$webgatha_dynamic_css[ $webgatha_h6_typo['family'] ]['font-family'] = '"' . $webgatha_options['h6-typography']['font-family'] . '", ' . $webgatha_options['h6-typography']['font-backup'];
} else {
$webgatha_dynamic_css[ $webgatha_h6_typo['family'] ]['font-family'] = $webgatha_options['h6-typography']['font-family'];
}
if ( isset( $webgatha_options['enable_typekit_fonts'] ) && 'enable' === $webgatha_options['enable_typekit_fonts'] ) {
if ( isset( $webgatha_options['typekit_id'] ) && ! empty( $webgatha_options['typekit_id'] ) ) {
if ( isset( $webgatha_options['typekit_headings_typography'] ) && ! empty( $webgatha_options['typekit_headings_typography'] ) ) {
$webgatha_dynamic_css[ $webgatha_h6_typo['family'] ]['font-family'] = $webgatha_options['typekit_headings_typography'];
}
}
}
if ( isset( $webgatha_options['h6-typography']['font-style'] ) && ! empty( $webgatha_options['h6-typography']['font-style'] ) ) {
$webgatha_dynamic_css[ $webgatha_h6_typo['family'] ]['font-style'] = $webgatha_options['h6-typography']['font-style'];
}
if ( isset( $webgatha_options['h6-typography']['font-weight'] ) && ! empty( $webgatha_options['h6-typography']['font-weight'] ) ) {
$webgatha_dynamic_css[ $webgatha_h6_typo['family'] ]['font-weight'] = $webgatha_options['h6-typography']['font-weight'];
}
if ( isset( $webgatha_options['h6-typography']['letter-spacing'] ) && ! empty( $webgatha_options['h6-typography']['letter-spacing'] ) ) {
$webgatha_dynamic_css[ $webgatha_h6_typo['family'] ]['letter-spacing'] = $webgatha_options['h6-typography']['letter-spacing'];
}
/* h6 Typography Line Height */
if ( isset( $webgatha_options['h6-typography']['line-height'] ) && ! empty( $webgatha_options['h6-typography']['line-height'] ) ) {
$h6_line_hight = ( strpos( $webgatha_options['h6-typography']['line-height'], 'px' ) !== false ) ? $webgatha_options['h6-typography']['line-height'] : $webgatha_options['h6-typography']['line-height'] . 'px';
$webgatha_dynamic_css[ $webgatha_h6_typo['line-height'] ]['line-height'] = $h6_line_hight;
}
/* h6 Typography Font Size */
if ( isset( $webgatha_options['h6-typography']['font-size'] ) && ! empty( $webgatha_options['h6-typography']['font-size'] ) ) {
$h6_font_size = ( strpos( $webgatha_options['h6-typography']['font-size'], 'px' ) !== false ) ? $webgatha_options['h6-typography']['font-size'] : $webgatha_options['h6-typography']['font-size'] . 'px';
$webgatha_dynamic_css[ $webgatha_h6_typo['font-size'] ]['font-size'] = $h6_font_size;
}
}
}
}
if ( ! function_exists( 'webgatha_footer_css' ) ) {
/**
* Footer css
*
* @since 1.0.0
*
* @param array $webgatha_options theme options.
* @return void
*/
function webgatha_footer_css( $webgatha_options ) {
global $webgatha_dynamic_css;
$footer_bg_image = '';
$footer_bg_image_repeat = '';
$footer_bg_image_attachment = '';
$footer_bg_image_size = '';
$footer_bg_image_position = '';
$footer_bg_color = '';
$footer_opacity_custom_background = '';
$footer_heading_color = '';
$footer_text_color = '';
$footer_link_color = '';
$footer_link_hover_color = '';
if ( function_exists( 'webgatha_footer_type' ) && 'footer_builder' === webgatha_footer_type() ) {
$webgatha_get_custom_footer_data = webgatha_get_custom_footer_data();
if ( isset( $webgatha_get_custom_footer_data['common_settings'] ) && $webgatha_get_custom_footer_data['common_settings'] ) {
$footer_data = $webgatha_get_custom_footer_data['common_settings'];
if ( isset( $footer_data['footer_background_image'] ) && $footer_data['footer_background_image'] ) {
if ( isset( $footer_data['footer_background_image']['bg_src'] ) && $footer_data['footer_background_image']['bg_src'] ) {
$footer_bg_image = $footer_data['footer_background_image']['bg_src'];
} else {
if ( isset( $footer_data['footer_background_image']['bg_color'] ) && $footer_data['footer_background_image']['bg_color'] ) {
$footer_bg_color = $footer_data['footer_background_image']['bg_color'];
}
}
if ( isset( $footer_data['footer_background_image']['bg_repeat'] ) && $footer_data['footer_background_image']['bg_repeat'] ) {
$footer_bg_image_repeat = $footer_data['footer_background_image']['bg_repeat'];
}
if ( isset( $footer_data['footer_background_image']['bg_attachment'] ) && $footer_data['footer_background_image']['bg_attachment'] ) {
$footer_bg_image_attachment = $footer_data['footer_background_image']['bg_attachment'];
}
if ( isset( $footer_data['footer_background_image']['bg_size'] ) && $footer_data['footer_background_image']['bg_size'] ) {
$footer_bg_image_size = $footer_data['footer_background_image']['bg_size'];
}
if ( isset( $footer_data['footer_background_image']['bg_position'] ) && $footer_data['footer_background_image']['bg_position'] ) {
$footer_bg_image_position = $footer_data['footer_background_image']['bg_position'];
}
}
if ( isset( $footer_data['footer_background_overlay'] ) && 'custom' === $footer_data['footer_background_opacity'] && ! empty( $footer_data['footer_background_overlay'] ) ) {
$footer_opacity_custom_background = $footer_data['footer_background_overlay'];
}
if ( isset( $footer_data['footer_heading_color'] ) && $footer_data['footer_heading_color'] ) {
$footer_heading_color = $footer_data['footer_heading_color'];
}
if ( isset( $footer_data['footer_text_color'] ) && $footer_data['footer_text_color'] ) {
$footer_text_color = $footer_data['footer_text_color'];
}
if ( isset( $footer_data['footer_link_color'] ) && $footer_data['footer_link_color'] ) {
$footer_link_color = $footer_data['footer_link_color'];
}
if ( isset( $footer_data['footer_link_hover_color'] ) && $footer_data['footer_link_hover_color'] ) {
$footer_link_hover_color = $footer_data['footer_link_hover_color'];
}
}
} else {
if ( isset( $webgatha_options['footer_background_type'] ) && 'image' === $webgatha_options['footer_background_type'] && ! empty( $webgatha_options['footer_background_image'] ) ) {
$footer_bg_image = $webgatha_options['footer_background_image']['background-image'];
if ( isset( $webgatha_options['footer_background_image']['background-repeat'] ) ) {
$footer_bg_image_repeat = $webgatha_options['footer_background_image']['background-repeat'];
}
if ( isset( $webgatha_options['footer_background_image']['background-repeat'] ) ) {
$footer_bg_image_attachment = $webgatha_options['footer_background_image']['background-attachment'];
}
if ( isset( $webgatha_options['footer_background_image']['background-repeat'] ) ) {
$footer_bg_image_size = $webgatha_options['footer_background_image']['background-size'];
}
if ( isset( $webgatha_options['footer_background_image']['background-repeat'] ) ) {
$footer_bg_image_position = $webgatha_options['footer_background_image']['background-position'];
}
}
if ( isset( $webgatha_options['footer_background_overlay'] ) && 'custom' === $webgatha_options['footer_background_opacity'] && ! empty( $webgatha_options['footer_background_overlay'] ) ) {
if ( isset( $webgatha_options['footer_background_overlay']['rgba'] ) ) {
$footer_opacity_custom_background = $webgatha_options['footer_background_overlay']['rgba'];
} else {
$footer_opacity_custom_background = webgatha_hex2rgba( $webgatha_options['footer_background_overlay']['color'], $webgatha_options['footer_background_overlay']['alpha'] );
}
}
if ( isset( $webgatha_options['footer_background_type'] ) && 'color' === $webgatha_options['footer_background_type'] ) {
$footer_bg_color = $webgatha_options['footer_background_color'];
}
if ( isset( $webgatha_options['footer_heading_color'] ) && $webgatha_options['footer_heading_color'] ) {
$footer_heading_color = $webgatha_options['footer_heading_color'];
}
if ( isset( $webgatha_options['footer_text_color'] ) && $webgatha_options['footer_text_color'] ) {
$footer_text_color = $webgatha_options['footer_text_color'];
}
if ( isset( $webgatha_options['footer_link_color'] ) && $webgatha_options['footer_link_color'] ) {
$footer_link_color = $webgatha_options['footer_link_color'];
}
if ( isset( $webgatha_options['footer_link_hover_color'] ) && $webgatha_options['footer_link_hover_color'] ) {
$footer_link_hover_color = $webgatha_options['footer_link_hover_color'];
}
}
/* Footer Background Option For Image*/
if ( $footer_bg_image ) {
$webgatha_dynamic_css['footer.site-footer']['background'] = 'url(' . $footer_bg_image . ')';
if ( $footer_bg_image_repeat ) {
$webgatha_dynamic_css['footer.site-footer']['background-repeat'] = $footer_bg_image_repeat;
}
if ( $footer_bg_image_attachment ) {
$webgatha_dynamic_css['footer.site-footer']['background-attachment'] = $footer_bg_image_attachment;
}
if ( $footer_bg_image_size ) {
$webgatha_dynamic_css['footer.site-footer']['background-size'] = $footer_bg_image_size;
}
if ( $footer_bg_image_position ) {
$webgatha_dynamic_css['footer.site-footer']['background-position'] = $footer_bg_image_position;
}
if ( $footer_opacity_custom_background ) {
$webgatha_dynamic_css['.site-footer .footer-wrapper.footer_opacity_custom']['background-color'] = $footer_opacity_custom_background;
}
}
/*Footer Background Color */
if ( $footer_bg_color ) {
$webgatha_dynamic_css['footer.site-footer']['background'] = $footer_bg_color;
}
/*Footer Heading Color */
if ( $footer_heading_color ) {
$webgatha_dynamic_css['.site-footer .widget .widget-title, .site-footer .widget .widgettitle']['color'] = $footer_heading_color;
}
/*Footer Text Color */
if ( $footer_text_color ) {
$webgatha_dynamic_css['
.site-footer .footer-widgets-wrapper,
.site-footer caption,
.site-footer .widget_meta ul li,
.site-footer .widget_recent_comments ul li,
.site-footer .widget_recent_entries ul li,
.site-footer .widget_rss ul li .rss-date,
.site-footer .footer-bottom,
.site-footer .webgatha-opening-hours ul li']['color'] = $footer_text_color;
}
/*Footer Link Color */
if ( $footer_link_color ) {
$webgatha_dynamic_css['
.site-footer .footer-widgets-wrapper a,
.site-footer .footer-bottom a']['color'] = $footer_link_color;
}
/*Footer Link Hover Color */
if ( $footer_link_hover_color ) {
$webgatha_dynamic_css['
.site-footer .footer-widgets-wrapper a:hover,
.site-footer .widget_nav_menu ul li:hover > a,
.site-footer .widget_nav_menu ul li > a:hover,
.site-footer .widget_pages ul li:hover > a,
.site-footer .widget_pages ul li > a:hover,
.site-footer .footer-bottom a:hover,
.site-footer .webgatha-opening-hours ul li i,
.site-footer .webgatha-opening-hours ul li label,
.site-footer .widget_webgatha_newsletter_widget .webgatha-newsletter-style-fancy .button-area .submit,
.site-footer .widget_webgatha_newsletter_widget .webgatha-newsletter-style-default.webgatha-newsletter-color-dark .button-area .input-group-btn .submit']['color'] = $footer_link_hover_color;
$webgatha_dynamic_css['
.site-footer .widget_calendar table #today,
.site-footer .widget_search .search-button,
.site-footer .widget_webgatha_newsletter_widget .webgatha-newsletter-style-default .button-area .input-group-btn .submit:hover,
.site-footer .widget_webgatha_newsletter_widget .webgatha-newsletter-style-fancy,
.site-footer .widget_webgatha_newsletter_widget .webgatha-newsletter-style-classic .button-area .submit']['background-color'] = $footer_link_hover_color;
$webgatha_dynamic_css['
.site-footer .widget_tag_cloud a:hover,
.site-footer .widget_webgatha_newsletter_widget .webgatha-newsletter-style-default.webgatha-newsletter-color-dark .button-area .input-group-btn .submit,
.site-footer .widget_webgatha_newsletter_widget .webgatha-newsletter-style-default.webgatha-newsletter-color-light .button-area .input-group-btn .submit:hover']['border-color'] = $footer_link_hover_color;
}
/*Footer Copyright Background Color */
if ( isset( $webgatha_options['copyright_back_color'] ) && ! empty( $webgatha_options['copyright_back_color'] ) ) {
if ( isset( $webgatha_options['copyright_back_color']['rgba'] ) ) {
$site_info_footer_widget_background_color = $webgatha_options['copyright_back_color']['rgba'];
} else {
$site_info_footer_widget_background_color = webgatha_hex2rgba( $webgatha_options['copyright_back_color']['color'], $webgatha_options['copyright_back_color']['alpha'] );
}
if ( '' !== $site_info_footer_widget_background_color ) {
$webgatha_dynamic_css['.site-footer .footer-wrapper > .site-info']['background'] = $site_info_footer_widget_background_color;
}
}
/*Footer Copyright Text Color */
if ( isset( $webgatha_options['copyright_text_color'] ) && $webgatha_options['copyright_text_color'] ) {
$webgatha_dynamic_css['
.site-footer .footer-wrapper > .site-info,
.site-footer .footer-wrapper > .site-info a']['color'] = $webgatha_options['copyright_text_color'];
}
/*Footer Copyright Link Color */
if ( isset( $webgatha_options['copyright_link_color'] ) && $webgatha_options['copyright_link_color'] ) {
$webgatha_dynamic_css['.site-footer .footer-wrapper > .site-info a:hover']['color'] = $webgatha_options['copyright_link_color'];
}
}
}
if ( ! function_exists( 'webgatha_parse_redux_dimension' ) ) {
/**
* Parse the dimension.
*
* @since 1.0.0
*
* @param array $dimension_data dimensions data.
* @param string $units unit ex. px.
* @return array
*/
function webgatha_parse_redux_dimension( $dimension_data = array(), $units = 'px' ) {
// bail early if no data found.
if ( empty( $dimension_data ) ) {
return false;
}
$new_dimenstion = array();
if ( ! isset( $dimension_data['units'] ) || $dimension_data['units'] ) {
$dimension_data['units'] = $units;
}
if ( isset( $dimension_data['height'] ) && $dimension_data['height'] ) {
if ( substr( $dimension_data['height'], -2 ) !== $dimension_data['units'] ) {
$new_dimenstion['height'] = $dimension_data['height'] . $dimension_data['units'];
} else {
$new_dimenstion['height'] = $dimension_data['height'];
}
}
if ( isset( $dimension_data['width'] ) && $dimension_data['width'] ) {
if ( substr( $dimension_data['width'], -2 ) !== $dimension_data['units'] ) {
$new_dimenstion['width'] = $dimension_data['width'] . $dimension_data['units'];
} else {
$new_dimenstion['width'] = $dimension_data['width'];
}
}
if ( empty( $new_dimenstion ) ) {
return false;
}
return $new_dimenstion;
}
}