Hi @spikerrbg,
The plugin does not support this functionality. However here is a custom code for you to achieve what you need. Place the following in the functions.php of your child theme:
function wpdts_opened_closed( $atts, $content ='' ) {
// open time
$hm_open = '10:00';
// close time
$hm_close = '16:00';
// time format (default or custom)
$format = get_option( 'time_format' );
// current timestamp for hour and minute
$ts_now = strtotime( date ('G:i', current_time( 'timestamp', false ) ) );
// open timestamp for hour and minute
$ts_open = strtotime( date( $hm_open, $ts_now ) );
// close timestamp for hour and minute
$ts_close = strtotime( date( $hm_close, $ts_now ) );
// check if work time
if ( $ts_now < $ts_open || $ts_now > $ts_close ) {
$color = '#800'; // closed color
}
else {
$color = '#080'; // opened color
}
return '<span style="color:' . $color. ';">' . date( $format, $ts_now ) . '</span>';
}
add_shortcode( 'wpdts-colored-time', 'wpdts_opened_closed' );
Then you can use the shortcode [wpdts-colored-time]
to show the current time in the default WordPress format.
You can modify the open and close time, the display format, color codes, or other part of the code as you wish.
Please let us know if that worked for you.
PS: You do not need the WPDTS plugin installed to use this function but you can keep the plugin installed if you need it for other purposes.