• pawelpoz

    (@pawelpoz)


    Hi, how to add class to Gutenberg editor after changing page template in WordPress? I would like to change the background color for the entire editor when the appropriate template is selected. Unfortunately changing the template doesn’t add any classes to the editor. How to change it?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You could add an onchange event listener to the template selection element. Then have JavaScript add a class attribute to other DOM elements with element.classList.add();

Viewing 1 replies (of 1 total)
  • The topic ‘How to add class to Gutenberg editor after changing page template in WordPress’ is closed to new replies.