is_new_day()
is_new_day()
确定循环中当前文章的发布日期是否与循环中上一篇文章的发布日期不同。
Determines whether the publish date of the current post in the loop is different from the publish date of the previous post in the loop.
说明(Description)
有关此主题函数和类似主题函数的更多信息,请参阅主题开发人员手册中的条件标记文章。
返回(Return)
(int)新的一天时为1,如果不是新的一天,则为0。
源码(Source)
/** * Whether the publish date of the current post in the loop is different from the * publish date of the previous post in the loop. * * @since 0.71 * * @global string $currentday The day of the current post in the loop. * @global string $previousday The day of the previous post in the loop. * * @return int 1 when new day, 0 if not a new day. */ function is_new_day() { global $currentday, $previousday; if ( $currentday != $previousday ) return 1; else return 0; }
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
0.71 | wp-includes/functions.php:962 | 1 function | 0 |
is_new_day() 为WP2原创文章,链接:https://www.wp2.cn/functions/is_new_day/