I’m not too sure if this is the correct forum for this post, please move if it isn’t.
I am trying to attach a class to the “body” tag that is time dependent. For example:
Between 04:00 - 12:00
<body class="morning">Between 12:00 - 20:00
<body class="day">Between 20:00 - 04:00
<body class="night">The code I have so far is (imediately after “</head>”):
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<!-- format HHMM -->
{preload_replace:MORNING='0400'}
{preload_replace:DAY='1200'}
{preload_replace:NIGHT='2000'}
{if '{current_time format="%H%i"}' >= '{MORNING}'}
<body class="morning">
{if:elseif '{current_time format="%H%i"}' >= '{DAY}'}
<body class="day">
{if:else '{current_time format="%H%i"}' >= '{NIGHT}'}
<body class="night">
{/if}
<!-- page content -->
<div id="container">
Test
</div><!-- end page content -->
</body>
</html>The result is a blank page. Does anyone know why this is not working or is there a more elegant way to achieve this with EE?
Regards