Hello everyone,
I’m trying to change a website from K3 to K4 and I want to implement a field to be able to change the color of the whole website background through the panel. I’m trying to use the new color field and although I see it in the panel, the color I choose is not reflected in my code when I inspect it, the background-colour is empty.
Here’s what I tried:
I added to my header snippet this code inside the head tag but it’s not working. Can someone point me in the right direction, I tried to search here on the forum but didn’t find anything otherwise I will need to use a plugin which doesn’t make any sense since I want to update to K4
code:
<?php if ($background = $page->color()) : ?>
<style type="text/css">
body {
background-color: <?php echo $background ?>;
}
</style>
<?php endif; ?>