mirror of
https://ghproxy.net/https://github.com/AlxMedia/boxstyle.git
synced 2025-08-26 16:44:24 +08:00
Fix toggle icon saved body class
This commit is contained in:
parent
1742228e1b
commit
d4ee29bbae
2 changed files with 16 additions and 8 deletions
|
@ -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' );
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue