How can I make chosen page to display as homepage of my multisite site depending on a week day? I have this function to display my page depending if user is logged in or not, next I want it to work differently during tuesday (picking different pages as follows):
function switch_homepage() {
if ( is_main_site() ) {
// Do stuff only for the main site
if ( is_user_logged_in() ) {
$page = 4284; // for logged in users
update_option( 'page_on_front', $page );
update_option( 'show_on_front', 'page' );
} else {
$page = 4133; // for logged out users
update_option( 'page_on_front', $page );
update_option( 'show_on_front', 'page' );
}
}
}