Codex tools: Log in / create account
Contents |
This function displays a date-based archives list in the same way as get_archives(). The only difference is that parameter arguments are given to the function in query string format. This tag can be used anywhere within a template.
<?php wp_get_archives('arguments'); ?>
<?php $defaults = array(
'type' => 'monthly',
'limit' => ,
'format' => 'html',
'before' => ,
'after' => ,
'show_post_count' => false); ?>
By default, the usage shows:
Displays archive list by month, displaying only the last twelve.
<?php wp_get_archives('type=monthly&limit=12'); ?>
Displays archive list by date, displaying only the last fifteen days.
<?php wp_get_archives('type=daily&limit=15'); ?>
Displays archive list of the last twenty most recent posts listed by post title.
<?php wp_get_archives('type=postbypost&limit=20&format=custom'); ?>
Displays a dropdown box of Monthly archives, in select tags, with the post count displayed.
<select name=\"archive-dropdown\" onChange='document.location.href=this.options[this.selectedIndex].value;'>
<option value=\"\"><?php echo attribute_escape(__('Select Month')); ?></option>
<?php wp_get_archives('type=monthly&format=option&show_post_count=1'); ?> </select>
bloginfo, bloginfo_rss, get_bloginfo, get_bloginfo_rss, wp_title, get_archives, wp_get_archives, get_calendar, get_posts, wp_list_pages, wp_dropdown_pages, wp_loginout, wp_register, query_posts, rss_enclosure