WordPress at a glance

is_new_day() WP 1.0

Whether the publish date of the current post in the loop is different from the publish date of the previous post in the loop.

  • Global. String. $currentday The day of the current post in the loop.
  • Global. String. $previousday The day of the previous post in the loop.
Is the basis for: the_date()

No Hooks.

Return

Int. 1 when new day, 0 if not a new day.

Usage

is_new_day();

Code of is_new_day: wp-includes/functions.php VER 4.9.8

<?php
function is_new_day() {
	global $currentday, $previousday;
	if ( $currentday != $previousday )
		return 1;
	else
		return 0;
}

Related Functions

From tag: Conditional tags (all)

More from category: Queries

No comments
    Hello, !     Log In . Register