예제 #1
0
/**
 * Adds classes to the body tag
 *
 * @package Total WordPress Theme
 * @subpackage Framework
 * @version 3.3.0
 */
function wpex_body_classes($classes)
{
    // Save some vars
    $main_layout = wpex_global_obj('main_layout');
    $header_style = wpex_global_obj('header_style');
    $post_layout = wpex_global_obj('post_layout');
    $post_id = wpex_global_obj('post_id');
    // RTL
    if (is_RTL()) {
        $classes[] = 'rtl';
    }
    // Customizer
    if (is_customize_preview()) {
        $classes[] = 'is_customize_preview';
    }
    // Main class
    $classes[] = 'wpex-theme';
    // Responsive
    if (wpex_global_obj('responsive')) {
        $classes[] = 'wpex-responsive';
    }
    // Layout Style
    $classes[] = $main_layout . '-main-layout';
    // Add skin to body classes
    $classes[] = 'skin-' . wpex_global_obj('skin');
    // Vertical header style
    if ('six' == $header_style) {
        $classes[] = 'wpex-has-vertical-header';
        if ('fixed' == wpex_get_mod('vertical_header_style')) {
            $classes[] = 'wpex-fixed-vertical-header';
        }
    }
    // Check if the Visual Composer is being used on this page
    if (wpex_global_obj('has_composer')) {
        $classes[] = 'has-composer';
    } else {
        $classes[] = 'no-composer';
    }
    // Live site class
    if (!wpex_global_obj('vc_is_inline')) {
        $classes[] = 'wpex-live-site';
    }
    // Boxed Layout dropshadow
    if ('boxed' == $main_layout && wpex_get_mod('boxed_dropdshadow') && 'gaps' != wpex_global_obj('skin')) {
        $classes[] = 'wrap-boxshadow';
    }
    // Sidebar enabled
    if ('left-sidebar' == $post_layout || 'right-sidebar' == $post_layout) {
        $classes[] = 'has-sidebar';
    }
    // Content layout
    if ($post_layout) {
        $classes[] = 'content-' . $post_layout;
    }
    // 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 (wpex_global_obj('has_breadcrumbs')) {
        $classes[] = 'has-breadcrumbs';
        $classes[] = 'breadcrumbs-position-' . wpex_get_mod('breadcrumbs_position', 'default');
    }
    // Topbar
    if (wpex_global_obj('has_top_bar')) {
        $classes[] = 'has-topbar';
    }
    // Widget Icons
    if (wpex_get_mod('has_widget_icons', true)) {
        $classes[] = 'sidebar-widget-icons';
    }
    // Overlay header style
    if (wpex_global_obj('has_overlay_header')) {
        $classes[] = 'has-overlay-header';
    }
    // Footer reveal
    if (wpex_global_obj('has_footer_reveal')) {
        $classes[] = 'footer-has-reveal';
    }
    // Slider
    if (wpex_global_obj('has_post_slider')) {
        $classes[] = 'page-with-slider';
    }
    // No header margin
    if ('on' == get_post_meta($post_id, 'wpex_disable_header_margin', true)) {
        $classes[] = 'no-header-margin';
    }
    // Title with Background Image
    if ('background-image' == wpex_global_obj('page_header_style')) {
        $classes[] = 'page-with-background-title';
    }
    // Disabled header
    if (!wpex_global_obj('has_page_header')) {
        $classes[] = 'page-header-disabled';
    }
    // Disabled main header
    if (!wpex_global_obj('has_header')) {
        $classes[] = 'wpex-site-header-disabled';
    }
    // Page slider
    if (wpex_global_obj('has_post_slider') && ($slider_position = wpex_global_obj('post_slider_position'))) {
        $classes[] = 'has-post-slider';
        $slider_position = str_replace('_', '-', $slider_position);
        $classes[] = 'post-slider-' . $slider_position;
    }
    // Font smoothing
    if (wpex_get_mod('enable_font_smoothing')) {
        $classes[] = 'smooth-fonts';
    }
    // Mobile menu toggle style
    $classes[] = 'wpex-mobile-toggle-menu-' . wpex_global_obj('mobile_menu_toggle_style');
    // Mobile menu style
    if ('disabled' == wpex_global_obj('mobile_menu_style')) {
        $classes[] = 'mobile-menu-disabled';
    } else {
        $classes[] = 'has-mobile-menu';
    }
    // Fixed Footer - adds min-height to main wraper
    if (wpex_get_mod('fixed_footer', false)) {
        $classes[] = 'wpex-has-fixed-footer';
    }
    // Navbar inner span bg
    if (wpex_get_mod('menu_link_span_background')) {
        $classes[] = 'navbar-has-inner-span-bg';
    }
    // Check if avatars are enabled
    if (is_singular() && !get_option('show_avatars')) {
        $classes[] = 'comment-avatars-disabled';
    }
    // Return classes
    return $classes;
}
예제 #2
0
 /**
  * Loads RTL stylesheet
  *
  * @since 1.6.0
  */
 public static function rtl_css()
 {
     if (is_RTL()) {
         wp_enqueue_style('wpex-rtl', WPEX_CSS_DIR_URI . 'rtl.css', false, WPEX_THEME_VERSION);
     }
 }
    /**
     * Add inline style to front and back-end pages (as WP does) if admin bar is
     * showing.
     *
     * Most of the CSS here is for modern browsers - the use of attribute
     * selectors, child selectors, generated content and so on will likely kill
     * semi-older browsers, but the effects here (adding a "new tab" indicator)
     * are non-critical.
     *
     * @since 1.0.0
     */
    function style()
    {
        if (!is_admin_bar_showing()) {
            return;
        }
        ?>
<style type="text/css">
			#wpadminbar a[target=_blank]:after,
			#wpadminbar .menupop a[target=_blank] span:after {
				background: url(data:image/gif;base64,R0lGODlhBwAIAKIEAM7Ozt7e3u/v7729rf///wAAAAAAAAAAACH5BAEAAAQALAAAAAAHAAgAAAMUSEoCsyqAOQMDERPMld7eolGTkgAAOw%3D%3D) center left no-repeat;
				display: inline-block;
				content: "";
				height: 8px;
				margin-bottom: 1px;
				margin-left: 5px;
				width: 7px;
			}
			#wpadminbar .menupop>a[target=_blank]:after {
				display: none;
			}
			#wpadminbar .gabp-no-link>a {
				cursor: default;
			}
			<?php 
        if (defined('GENESIS_SETTINGS_FIELD')) {
            ?>
			#wpadminbar .gabp-icon-genesis>a span {
				padding-left: 20px;
			}
			#wpadminbar .gabp-icon-genesis {
				position: relative;
			}
			#wpadminbar .gabp-icon {
				background: url(<?php 
            echo PARENT_URL;
            ?>
/images/genesis.gif) center center no-repeat;
				display: block;
				height: 16px;
				left: 0.85em;
				position: absolute;
				top: 0.5em;
				width: 16px;
			}
			<?php 
            if (is_RTL()) {
                ?>
			#wpadminbar a[target=_blank]:after,
			#wpadminbar .menupop a[target=_blank] span:after {
				background-position: center right;
				margin-left: 0;
				margin-right: 5px;
			}
			#wpadminbar .gabp-icon {
				left: auto;
				right: 0.85em;
			}
			#wpadminbar .gabp-icon-genesis>a span {
				padding-right: 20px !important;
			}
			<?php 
            }
        }
        ?>
		</style>
		<?php 
    }
 /**
  * Returns all CSS needed for the front-end
  *
  * @since 1.6.0
  */
 public static function theme_css()
 {
     // Front end only
     if (is_admin()) {
         return;
     }
     // Define dir
     $dir = WPEX_CSS_DIR_URI;
     $theme_version = WPEX_THEME_VERSION;
     // Remove other font awesome scripts
     wp_deregister_style('font-awesome');
     wp_deregister_style('fontawesome');
     // Load font awesome script everywhere except the front-end composer because the js_composer already adds it
     wp_enqueue_style('wpex-font-awesome', $dir . 'font-awesome.min.css', false, '4.3.0');
     // Register hover-css
     wp_register_style('wpex-hover-animations', $dir . 'hover-css.min.css', false, '2.0.1');
     // LayerSlider
     if (WPEX_LAYERSLIDER_ACTIVE) {
         wp_enqueue_style('wpex-layerslider', $dir . 'wpex-layerslider.css', false, $theme_version);
     }
     // Main Style.css File
     wp_enqueue_style('wpex-style', get_stylesheet_uri(), false, $theme_version);
     // Load RTL.css if enabled
     if (is_RTL()) {
         wp_enqueue_style('wpex-rtl', $dir . 'rtl.css', array('wpex-style'), false);
     }
 }