get_year_link [ WordPress Function ]
get_year_link ( $year )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Retrieve the permalink for the year archives.
Source
<?php
function get_year_link($year) {
global $wp_rewrite;
if ( !$year )
$year = gmdate('Y', current_time('timestamp'));
$yearlink = $wp_rewrite->get_year_permastruct();
if ( !empty($yearlink) ) {
$yearlink = str_replace('%year%', $year, $yearlink);
return apply_filters('year_link', home_url( user_trailingslashit($yearlink, 'year') ), $year);
} else {
return apply_filters('year_link', home_url('?m=' . $year), $year);
}
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/get year link « WordPress Codex
Description. Returns the yearly archive URL to a specific year for use in PHP. It does NOT display the URL. If year is set to '', the tag returns the URL for the ...
codex.wordpress.org - Function Reference/get month link « WordPress Codex
Related. 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(), ...
codex.wordpress.org - WordPress › Support » get_year_link
There are get_month_link and get_day_link functions, but not get_year_link. I'm not quite sure why... Well, I imagine they are primarily used for the calendar, but ...
wordpress.org - get_year_link - Triphp Webmaster Blog
get_year_link. TIME/DATE TAG. What It Does. Retrieves the yearly archive URL for a specified year. Code. <?php get_year_link('year'); ?> If no year is specified, ...
blog.triphp.com