wp_get_archives

Sponsored Link

この関数は、日付ベースのアーカイブリストを表示します。テンプレートの中にどこでもこのタグを使用することができます。

Sponsored Link

This function displays a date-based archives list. This tag can be used anywhere within a template.

のテンプレートタグ使用方法

<?php wp_get_archives( $args ); ?> 

デフォルトの使い方

<?php $args = array(
    'type'            => 'monthly',
    'limit'           => ,
    'format'          => 'html', 
    'before'          => ,
    'after'           => ,
    'show_post_count' => false,
    'echo'            => 1 ); ?>

デフォルトでは、使用を示します:

  • 毎月のアーカイブリンクを表示します
  • すべてのアーカイブ(数では、制限されない)を表示します。
  • HTMLリストの中のアーカイブを表示します。
  • 各リンクの前後に何も表示されません
  • どんな表示にもポストの数のカウントをしません。

By default, the usage shows:

* Monthly archives links displayed
* Displays all archives (not limited in number)
* Displays archives in an

  • HTML list
    * Nothing displayed before or after each link
    * Does not display the count of the number of posts

  • wp_get_archivesのパラメーター

    type

    (string) アーカイブリストを表示するためのタイプです。デフォルトはWordPressの設定です。 有効値:

    • yearly
    • monthly – Default
    • daily
    • weekly
    • postbypost (投稿は投稿日順)
    • alpha (same as postbypost but posts are ordered by post title)

    (string) The type of archive list to display. Defaults to WordPress settings. Valid values:

    * yearly
    * monthly – Default
    * daily
    * weekly
    * postbypost (posts ordered by post date)
    * alpha (same as postbypost but posts are ordered by post title)

    limit

    (integer)アーカイブの数を取得する。デフォルトでは制限はありません。

    (integer) Number of archives to get. Default is no limit.

    format

    (string) アーカイブのリストの形式です。有効な値:

    • html – HTMLリストタグの前後の文字列です。これがデフォルトです。
    • option – セレクト() or dropdown option (