WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 months ago

#8532 closed defect (bug) (invalid)

the_date() doesn't function as intended

Reported by: matt Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Date/Time Keywords:
Focuses: template Cc:

Description

If my memory serves the idea behind the_date was that it would echo out the date, but only if it was different than the previous item it echoed out in the loop, which would be handy for doing things like day headers in index templates or month headers in archives.

At some point this seems to have been lost, I think because some variable names changed.

This restores the_date to its original behaviour.

Attachments (2)

the_date.diff (1.4 KB) - added by matt 6 years ago.
8532.002.diff (1.4 KB) - added by markjaquith 6 years ago.

Download all attachments as: .zip

Change History (15)

@matt6 years ago

@markjaquith6 years ago

comment:1 @markjaquith6 years ago

Refreshed the patch. FWIW, I'm not sure this was ever the way it functioned. I think it's always functioned that it'd echo out only for new days, not a change in output. I do, however, think that what you've proposed is useful.

comment:2 @MichaelH6 years ago

This note at http://codex.wordpress.org/Template_Tags/the_date is the premise we've used for a number of years in answering questions in the Forums:

SPECIAL NOTE: When there are multiple posts on a page published under the SAME DAY, the_date() only displays the date for the first post (that is, the first instance of the_date()). To repeat the date for posts published under the same day, you should use the Template Tag the_time() with a date-specific format string.

comment:3 @westi6 years ago

New days only is what my memory tells me this did.

And is how I have always explained it to people.

comment:4 @Denis-de-Bernardy6 years ago

  • Keywords has-patch added

comment:5 @Denis-de-Bernardy6 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 2.8 to Future Release

broken patch

comment:6 @Denis-de-Bernardy6 years ago

  • Milestone changed from Future Release to 2.8.1

comment:7 @ryan6 years ago

  • Milestone changed from 2.8.1 to 2.9

comment:8 @westi5 years ago

  • Milestone changed from 2.9 to Future Release

Moving to Future until this has a new patch.

comment:9 @wojtek.szkutnik5 years ago

  • Keywords gsoc added

comment:11 @nacin13 months ago

  • Component changed from Template to Date/Time
  • Focuses template added

comment:12 @obenland9 months ago

  • Keywords close added; needs-patch gsoc removed

the_date() works as ticket descriptions suggests, it echoes out the date, but only if it was different than the previous item it echoed out in the loop.

I'm not sure I can recreate any faulty behavior from five years ago, but I wonder if r16303 did not fix whatever when wrong back then. Suggesting to close as invalid.

comment:13 @obenland5 months ago

  • Keywords close removed
  • Milestone Future Release deleted
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.