/**
* Add a body class based on the active page template.
*
* @param array $classes Existing body classes.
* @return array
*/
function mytheme_template_body_class( $classes ) {
if ( is_page_template( 'templates/template-landing.php' ) ) {
$classes[] = 'template-landing';
}
if ( is_page_template( 'templates/template-full-width.php' ) ) {
$classes[] = 'template-full-width';
}
return $classes;
}
add_filter( 'body_class', 'mytheme_template_body_class' );