the_date ( $format = '', $before = '', $after = '', $display = true )

  • (string) format Optional. PHP date format. Defaults to the 'date_format' option.
  • (string) before Optional. Output before the date. Default empty.
  • (string) after Optional. Output after the date. Default empty.
  • (bool) display Optional. Whether to echo the date or return it. Default true.
  • (string|void) String if retrieving.
Defined at:


Displays or retrieves the date the current post was written (once per date)Will only output the date if the current post's date is different from the previous one output. i.e. Only one date listing will show per day worth of posts shown in the loop, even if the function is called several times for each post. HTML output can be filtered with 'the_date'. Date string output can be filtered with 'get_the_date'.

Related Functions

get_the_date, the_date_xml, the_time, the_title, the_terms

Top Google Results

User discussions

wpseek mobile