is_new_day()
Whether the publish date of the current post in the loop is different from the publish date of the previous post in the loop.
For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.
Used By: the_date()
No Hooks.
Return
Int
. 1 when new day, 0 if not a new day.
Usage
is_new_day();
Notes
- Global. String. $currentday The day of the current post in the loop.
- Global. String. $previousday The day of the previous post in the loop.
Changelog
Since 0.71 | Introduced. |
Code of is_new_day() is new day WP 5.9.3
function is_new_day() { global $currentday, $previousday; if ( $currentday !== $previousday ) { return 1; } else { return 0; } }