function wpex_is_top_bar_enabled($return = true) { if (!get_theme_mod('top_bar', true)) { $return = false; } elseif (($post_id = wpex_get_the_id()) && 'on' == get_post_meta($post_id, 'wpex_disable_top_bar', true)) { $return = false; } elseif (wpex_is_overlay_header_enabled()) { $return = false; } else { $return = true; } $return = apply_filters('wpex_is_top_bar_enabled', $return); return $return; }
function wpex_body_classes($classes) { // Get post ID $post_id = wpex_get_the_id(); // Define main layout style $main_layout = wpex_main_layout($post_id); // WPExplorer class $classes[] = 'wpex-theme'; // Responsive if (get_theme_mod('responsive', 'on')) { $classes[] = 'wpex-responsive'; } // Add skin to body classes if (function_exists('wpex_active_skin') && wpex_active_skin()) { $classes[] = 'theme-' . wpex_active_skin(); } // Check if the Visual Composer is being used on this page if (function_exists('wpex_post_has_composer') && wpex_post_has_composer($post_id)) { $classes[] = 'has-composer'; } // Meta Options if ($post_id) { // No header margin if ('on' == get_post_meta($post_id, 'wpex_disable_header_margin', true)) { $classes[] = 'no-header-margin'; } // Slider if (wpex_post_slider_shortcode($post_id)) { $classes[] = 'page-with-slider'; } // Title with Background Image if ('background-image' == get_post_meta($post_id, 'wpex_post_title_style', true)) { $classes[] = 'page-with-background-title'; } } // Layout Style $classes[] = $main_layout . '-main-layout'; // Boxed Layout dropshadow if ('boxed' == $main_layout && get_theme_mod('boxed_dropdshadow')) { $classes[] = 'wrap-boxshadow'; } // Content layout if (function_exists('wpex_get_post_layout_class')) { $classes[] = 'content-' . wpex_get_post_layout_class($post_id); } // Single Post cagegories if (is_singular('post')) { $cats = get_the_category($post_id); foreach ($cats as $cat) { $classes[] = 'post-in-category-' . $cat->category_nicename; } } // Breadcrumbs if (function_exists('wpex_breadcrumbs_enabled') && wpex_breadcrumbs_enabled() && 'default' == get_theme_mod('breadcrumbs_position', 'default')) { $classes[] = 'has-breadcrumbs'; } // Shrink fixed header if (get_theme_mod('shink_fixed_header', '1') && 'one' == get_theme_mod('header_style', 'one')) { $classes[] = 'shrink-fixed-header'; } // WooCommerce if (class_exists('Woocommerce') && is_shop()) { if (get_theme_mod('woo_shop_slider')) { $classes[] = 'page-with-slider'; } if (!get_theme_mod('woo_shop_title', '1')) { $classes[] = 'page-without-title'; } } // Widget Icons if (get_theme_mod('widget_icons', 'on')) { $classes[] = 'sidebar-widget-icons'; } // Mobile if (wp_is_mobile()) { $classes[] = 'is-mobile'; } // Overlay header style if (function_exists('wpex_is_overlay_header_enabled') && wpex_is_overlay_header_enabled($post_id)) { $classes[] = 'has-overlay-header'; } // Footer reveal if (function_exists('wpex_footer_reveal_enabled') && wpex_footer_reveal_enabled($post_id)) { $classes[] = 'footer-has-reveal'; } return $classes; }
if (!defined('ABSPATH')) { exit; } // Post ID $post_id = wpex_get_the_ID(); // Get header style to add to the logo classes $header_style = wpex_get_header_style(); // Logo Classes $classes = 'header-' . $header_style . '-logo'; // Set url for the logo with filter so it can be altered via a child theme $site_url = esc_url(home_url('/')); $logo_url = apply_filters('wpex_logo_url', $site_url); // Get logo img $logo_img = wpex_header_logo_img(); // Get overlay image url if (wpex_is_overlay_header_enabled($post_id) && ($overlay_logo = get_post_meta($post_id, 'wpex_overlay_header_logo', true))) { // Redux fallback until post is saved if (is_array($overlay_logo)) { if (!empty($overlay_logo['url'])) { $overlay_logo = $overlay_logo['url']; } else { $overlay_logo = false; } } if ($overlay_logo) { $classes .= ' has-overlay-logo'; } } // Get title for the logo based on the blogname & apply filters for easy customization $logo_title = get_bloginfo('name'); $logo_title = apply_filters('wpex_logo_title', $logo_title);
function wpex_header_classes($post_id = '') { // Post id $post_id = $post_id ? $post_id : wpex_get_the_id(); // Get header style $header_style = wpex_get_header_style($post_id); // Check if is mobile $is_mobile = wp_is_mobile(); // Fixed Header $fixed_header = get_theme_mod('fixed_header', true); // Setup classes array $classes = array(); // Clearfix class $classes['clr'] = 'clr'; // Main header style $classes['header_style'] = 'header-' . $header_style; // Sticky Header if (!$is_mobile && $fixed_header && 'one' == $header_style) { $classes['fixed_scroll'] = 'fixed-scroll'; } // Header Overlay Style if ($post_id && wpex_is_overlay_header_enabled($post_id)) { // Remove fixed scroll class unset($classes['fixed_scroll']); // Add overlay header class $classes['overlay_header'] = 'overlay-header'; // Add a fixed class for the overlay-header style only if (!$is_mobile && $fixed_header) { $classes['fix_on_scroll'] = 'fix-on-scroll'; } // Add overlay header style class if ($meta = get_post_meta($post_id, 'wpex_overlay_header_style', true)) { $overlay_style = $meta; } else { $overlay_style = 'light'; } $classes['overlay_header_style'] = $overlay_style . '-style'; } // Apply filters $classes = apply_filters('wpex_header_classes', $classes); // Echo classes as space seperated classes echo implode(' ', $classes); }
function wpex_advanced_styling() { // Get post id $post_id = wpex_get_the_id(); // Define main vars $css = ''; $add_css = ''; //$main_layout = wpex_main_layout( $post_id ); /*-----------------------------------------------------------------------------------*/ /* - Fixed Header Height /*-----------------------------------------------------------------------------------*/ $header_height = ''; if ('one' == get_theme_mod('header_style', 'one') && !wpex_is_overlay_header_enabled($post_id)) { $header_top_padding = intval(get_theme_mod('header_top_padding')); $header_bottom_padding = intval(get_theme_mod('header_bottom_padding')); $header_height = intval(get_theme_mod('header_height')); if ($header_height && '0' != $header_height && 'auto' != $header_height) { if ($header_top_padding || $header_bottom_padding) { $header_height_plus_padding = $header_height + $header_top_padding + $header_bottom_padding; } else { $header_height_plus_padding = $header_height + '60'; } $css .= '.header-one #site-header { height: ' . $header_height . 'px; } .header-one #site-navigation-wrap, .navbar-style-one .dropdown-menu > li > a{height:' . $header_height_plus_padding . 'px} .navbar-style-one .dropdown-menu > li > a{line-height:' . $header_height_plus_padding . 'px} .header-one #site-logo, .header-one #site-logo a{height:' . $header_height . 'px;line-height:' . $header_height . 'px}'; } } /*-----------------------------------------------------------------------------------*/ /* - Logo /*-----------------------------------------------------------------------------------*/ // Reset $add_css var $add_css = ''; // Logo top/bottom margins only if custom header height is empty if (!$header_height) { // Logo top margin $margin = intval(get_theme_mod('logo_top_margin')); if ('' != $margin && '0' != $margin) { if ($header_height && '0' != $header_height && 'auto' != $header_height && get_theme_mod('custom_logo', false, 'url')) { $add_css .= 'padding-top: ' . $margin . 'px;'; } else { $add_css .= 'margin-top: ' . $margin . 'px;'; } } // Logo bottom margin $margin = intval(get_theme_mod('logo_bottom_margin')); if ('' != $margin && '0' != $margin) { if ($header_height && '0' != $header_height && 'auto' != $header_height && get_theme_mod('custom_logo', false, 'url')) { $add_css .= 'padding-bottom: ' . $margin . 'px;'; } else { $add_css .= 'margin-bottom: ' . $margin . 'px;'; } } } // Logo max width $width = get_theme_mod('logo_max_width'); if ('' != $width && '0' != $width) { $add_css .= 'max-width: ' . $width . ';'; } // #site-logo css if ($add_css) { $css .= '#site-logo {' . $add_css . '}'; $add_css = ''; } /*-----------------------------------------------------------------------------------*/ /* - Other /*-----------------------------------------------------------------------------------*/ // Fix for Fonts In the Visual Composer $css .= '.wpb_row .fa:before {box-sizing:content-box!important;-moz-box-sizing:content-box!important;-webkit-box-sizing:content-box!important;}'; /*-----------------------------------------------------------------------------------*/ /* - Output CSS /*-----------------------------------------------------------------------------------*/ if ('' != $css && !empty($css)) { $css = '/*ADVANCED STYLING START*/' . $css; return $css; } }