the_date [ WordPress Function ]
| Parameters: |
|
| Uses: | |
| Returns: |
|
| Defined at: |
|
Display or Retrieve 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'.
Source
<?php
function the_date( $d = '', $before = '', $after = '', $echo = true ) {
global $currentday, $previousday;
$the_date = '';
if ( $currentday != $previousday ) {
$the_date .= $before;
$the_date .= get_the_date( $d );
$the_date .= $after;
$previousday = $currentday;
$the_date = apply_filters('the_date', $the_date, $d, $before, $after);
if ( $echo )
echo $the_date;
else
return $the_date;
}
return null;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- the_date() - WordPress Codex
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 ...
codex.wordpress.org - WordPress › Support » Tags — the_date
Password (forgot?) Register · WordPress › Support » the_date ...
wordpress.org - Multiple the_date() Functions Return Empty Date | Digging into ...
Oct 21, 2009 ... Inside the loop, if you use the function the_date() to display the date the post was published, you may run into trouble. Specifically, if there are ...
digwp.com - Screenr - NETTUTS: "How to Creatively Format the_date() in ...
Screenr | Instant screencasts: Just click record. Screenr's web-based screen recorder makes it a breeze to create and share your screencasts around the web.
www.screenr.com
Kullanýcý Tartýþmalarý [ wordpress.org ]
- Matthew Gedeon on "the_date displaying wrong year"
- alchymyth on "the_date displaying wrong year"
- jalacom on "the_date displaying wrong year"
- Matthew Gedeon on "the_date displaying wrong year"
- jalacom on "the_date displaying wrong year"
- alchymyth on "How can I show the the_date() only within the post?"
- darkhorn on "How can I show the the_date() only within the post?"
- alchymyth on "How can I show the the_date() only within the post?"
- darkhorn on "How can I show the the_date() only within the post?"
- philowen on "Trouble with displaying Post Dates"