$classes[] = 'no-js';
// Adds `singular` to singular pages, and `hfeed` to all other pages.
$classes[] =
is_singular() ? 'singular' : 'hfeed';
// Add a body class if main navigation is active.
if ( has_nav_menu( 'primary'
) ) { $classes[] = 'has-main-navigation';
} // Add a body class if there are no footer widgets.
if ( !
is_active_sidebar( 'sidebar-1'
) ) { $classes[] = 'no-widgets';
} return $classes;
}add_filter( 'body_class', 'twenty_twenty_one_body_classes'
);
/**
* Adds custom class to the array of posts classes.
*
* @since Twenty Twenty-One 1.0
*
* @param array $classes An array of CSS classes.
* @return array
*/