function presscore_body_class($classes) { $config = Presscore_Config::get_instance(); $desc_on_hoover = 'under_image' != $config->get('post.preview.description.style'); $template = $config->get('template'); $layout = $config->get('layout'); /////////////////////// // template classes // /////////////////////// switch ($template) { case 'blog': $classes[] = 'blog'; break; case 'portfolio': $classes[] = 'portfolio'; break; case 'team': $classes[] = 'team'; break; case 'testimonials': $classes[] = 'testimonials'; break; case 'archive': $classes[] = 'archive'; break; case 'search': $classes[] = 'search'; break; case 'albums': $classes[] = 'albums'; break; case 'media': $classes[] = 'media'; break; case 'microsite': $classes[] = 'one-page-row'; break; } ///////////////////// // layout classes // ///////////////////// switch ($layout) { case 'masonry': if ($desc_on_hoover) { $classes[] = 'layout-masonry-grid'; } else { $classes[] = 'layout-masonry'; } break; case 'grid': $classes[] = 'layout-grid'; if ($desc_on_hoover) { $classes[] = 'grid-text-hovers'; } break; case 'checkerboard': case 'list': case 'right_list': $classes[] = 'layout-list'; break; } //////////////////// // hover classes // //////////////////// if (in_array($layout, array('masonry', 'grid')) && !in_array($template, array('testimonials', 'team'))) { $classes[] = $desc_on_hoover ? 'description-on-hover' : 'description-under-image'; } ////////////////////////////////////// // hide dividers if content is off // ////////////////////////////////////// if (in_array($config->get('template'), array('albums', 'portfolio')) && 'masonry' == $config->get('layout')) { $show_dividers = $config->get('show_titles') || $config->get('show_details') || $config->get('show_excerpts') || $config->get('show_terms') || $config->get('show_links'); if (!$show_dividers) { $classes[] = 'description-off'; } } ///////////////////// // single classes // ///////////////////// if (is_single() && (post_password_required() || !comments_open() && '0' == get_comments_number())) { $classes[] = 'no-comments'; } //////////////////////// // header background // //////////////////////// if (presscore_mixed_header_with_top_line()) { $classes[] = 'header-top-line-active'; } if (presscore_header_with_bg() && (presscore_mixed_header_with_top_line() || !presscore_header_layout_is_side())) { switch ($config->get('header_background')) { case 'overlap': $classes['header_background'] = 'overlap'; break; case 'transparent': $classes['header_background'] = 'transparent'; if ('light' === $config->get('header.transparent.color_scheme')) { $classes[] = 'light-preset-color'; } break; } if ($config->get_bool('header.slideshow.header_below') && 'slideshow' === $config->get('header_title') && in_array($config->get('header_background'), array('transparent', 'normal'))) { $classes[] = 'floating-navigation-below-slider'; } } /////////////////// // header title // /////////////////// if ('fancy' == $config->get('header_title')) { $classes[] = 'fancy-header-on'; } elseif ('slideshow' == $config->get('header_title')) { $classes[] = 'slideshow-on'; if ('3d' == $config->get('slideshow_mode') && 'fullscreen-content' == $config->get('slideshow_3d_layout')) { $classes[] = 'threed-fullscreen'; } if (dt_get_paged_var() > 1 && isset($classes['header_background'])) { unset($classes['header_background']); } } elseif (is_single() && 'disabled' == $config->get('header_title')) { $classes[] = 'title-off'; } /////////////////// // hover style // /////////////////// switch ($config->get('template.images.hover.style')) { case 'grayscale': $classes[] = 'filter-grayscale-static'; break; case 'gray_color': $classes[] = 'filter-grayscale'; break; case 'blur': $classes[] = 'image-blur'; break; case 'scale': $classes[] = 'scale-on-hover'; break; } // default hover icons switch ($config->get('template.images.hover.icon')) { case 'none': $classes[] = 'disabled-hover-icons'; break; case 'small_corner': $classes[] = 'small-hover-icons'; break; case 'big_center': $classes[] = 'large-hover-icons'; break; } if ($config->get('template.images.hover.animation')) { $classes[] = 'click-effect-on-img'; } //////////// // boxed // //////////// if ('boxed' == $config->get('template.layout')) { $classes[] = 'boxed-layout'; } ///////////////////// // responsiveness // ///////////////////// if (!presscore_responsive()) { $classes[] = 'responsive-off'; } ///////////////////// // justified grid // ///////////////////// if ($config->get('justified_grid')) { $classes[] = 'justified-grid'; } //////////////////// // header layout // //////////////////// switch ($config->get('header.position')) { case 'right': $classes[] = 'header-side-right'; break; case 'left': $classes[] = 'header-side-left'; break; } switch ($config->get('header.layout')) { case 'slide_out': $classes[] = 'sticky-header'; break; case 'overlay': $classes[] = 'overlay-navigation'; break; } switch ($config->get('header.layout.slide_out.animation')) { case 'fade': $classes[] = 'fade-header-animation'; break; case 'move': $classes[] = 'move-header-animation'; break; case 'slide': $classes[] = 'slide-header-animation'; break; } if ('side_line' === $config->get('header.mixed.view')) { $classes[] = 'header-side-line'; switch ($config->get('header.mixed.view.side_line.position')) { case 'above': $classes[] = 'header-above-side-line'; break; case 'under': $classes[] = 'header-under-side-line'; break; } } if ($config->get('header.layout.slide_out.x_cursor.enabled')) { $classes[] = 'overlay-cursor-on'; } ////////////////////// // accent gradient // ////////////////////// if ('gradient' == $config->get('template.accent.color.mode')) { $classes[] = 'accent-gradient'; } ////////////////////////////// // srcset based hd images // ////////////////////////////// if (presscore_is_srcset_based_retina() || presscore_is_logos_only_retina()) { $classes[] = 'srcset-enabled'; } /////////////// // buttons // /////////////// // buttons style switch ($config->get('buttons.style')) { case '3d': $classes[] = 'btn-3d'; break; case 'flat': $classes[] = 'btn-flat'; break; case 'material': $classes[] = 'btn-material'; break; case 'ios7': default: $classes[] = 'btn-ios'; break; } // buttons text color switch ($config->get('buttons.text.color')) { case 'accent': $classes[] = 'accent-btn-color'; break; case 'color': $classes[] = 'custom-btn-color'; break; } // buttons hover text color switch ($config->get('buttons.hover.text.color')) { case 'accent': $classes[] = 'accent-btn-hover-color'; break; case 'color': $classes[] = 'custom-btn-hover-color'; break; } if ($config->get('template.footer.background.slideout_mode')) { $classes[] = 'footer-overlap'; } //////////////////////// // content boxes bg // //////////////////////// switch ($config->get('template.content.boxes.background.decoration')) { case 'shadow': $classes[] = 'shadow-element-decoration'; break; case 'outline': $classes[] = 'outline-element-decoration'; break; } //////////////////// // filter style // //////////////////// switch ($config->get('template.posts_filter.style')) { case 'ios': $classes[] = 'filter-style-ios'; break; case 'minimal': $classes[] = 'filter-style-minimal'; break; case 'material': $classes[] = 'filter-style-material'; break; } ////////////////////////// // contact form style // ////////////////////////// switch ($config->get('template.contact_form.style')) { case 'ios': $classes[] = 'contact-form-ios'; break; case 'minimal': $classes[] = 'contact-form-minimal'; break; case 'material': $classes[] = 'contact-form-material'; break; } /////////////////////// // fancy date size // /////////////////////// if ('small' == $config->get('post.fancy_date.size')) { $classes[] = 'small-fancy-datas'; } else { $classes[] = 'large-fancy-datas'; } if ($config->get_bool('header.layout.slide_out.blur.enabled')) { $classes[] = 'blur-page'; } /////////////////////////////// // slideshow bullets style // /////////////////////////////// switch ($config->get('slideshow.bullets.style')) { case 'transparent': $classes[] = 'semitransparent-bullets'; break; case 'accent': $classes[] = 'accent-bullets'; break; case 'outline': $classes[] = 'outlines-bullets'; break; } /////////////////// // icons style // /////////////////// switch ($config->get('template.icons.style')) { case 'bold': $classes[] = 'bold-icons'; break; case 'light': $classes[] = 'light-icons'; break; } ///////////////////// // floating menu // ///////////////////// if ($config->get('header.floating_navigation.enabled')) { $classes[] = presscore_array_value($config->get('header.floating_navigation.style'), array('fade' => 'phantom-fade', 'slide' => 'phantom-slide', 'sticky' => 'phantom-sticky')); $classes[] = presscore_array_value($config->get('header.floating_navigation.decoraion'), array('disabled' => 'phantom-disable-decoration', 'shadow' => 'phantom-shadow-decoration', 'line' => 'phantom-line-decoration')); $classes[] = presscore_array_value($config->get('header.floating_navigation.logo.style'), array('custom' => 'phantom-custom-logo-on', 'main' => 'phantom-main-logo-on', 'none' => 'phantom-logo-off')); } $classes[] = presscore_array_value($config->get('header.mobile.floatin_navigation'), array('sticky' => 'sticky-mobile-header', 'menu_icon' => 'floating-mobile-menu-icon')); //////////////////////////////////// // Sidebar and footer on mobile // //////////////////////////////////// if ('disabled' != $config->get('sidebar_position') && $config->get('sidebar_hide_on_mobile')) { $classes[] = 'mobile-hide-sidebar'; } if ($config->get('footer_show') && $config->get('footer_hide_on_mobile')) { $classes[] = 'mobile-hide-footer'; } if (in_array($config->get('header.layout'), array('classic', 'inline', 'split'))) { $classes[] = 'top-header'; } // mobile logo $classes[] = presscore_array_value($config->get('header.mobile.logo.first_switch.layout'), array('left_right' => 'first-switch-logo-right first-switch-menu-left', 'left_center' => 'first-switch-logo-center first-switch-menu-left', 'right_left' => 'first-switch-logo-left first-switch-menu-right', 'right_center' => 'first-switch-logo-center first-switch-menu-right')); $classes[] = presscore_array_value($config->get('header.mobile.logo.second_switch.layout'), array('left_right' => 'second-switch-logo-right second-switch-menu-left', 'left_center' => 'second-switch-logo-center second-switch-menu-left', 'right_left' => 'second-switch-logo-left second-switch-menu-right', 'right_center' => 'second-switch-logo-center second-switch-menu-right')); if ('right' === $config->get('header.mobile.menu.align')) { $classes[] = 'right-mobile-menu'; } ///////////// // return // ///////////// return array_values(array_unique($classes)); }
/** * Determine is header transparent. * * @since 3.0.0 * @return boolean */ function presscore_header_is_transparent() { return presscore_header_with_bg() && 'transparent' === presscore_config()->get('header_background'); }