Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
320 views
in Themes by
How to add custom class to body tag of snowflat theme?

1 Answer

0 votes
by

Override the function body_tags() in your theme, e.g. like this:

public function body_tags() {
  $class = 'qa-template-' . qa_html($this->template);
  $class .= empty($this->theme) ? '' : ' qa-theme-' . qa_html($this->theme);

  if (isset($this->content['categoryids'])) {
    foreach ($this->content['categoryids'] as $categoryid) {
      $class .= ' qa-category-' . qa_html($categoryid);
    }
  }

  $class .= ' your-class-here';

  $this->output('class="' . $class . ' qa-body-js-off"');
}

...