Wordpress Document

Author tags

Category tags

Comment tags

Date and Time tags

General tags

Geo tags

Link tags

Links Manager tags

Permalink tags

Post tags

Trackback tags

WP/PHP General

get_archives

概要

日付ごとのアーカイブリストを表示します。
この関数は非推奨となっています。かわりにwp_get_archives()を使用して下さい。

用法

<?php get_archives('type', 'limit', 'format', 'before', 'after', show_post_count); ?>

引数

type

'monthly'
月ごとのアーカイブリストを表示します。(デフォルト)
'daily'
日ごとのアーカイブリストを表示します。
'weekly'
週ごとのアーカイブリストを表示します。
'postbypost'
最新の投稿順でアーカイブリストを表示します。

limit

(integer)
アーカイブリストの上限数です。 上限を指定しない場合は ' ' を指定して下さい。

format

'html'
リストタグ(<li>)を使用します。(デフォルト)
'option'
セレクトフィールドのoptionタグ(<option>)を使用します。
'link'
linkタグ(<link>)を使用します。
'custom'
独自のタグを使用します。

before

(string)
formatに'custom'か'html'が指定されていたときにリンクの前に表示します。デフォルト:' '

after

(string)
formatに'custom'か'html'が指定されていたときにリンクの後に表示します。デフォルト:' '

show_post_count

TRUE
typeに'monthly'が指定されたときに、アーカイブの中に何件の投稿があるかを表示します
FALSE
合計数を表示しません(デフォルト)

用例

-