[wp-hackers] Is today a new day?! - is_new_day()

John Blackbourn johnbillion+wp at gmail.com
Thu May 20 16:17:43 UTC 2010


It's worth noting that is_new_day() doesn't actually work as expected
in a default loop. Possibly a bug. It's not used anywhere in core
though.

On Thu, May 20, 2010 at 4:49 PM, Otto <otto at ottodestruct.com> wrote:
> Or you could use the_time(). Which is the same as the_date() but
> doesn't have the day logic.
>
> If get_the_date() is ignoring the day logic, then that's a bug. It's
> supposed to do the same thing as the_date() in this respect.
>
> -Otto
>
>
>
> On Thu, May 20, 2010 at 10:05 AM, Jeremy Clarke <jer at simianuprising.com> wrote:
>> For anyone who's run into the strangeness around the_date() before its
>> worth noting that in 3.0 it's logic is broken into two functions:
>> get_the_date() can be used in the loop to just get the damn date,
>> while the_date() continues to follow the is_new_day() logic and only
>> shows once on the first post for that day.
>>
>> So if you wanted to show the date on every post using the standard
>> formatting from the Settings > General page (I know, its crazy right?)
>> you can use
>>
>>  echo get_the_date()
>>
>> --
>> Jeremy Clarke | http://jeremyclarke.org
>> Code and Design | http://globalvoicesonline.org
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list