This commit is contained in:
Alexander Agnarson 2019-02-07 14:15:59 +01:00
parent ab2d46f862
commit db415c90c9
4 changed files with 34 additions and 11 deletions

View file

@ -546,15 +546,18 @@ if ( ! function_exists( 'boxstyle_body_class' ) ) {
function boxstyle_body_class( $classes ) {
$classes[] = boxstyle_layout_class();
// Scheme class.
$current_mode = 'light';
if ( isset( $_COOKIE['theme_mode'] ) && ! empty( $_COOKIE['theme_mode'] ) ) {
$current_mode = $_COOKIE['theme_mode'];
if ( get_theme_mod('light-dark-switch','off') =='on' ) {
// Scheme class.
$current_mode = 'light';
if ( isset( $_COOKIE['theme_mode'] ) && ! empty( $_COOKIE['theme_mode'] ) ) {
$current_mode = $_COOKIE['theme_mode'];
}
if ( 'dark' === $current_mode ) {
$classes[] = 'dark-mode';
}
}
if ( 'dark' === $current_mode ) {
$classes[] = 'dark-mode';
}
if ( get_theme_mod( 'boxed','off' ) != 'on' ) { $classes[] = 'full-width'; }
if ( get_theme_mod( 'boxed','off' ) == 'on' ) { $classes[] = 'boxed'; }
if ( has_nav_menu( 'topbar' ) ) { $classes[] = 'topbar-enabled'; }