Languages: English • 日本語 (Add your language)
Returns the daily archive URL to a specific year, month and day for use in PHP. It does NOT display the URL. If year, month and day parameters are set to '', the tag returns the URL for the current day's archive.
<?php get_day_link( $year, $month, $day ); ?>
Returns the URL to the current day's archive as a link by displaying it within an anchor tag with the PHP echo command.
<a href="<?php echo get_day_link('', '', ''); ?>">Today's posts</a>
PHP code block for use within The Loop: Assigns year, month and day of a post to the variables $arc_year, $arc_month and $arc_day. These are used with the get_day_link() tag, which returns the URL as a link to the daily archive for that post, displaying it within an anchor tag with the PHP echo command. See Formatting Date and Time for info on format strings used in get_the_time() tag.
<?php $archive_year = get_the_time('Y'); $archive_month = get_the_time('m'); $archive_day = get_the_time('d'); ?> <a href="<?php echo get_day_link( $archive_year, $archive_month, $archive_day); ?>">This day's posts</a>
Since: 1.0.0
get_day_link() is located in wp-includes/link-template.php
.
get_calendar(), get_day_link(), get_month_link(), get_the_date(), get_the_time(), get_year_link(), single_month_title(), the_date(), the_date_xml(), the_modified_date(), get_the_modified_date(), the_modified_time(), get_the_modified_time(), the_time()