You need to pass a strtotime()
compatible string or an array instead of 'today'
.
You have several options…
- You could change
'today'
to'now'
. This will use the current time not midnight last night. - You could change
'today'
to'today + 1 day'
. This will be the end of today. Not exactly what you are asking for but worth mentioning. - You could generate it with PHP like
date('d-m-Y H:i:s')
. This is unnecessary extra work since it will need to be parsed just like'now'
.
Of all of these options, 1 is the simplest and most comprehendable.
Documentation
https://developer.wordpress.org/reference/classes/wp_query/#date-parameters