Codex tools: Log in
Languages: English • 日本語 • (Add your language)
wp-includes/deprecated.php.
Use any of these functions instead.Contents |
Displays a list of links to date-based archives. This tag can be used anywhere within a template.
<?php get_archives( $type, $limit, $format, $before, $after, $show_post_count ); ?>
Displays archive links using defaults.
<?php get_archives(); ?>
Displays all archives by month in an unordered list, with count of posts by month.
<ul>
<?php get_archives('monthly', '', 'html', '', '', TRUE); ?>
</ul>
Displays a non-bulleted list of the last 10 posts separated by line breaks.
<?php get_archives('postbypost', '10', 'custom', '', '<br />'); ?>
Displays monthly archives in a dropdown list; the use of javascript is required to have an archive selection open on the page.
<form id="archiveform" action="">
<select name="archive_chrono" onchange="window.location =
(document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);">
<option value=''>Select Month</option>
<?php get_archives('monthly','','option'); ?>
</select>
</form>
You also can use piece of code below, that works better than the example above. It shows the months list, including the number of posts/month.
<select name="archivemenu" onChange="document.location.href=this.options[this.selectedIndex].value;">
<option value="">Select month</option>
<?php get_archives('monthly',,'option',,,'TRUE'); ?>
</select>
Displays a custom number of recent posts in an unordered list.
<ul><?php get_archives('postbypost','10','custom','<li>','</li>'); ?></ul>
wp_list_authors(), wp_list_categories(), wp_list_pages(), wp_list_bookmarks(), wp_list_comments(), wp_get_archives(), wp_page_menu(), wp_dropdown_pages(), wp_dropdown_categories(), wp_dropdown_users()