How do I display different web page content based on day of week?
How do I display different web page content based on the day of the week?
Here’s a simple PHP script that will allow you to do just that. It wasn’t written or coded by me, it was just something i come across while searching so thought i would share it. Not sure how dirty / clean the code is:
< ?php
if( date( 'w' ) == 0 ) {
?>
} if( date( 'w' ) == 1 ) { ?>
}
?>
if( date( 'w' ) == 2 ) {
?>
}
?>
if( date( 'w' ) == 3 ) {
?>
}
?>
if( date( 'w' ) == 4 ) {
?>
}
?>
if( date( 'w' ) == 5 ) {
?>
}
?>
if( date( 'w' ) == 6 ) {
?>
}
?>
*Note: Remove space in start of php statement. This was needed to ensure all code pasted correctly in WordPress.