Skip to content

Add the theme name as a body class in Drupal 8 or 9

By Sean Lang

function TEMPLATE_preprocess_html(&$variables) {
$variables['attributes']['class'][] = \Drupal::service('theme.manager')->getActiveTheme()->getName();
}

Latest Blog Posts

Latest Projects

WordPress Website Revamp - BeReal.

WordPress Website Revamp – BeReal.

BeReal is a revolutionary social networking app that prioritises authentic connections and genuine interactions. Unlike traditional platforms, BeReal encourages users to share their true selves, free from judgment or pressure to conform.

View Project

What my clients say