Fix toggle icon saved body class

This commit is contained in:
Alexander Agnarson 2019-02-07 12:24:32 +01:00
parent 1742228e1b
commit d4ee29bbae
2 changed files with 16 additions and 8 deletions

View file

@ -542,9 +542,18 @@ if ( ! function_exists( 'boxstyle_get_featured_post_ids' ) ) {
/* Body class
/* ------------------------------------ */
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 ( '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'; }
@ -554,7 +563,6 @@ if ( ! function_exists( 'boxstyle_body_class' ) ) {
if (! ( is_user_logged_in() ) ) { $classes[] = 'logged-out'; }
return $classes;
}
}
add_filter( 'body_class', 'boxstyle_body_class' );

View file

@ -2,7 +2,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Boxstyle\n"
"POT-Creation-Date: 2019-02-06 13:20+0100\n"
"POT-Creation-Date: 2019-02-07 12:24+0100\n"
"PO-Revision-Date: 2018-09-21 21:27+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -133,23 +133,23 @@ msgstr ""
msgid "Footer 4"
msgstr ""
#: functions.php:704
#: functions.php:716
msgid "Alx Extensions"
msgstr ""
#: functions.php:708
#: functions.php:720
msgid "Meta Box"
msgstr ""
#: functions.php:712
#: functions.php:724
msgid "Regenerate Thumbnails"
msgstr ""
#: functions.php:716
#: functions.php:728
msgid "WP-PageNavi"
msgstr ""
#: functions.php:720
#: functions.php:732
msgid "Responsive Lightbox"
msgstr ""