[one_half padding=”0 25px 0 0″]We were working on a recent project where we had to figure out what day of the week it was and present something on the frontend of the website specifically for each day. The conditional script could be used to change any aspect of a website design based on the day of the week.

It is important to change the settings in WordPress under “Settings” > “General” and next to “Timezone” to be accurate to the timezone of your website. Once you do this, and use the code below, the script will accurately display or do whatever you echo in the php script. You can of course also use a php switch for this if you like.

Note about the timezone : we set the timezone directly in the script because working with server times and the WordPress timezone setting can be a little weird we’ve found, so it’s best to set the timezone directly.
[/one_half][one_half_last padding=”0 0px 0 0″]

date_default_timezone_set('America/New_York'); // Put your PHP supported timezone in place of America/New York
$script_tz = date_default_timezone_get();
// get current day:
$currentday = date('l');
if ($currentday == Monday){
echo '
Monday
'; } elseif ($currentday == Tuesday){ echo '
Tuesday
'; } elseif ($currentday == Wednesday){ echo '
Wednesday
'; } elseif ($currentday == Thursday){ echo '
Thursday
'; } elseif ($currentday == Friday){ echo '
Friday
'; } elseif ($currentday == Saturday){ echo '
Saturday
'; } elseif ($currentday == Sunday){ echo '
Sunday
'; } else{ //what, you were looking for other days? =/ }

[/one_half_last]

Latest from the Lab

Alliant Association Management: New Logo, Brand Identity and Website

A new logo, brand identity and website for Alliant Association Management, an HOA and
What the latest AI news means for your website

What the Latest AI News Means for Your Website

A plain-English roundup of the biggest AI news from September and October 2026, and
blank

Website Launch: SanibelCoyote.com for the City of Sanibel

We built SanibelCoyote.com for the City of Sanibel: an online coyote reporting tool, an
Accessible health care websites we remediated

WCAG 2.1 AA Website Accessibility for Health Centers and Government

The federal web accessibility deadlines moved to 2027 and 2028, but the WCAG 2.1