Site logo

Archived topic

Add class to body when merge header is active

5 replies · Started by Markus on October 27, 2022

Viewing posts 1–6 of 6

Hello, I need to make adjustments (set color on svg logo etc.) to the header depending on if a merge header element is used on the page. I was thinking of adding a class to the body and added a script snippet directly in the page hero content like so:


<script>
	document.body.classList.add('merge-header');
</script>

It works but this creates the page-hero section in the top of the page which seems a bit unnecessary when Gutenberg is being used. Is there another way to detect if the header merge element is used and then filter the body class?

Ahh, I see! That works for me, I can use that class to add adjustments. Providing a link in the private information for reference.

Hi there,

did you get this working ? As the topic has been marked as resolved ( Which auto deletes any Private Info ).
If you still need assistance , please add the URL back in the private info.

Hi, thanks for your reply and fast support. I got it working with the .header-wrap class!

Glad to hear that!

This archived topic is closed to new replies.