get_day_link [ WordPress Function ]
get_day_link ( $year, $month, $day )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Retrieve the permalink for the day archives with year and month.
Source
<?php
function get_day_link($year, $month, $day) {
global $wp_rewrite;
if ( !$year )
$year = gmdate('Y', current_time('timestamp'));
if ( !$month )
$month = gmdate('m', current_time('timestamp'));
if ( !$day )
$day = gmdate('j', current_time('timestamp'));
$daylink = $wp_rewrite->get_day_permastruct();
if ( !empty($daylink) ) {
$daylink = str_replace('%year%', $year, $daylink);
$daylink = str_replace('%monthnum%', zeroise(intval($month), 2), $daylink);
$daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink);
return apply_filters('day_link', home_url( user_trailingslashit($daylink, 'day') ), $year, $month, $day);
} else {
return apply_filters('day_link', home_url( '?m=' . $year . zeroise($month, 2) . zeroise($day, 2) ), $year, $month, $day);
}
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/get day link « WordPress Codex
Description. 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 ...
codex.wordpress.org - WordPress › Support » get_day_link Question
I have a question about the get_day_link and get_month_link template tags. Is is possible for me to call a link to a year archive using these template tags?
wordpress.org - WordPress › Support » get_day_link from a theme's index.php page ...
get_day_link from a theme's index.php page not working for me (4 posts) ... I'm trying to use get_day_link (and the month variety) to create a link on a main page ...
wordpress.org - get_day_link | A HitchHackers guide through WordPress
Feb 12, 2011 ... Source code. function get_day_link($year, $month, $day) { global $wp_rewrite; if ( !$year ) $year = gmdate('Y', current_time('timestamp')); if ( !
hitchhackerguide.com
Kullanýcý Tartýþmalarý [ wordpress.org ]
- electricbob on "get_day_link from a theme's index.php page not working for me"
- electricbob on "get_day_link from a theme's index.php page not working for me"
- whooami on "get_day_link from a theme's index.php page not working for me"
- electricbob on "get_day_link from a theme's index.php page not working for me"