WordPress V2.xTemplate Tag Reference Guide as of Version 2.x
Presented by:
Date & Time Tags
Post Date (xml)the_date_xml();
Displays the date of the post in YYYY-MM-DD format (ex: 2004-09-24). This tag must be used within The Loop.
<?php the_date_xml(); ?>
No Parameters
Post Datethe_date();
Displays or returns the date of a post, or a set of posts if published on the same day. This tag must be used within the Loop.
<?php the_date('format', 'before', 'after', echo); ?>>
format
The format for the date. Defaults to the date format configured in your WordPress options.
<?php the_date('n-j-Y', 'before', 'after', echo); ?>
String
before
Text to place before the date. There is no default.
<?php the_date('format', '»', 'after', echo); ?>
String
after
Text to place after the date. There is no default.
<?php the_date('format', 'before', '«', echo); ?>
String
echo
Display the date (TRUE), or return the date to be used in PHP (FALSE).
<?php the_date('format', 'before', 'after', TRUE); ?>
TRUE
FALSE
Post Timethe_time();
Displays the time of the current post. This tag must be used within The Loop.
<?php the_time('d'); ?>
d
Formatting for the time. Defaults to the time format set in WordPress.
<?php the_time('H:i:s'); ?>
String
Date (and Time) of Last Modification to Postthe_modified_date();
This tag displays the date (and time) a post was last modified. This tag works just like the_modified_time(), which also displays the time/date a post was last modified. This tag must be used within The Loop. If no format parameter is specified, the Default date format (please note that says Date format) setting from Administration > Options > General is used for the display format.
<?php the_modified_date('d'); ?>
d
Formatting for the date to display in. Defaults to the date format set in WordPress.
<?php the_modified_date('n-j-Y'); ?>
String
Time (and Date) of Last Modification to Postthe_modified_time();
This tag displays the time (and date) a post was last modified and is similar to the functionality of the_time(), which displays the time (and date) a post was created. This tag must be used within The Loop. If no format parameter is specified, the Default date format (please note that says Date format) setting from Administration > Options > General is used for the display format.
<?php the_modified_time('d'); ?>
d
Formatting for the time to display in. Defaults to the date format set in WordPress.
<?php the_modified_time('H:i:s'); ?>
String
Post Time (PHP)get_the_time();
Returns the time of the current post for use in PHP. It does not display the time. This tag must be used within The Loop.
<?php get_the_time('format'); ?>
format
The format the time is to display in. Defaults to the time format configured in your WordPress options.
<?php get_the_time(); ?>
String
Current Page Month & Year Titlesingle_month_title();
Displays or returns the month and year title for the current page. This tag only works when the m or archive month argument has been passed by WordPress to the current page (this occurs when viewing a monthly archive page). Note: This tag only works on date archive pages, not on category templates or others.
<?php single_month_title('prefix', display) ?>
prefix
Text to place before the title. There is no default.
<?php single_month_title('&bull', display) ?>
String
display
Display the title (TRUE), or return the title to be used in PHP (FALSE).
<?php single_month_title('prefix', FALSE) ?>
TRUE
FALSE
Post Calendarget_calendar();
Returns the time of the current post for use in PHP. It does not display the time. This tag must be used within The Loop.
<?php get_calendar(); ?>
initial
If true, the day will be displayed using a one-letter initial; if false, an abbreviation based on your localization will be used.
<?php get_calendar(false); ?>
true
false