Пример #1
0
 function wpex_display_breadcrumbs($post_id = '')
 {
     // Get post id
     $post_id = $post_id ? $post_id : wpex_get_the_id();
     // Check if breadcrumbs are disabled
     if (!wpex_breadcrumbs_enabled($post_id)) {
         return;
     }
     // Yoast breadcrumbs
     $yoast_options = get_option('wpseo_internallinks');
     if (function_exists('yoast_breadcrumb') && $yoast_options['breadcrumbs-enable'] === true) {
         return yoast_breadcrumb('<nav class="site-breadcrumbs clr">', '</nav>');
     } else {
         echo wpex_breadcrumbs($post_id);
     }
 }
Пример #2
0
 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;
 }
 function wpex_body_classes($classes)
 {
     // WPExplorer class
     $classes[] = 'wpex-theme';
     // Responsive
     $responsive = wpex_option('responsive', '1');
     if ($responsive == '1') {
         $classes[] = 'wpex-responsive';
     }
     // Add skin to body classes
     if (function_exists('wpex_active_skin')) {
         $site_theme = wpex_active_skin();
         if ($site_theme) {
             $classes[] = 'theme-' . $site_theme;
         }
     }
     // Page with Slider or header
     if (is_singular()) {
         global $post;
         $post_id = $post->ID;
         $slider = get_post_meta($post_id, 'wpex_post_slider_shortcode', true);
         $title_style = get_post_meta($post_id, 'wpex_post_title_style', true);
         if ($slider) {
             $classes[] = 'page-with-slider';
         }
         if ($title_style == 'background-image') {
             $classes[] = 'page-with-background-title';
         }
     }
     // Layout Style
     if (is_singular()) {
         global $post;
         $meta = get_post_meta($post->ID, 'wpex_main_layout', true);
         if ($meta == 'boxed') {
             $classes[] = $meta . '-main-layout';
         } else {
             $classes[] = wpex_option('main_layout_style', 'full-width') . '-main-layout';
         }
     } else {
         $classes[] = wpex_option('main_layout_style', 'full-width') . '-main-layout';
     }
     // Remove header bottom margin
     if (is_singular()) {
         global $post;
         $disable_header_margin = get_post_meta($post->ID, 'wpex_disable_header_margin', true);
         if ('on' == $disable_header_margin) {
             $classes[] = 'no-header-margin';
         }
     }
     // Check if breadcrumbs are enabled
     if (function_exists('wpex_breadcrumbs_enabled')) {
         if (wpex_breadcrumbs_enabled() && 'default' == wpex_option('breadcrumbs_position', 'default')) {
             $classes[] = 'has-breadcrumbs';
         }
     }
     // Shrink fixed header
     if (wpex_option('shink_fixed_header', '1') && 'one' == wpex_option('header_style', '1')) {
         $classes[] = 'shrink-fixed-header';
     }
     // Single Post cagegories
     if (is_singular('post')) {
         global $post;
         $cats = get_the_category($post->ID);
         foreach ($cats as $c) {
             $classes[] = 'post-in-category-' . $c->category_nicename;
         }
     }
     // WooCommerce
     if (class_exists('Woocommerce')) {
         if (wpex_option('woo_shop_slider') !== '' && is_shop()) {
             $classes[] = 'page-with-slider';
         }
         if (wpex_option('woo_shop_title', '1') !== '1' && is_shop()) {
             $classes[] = 'page-without-title';
         }
     }
     // Widget Icons
     if (wpex_option('widget_icons', '1') == '1') {
         $classes[] = 'sidebar-widget-icons';
     }
     // Mobile
     if (wp_is_mobile()) {
         $classes[] = 'is-mobile';
     }
     return $classes;
 }