post_type) ? $post->post_type : false; $is_page = 'page' === $post_type ? true : false; $object_id = $is_page ? $post->ID : false; if (!$is_page) { /** * Shop Page */ if (NASA_WOO_ACTIVED) { $is_shop = is_shop(); $is_product_taxonomy = is_product_taxonomy(); $is_product_category = is_product_category(); $object_id = ($is_shop || $is_product_taxonomy) && !$is_product_category ? wc_get_page_id('shop') : 0; $is_page = $object_id ? true : false; } /** * Page post */ if (!$is_page && elessi_check_blog_page()) { $object_id = get_option('page_for_posts'); $is_page = $object_id ? true : false; } } $dinamic_css = $font_weight = $color_primary_css = $page_css = ''; if ($is_page && $object_id) { $head_type = get_post_meta($object_id, '_nasa_custom_header', true); /** * color_primary */ $flag_override_color = get_post_meta($object_id, '_nasa_pri_color_flag', true); if ($flag_override_color) : $color_primary = get_post_meta($object_id, '_nasa_pri_color', true); $color_primary_css .= $color_primary ? elessi_get_style_primary_color($color_primary) : ''; endif; /** * Button Text Color */ $flag_override_btn_text_color = get_post_meta($object_id, '_nasa_btn_text_color_flag', true); if ($flag_override_btn_text_color) : $btn_text_color = get_post_meta($object_id, '_nasa_btn_text_color', true); $color_primary_css .= $btn_text_color ? elessi_get_style_btn_text_color($btn_text_color) : ''; endif; /** * color for header */ $bg_color = get_post_meta($object_id, '_nasa_bg_color_header', true); $bg_color_stk = get_post_meta($object_id, '_nasa_bg_color_header_stk', true); $text_color = get_post_meta($object_id, '_nasa_text_color_header', true); $text_color_stk = get_post_meta($object_id, '_nasa_text_color_header_stk', true); $text_color_hover = get_post_meta($object_id, '_nasa_text_color_hover_header', true); $text_color_hover_stk = get_post_meta($object_id, '_nasa_text_color_hover_header_stk', true); $page_css .= elessi_get_style_header_color($bg_color, $text_color, $text_color_hover, $bg_color_stk, $text_color_stk, $text_color_hover_stk, $head_type); /** * color for top bar */ if (!isset($nasa_opt['topbar_on']) || $nasa_opt['topbar_on']) { $bg_color = get_post_meta($object_id, '_nasa_bg_color_topbar', true); $text_color = get_post_meta($object_id, '_nasa_text_color_topbar', true); $text_color_hover = get_post_meta($object_id, '_nasa_text_color_hover_topbar', true); $page_css .= elessi_get_style_topbar_color($bg_color, $text_color, $text_color_hover, $head_type); } /** * color for main menu */ $bg_color = get_post_meta($object_id, '_nasa_bg_color_main_menu', true); $bg_color_stk = get_post_meta($object_id, '_nasa_bg_color_main_menu_stk', true); $text_color = get_post_meta($object_id, '_nasa_text_color_main_menu', true); $text_color_stk = get_post_meta($object_id, '_nasa_text_color_main_menu_stk', true); $page_css .= elessi_get_style_main_menu_color($bg_color, $text_color, $bg_color_stk, $text_color_stk, $head_type); /** * color for vertical menu */ $bg_color = get_post_meta($object_id, '_nasa_bg_color_v_menu', true); $bg_color_stk = get_post_meta($object_id, '_nasa_bg_color_v_menu_stk', true); $text_color = get_post_meta($object_id, '_nasa_text_color_v_menu', true); $text_color_stk = get_post_meta($object_id, '_nasa_text_color_v_menu_stk', true); $page_css .= elessi_get_style_vertical_menu_color($bg_color, $text_color, $bg_color_stk, $text_color_stk); /** * color background shop and product - shop-background-color - mode */ $page_css .= elessi_get_style_background_color_shop(); /** * Add width to site */ $max_width = ''; $plus_option = get_post_meta($object_id, '_nasa_plus_wide_option', true); switch ($plus_option) { case '1': $plus_width = get_post_meta($object_id, '_nasa_plus_wide_width', true); break; case '-1': $plus_width = 0; break; case '': default : $plus_width = ''; break; } if ($plus_width !== '' && (int) $plus_width >= 0) { $content_width = !isset($content_width) ? 1200 : $content_width; $max_width = ($content_width + (int) $plus_width); } $page_css .= elessi_get_style_plus_wide_width($max_width); echo $max_width ? '' : ''; /** * Font style */ $type_font_select = get_post_meta($object_id, '_nasa_type_font_select', true); $type_headings = ''; $type_texts = ''; $type_nav = ''; $type_banner = ''; $type_price = ''; $custom_font = ''; if ($type_font_select == 'google') { $type_headings = get_post_meta($object_id, '_nasa_type_headings', true); $type_texts = get_post_meta($object_id, '_nasa_type_texts', true); $type_nav = get_post_meta($object_id, '_nasa_type_nav', true); $type_banner = get_post_meta($object_id, '_nasa_type_banner', true); $type_price = get_post_meta($object_id, '_nasa_type_price', true); } if ($type_font_select == 'custom') { $custom_font = get_post_meta($object_id, '_nasa_custom_font', true); } $font_css = elessi_get_font_style( $type_font_select, $type_headings, $type_texts, $type_nav, $type_banner, $type_price, $custom_font, true ); $dinamic_css = $color_primary_css . $page_css . $font_css; /** * Font-weight */ $font_weight = get_post_meta($object_id, '_nasa_font_weight', true); } /** * Override primary color for root category product */ else { $root_cat_id = elessi_get_root_term_id(); $head_type = get_term_meta($root_cat_id, 'cat_header_type', true); if ($root_cat_id) { $color_primary = get_term_meta($root_cat_id, 'cat_primary_color', true); $color_primary_css .= $color_primary ? elessi_get_style_primary_color($color_primary) : ''; $btn_text_color = get_term_meta($root_cat_id, 'cat_btn_text_color', true); $color_primary_css .= $btn_text_color ? elessi_get_style_btn_text_color($btn_text_color) : ''; /** * Color for header */ $bg_color = get_term_meta($root_cat_id, 'cat_header_bg', true); $bg_color_stk = get_term_meta($root_cat_id, 'cat_header_bg_stk', true); $text_color = get_term_meta($root_cat_id, 'cat_header_text', true); $text_color_stk = get_term_meta($root_cat_id, 'cat_header_text_stk', true); $text_color_hover = get_term_meta($root_cat_id, 'cat_header_text_hv', true); $text_color_hover_stk = get_term_meta($root_cat_id, 'cat_header_text_hv_stk', true); $page_css .= elessi_get_style_header_color($bg_color, $text_color, $text_color_hover, $bg_color_stk, $text_color_stk, $text_color_hover_stk, $head_type); /** * color for top bar */ if (!isset($nasa_opt['topbar_on']) || $nasa_opt['topbar_on']) { $bg_color = get_term_meta($root_cat_id, 'cat_topbar_bg', true); $text_color = get_term_meta($root_cat_id, 'cat_topbar_text', true); $text_color_hover = get_term_meta($root_cat_id, 'cat_topbar_text_hv', true); $page_css .= elessi_get_style_topbar_color($bg_color, $text_color, $text_color_hover, $head_type); } /** * color for main menu */ $bg_color = get_term_meta($root_cat_id, 'cat_main_menu_bg', true); $bg_color_stk = get_term_meta($root_cat_id, 'cat_main_menu_bg', true); $text_color = get_term_meta($root_cat_id, 'cat_main_menu_text', true); $text_color_stk = get_term_meta($root_cat_id, 'cat_main_menu_text', true); $page_css .= elessi_get_style_main_menu_color($bg_color, $text_color, $bg_color_stk, $text_color_stk, $head_type); /** * color for vertical menu */ $bg_color = get_term_meta($root_cat_id, 'cat_v_menu_bg', true); $bg_color_stk = get_term_meta($root_cat_id, 'cat_v_menu_bg', true); $text_color = get_term_meta($root_cat_id, 'cat_v_menu_text', true); $text_color_stk = get_term_meta($root_cat_id, 'cat_v_menu_text', true); $page_css .= elessi_get_style_vertical_menu_color($bg_color, $text_color, $bg_color_stk, $text_color_stk); /** * color background shop and product - shop-background-color - mode */ $page_css .= elessi_get_style_background_color_shop($root_cat_id); /** * Add width to site */ $max_width = ''; $plus_option = get_term_meta($root_cat_id, 'cat_width_more_allow', true); switch ($plus_option) { case '1': $plus_width = get_term_meta($root_cat_id, 'cat_width_more', true); break; case '-1': $plus_width = 0; break; case '': default : $plus_width = ''; break; } if ($plus_width !== '' && (int) $plus_width >= 0) { $content_width = !isset($content_width) ? 1200 : $content_width; $max_width = ($content_width + (int) $plus_width); } $page_css .= elessi_get_style_plus_wide_width($max_width); echo $max_width ? '' : ''; /** * Font style */ $type_font_select = get_term_meta($root_cat_id, 'type_font', true); $type_headings = ''; $type_texts = ''; $type_nav = ''; $type_banner = ''; $type_price = ''; $custom_font = ''; if ($type_font_select == 'google') { $type_headings = get_term_meta($root_cat_id, 'headings_font', true); $type_texts = get_term_meta($root_cat_id, 'texts_font', true); $type_nav = get_term_meta($root_cat_id, 'nav_font', true); $type_banner = get_term_meta($root_cat_id, 'banner_font', true); $type_price = get_term_meta($root_cat_id, 'price_font', true); } if ($type_font_select == 'custom') { $custom_font = get_term_meta($root_cat_id, 'custom_font', true); } $font_css = elessi_get_font_style( $type_font_select, $type_headings, $type_texts, $type_nav, $type_banner, $type_price, $custom_font, true ); $dinamic_css = $color_primary_css . $page_css . $font_css; /** * Font-weight */ $font_weight = get_term_meta($root_cat_id, 'font_weight', true); } } $prefix = elessi_prefix_theme(); /** * Override Font weight */ if ($font_weight != '') { wp_dequeue_style($prefix . '-style-font-weight'); if (in_array($font_weight, array('800', '700', '600', '500'))) { wp_enqueue_style($prefix . '-font-weight-override', ELESSI_THEME_URI . '/assets/css/style-font-weight-' . $font_weight . '.css', array()); } } /** * Css inline override */ if ($dinamic_css != '') { wp_add_inline_style($prefix . '-style-dynamic', $dinamic_css); } } endif; if (!function_exists('elessi_get_style_background_color_shop')) : function elessi_get_style_background_color_shop($root_cat_id = '') { global $nasa_opt; $option_change_shop_layout = get_term_meta($root_cat_id, 'cat_change_shop_layout', true) != '' ? get_term_meta($root_cat_id, 'cat_change_shop_layout', true) : (isset($nasa_opt['option_change_shop_layout']) ? $nasa_opt['option_change_shop_layout'] : 'shop-default'); if ($option_change_shop_layout == '' || $option_change_shop_layout !== 'shop-background-color') { return ''; } $color_background_shop = get_term_meta($root_cat_id, 'cat_color_background_shop', true) != '' ? get_term_meta($root_cat_id, 'cat_color_background_shop', true) : (isset($nasa_opt['color_background_shop']) ? $nasa_opt['color_background_shop'] : ''); $color_background_shop_pro = get_term_meta($root_cat_id, 'cat_color_background_shop_pro', true) != '' ? get_term_meta($root_cat_id, 'cat_color_background_shop_pro', true) : (isset($nasa_opt['color_background_shop_pro']) ? $nasa_opt['color_background_shop_pro'] : ''); ob_start(); ?>