(この記事は、「Archives Shortcode « Support — WordPress.com」をもとに作成しています。)
投稿記事や固定ページ、テキストウィジェットに以下のアーカイブ表示用ショートコードを入力すると、さまざまな形式でアーカイブを表示することができます。
最近の12ヶ月のアーカイブ
[archives type=monthly limit=12]
最近の12ヶ月(記事数)のアーカイブ
[archives type=monthly limit=12 showcount=true]
最近の18日のアーカイブ
[archives type=daily limit=18]
最近の32日の記事タイトルリスト
[archives limit=32]
最近の3週間のアーカイブ
[archives type=weekly limit=3]
すべての記事のドロップダウンリスト
[archives format=option]
最近の12ヶ月の記事数付きドロップダウンリスト
[archives format=option type=monthly limit=12 showcount=true]
前後に文字を挿入した最近の17週間のアーカイブ
[archives type=weekly limit=17 before='some before text' after='some after text']
各パラメータの定義
パラメータ | 意味 | パラメータの設定内容 | 初期設定 |
---|
type | 項目の表示形式 | yearly, monthly, weekly, daily, postbypost | postbypost |
format | アーカイブの表示形式 | option (ドロップダウンメニュー), html (通常のリスト), custom (「before」「after」を使う場合) | html |
limit | 表示される項目の数 | 32,5,77(任意の数字) | No limit |
showcount | 記事数 | true, false | false |
before | 表示される項目の前に挿入される文字 | (テキスト(HTML可)) | none |
after | 表示される項目の後に挿入される文字 | (テキスト(HTML可)) | none |
order | 並び順 | asc, desc | desc |
なお、この機能は、公開記事に対応しています。非公開記事があった場合、その記事は表示されません。