Skip to content

Sean Lang

Freelance WordPress Expert

  • Home
  • Clients
  • Blog

Category: Drupal

Posted on October 4, 2021

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

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

Recent Posts

  • Add the theme name as a body class in Drupal 8 or 9
  • Removing untracked files in GIT

Archives

  • October 2021

Categories

  • Drupal
  • Drupal 8
  • Drupal 9
  • GIT
  • Tips & Tricks

Contact Me

Phone: 07838279148

Email: sean@seanlang.co.uk

Proudly powered by WordPress