WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 3 months ago

#8532 new defect (bug)

the_date() doesn't function as intended

Reported by: matt Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Date/Time Keywords: needs-patch gsoc
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 5 years ago.
8532.002.diff (1.4 KB) - added by markjaquith 5 years ago.

Download all attachments as: .zip

Change History (13)

matt5 years ago

markjaquith5 years ago

comment:1 markjaquith5 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 MichaelH5 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 westi5 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-Bernardy5 years ago

  • Keywords has-patch added

comment:5 Denis-de-Bernardy5 years ago

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

broken patch

comment:6 Denis-de-Bernardy5 years ago

  • Milestone changed from Future Release to 2.8.1

comment:7 ryan5 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.szkutnik4 years ago

  • Keywords gsoc added

comment:11 nacin3 months ago

  • Component changed from Template to Date/Time
  • Focuses template added
Note: See TracTickets for help on using tickets.