• We have a chat feature and the chat operator checks out at 7pm each day. The graphic linking to the chat feature is in a text widget on the sidebar and I have to remove that widget manually each day at 7pm. Is there any sort of WP hack where I can get that text widget removed automatically at 7pm each day?

Viewing 1 replies (of 1 total)
  • I would like to add a big ‘I am new to this’ disclaimer here, but might it be possible to edit your widget or widget area along these lines?

    $blogtime = current_time('mysql');
    list( $today_year, $today_month, $today_day, $hour, $minute, $second ) = preg_split( '([^0-9])', $blogtime );
    
    if ( $hour > 09 && $hour < 19 ) {
    	// Load chat link
    } else {
    	// Don't load anything
    }

    Changing $hour > 09 to reflect whatever time you want to turn the widget back on.

Viewing 1 replies (of 1 total)
  • The topic ‘Need to remove a text widget at a specific time each day’ is closed to new replies.