wp_get_archives - WordPress*リファレンス

get_archives()と同様に、この機能は日付のベースのアーカイブリストを表示します。 唯一の違いはパラメタ議論を質問記号列の書式での機能に与えるということです。 テンプレートの中にどこでもこのタグを使用することができます。

原文(翻訳元):⇒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.

日付のベースのアーカイブへのリンクのリストを表示します。 テンプレートの中にどこでもこのタグを使用することができます。 それはwp_get_archives()と同様です。

原文(翻訳元):⇒Displays a list of links to date-based archives. This tag can be used anywhere within a template. It is similar to wp_get_archives().

タグ使用方法

<?php wp_get_archives('arguments'); ?>

Default UsageL

表示は、デフォルトを使用することでリンクを格納します。

原文(翻訳元):⇒Displays archive links using defaults.

$defaults = array('type' => 'monthly', 'limit' => , 'format' => 'html', 
 'before' => , 'after' => , 'show_post_count' => false);

By Month with Post Count

デフォルトで、用法は目立ちます:

原文(翻訳元):⇒By default, the usage shows:

* Monthly archives links displayed
* Displays all archives (not limited in number)
* Displays archives in an <li> HTML list
* Nothing displayed before or after each link
* Does not display the count of the number of posts

<?php wp_get_archives(); ?>

Last Twelve Months

最後の12だけを表示して、表示は月でリストを格納します。

原文(翻訳元):⇒Displays archive list by month, displaying only the last twelve.

<p><?php wp_get_archives('type=monthly&limit=12'); ?></p>

Last Fifteen Days

ここ15日間だけを表示して、表示は日付でリストを格納します。

原文(翻訳元):⇒Displays archive list by date, displaying only the last fifteen days.

<p><?php wp_get_archives('type=daily&limit=15'); ?></p>

Last Twenty Posts

表示はポストタイトルによって記載された最後の20の最新のポストのリストを格納します。

原文(翻訳元):⇒Displays archive list of the last twenty most recent posts listed by post title.

<p><?php wp_get_archives('type=postbypost&limit=20&format=custom'); ?></p>

Dropdown Box

選んだタグにポストカウントを表示している状態でMonthlyアーカイブのドロップダウン箱を表示します。

原文(翻訳元):⇒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>

Parameters

type

(string) アーカイブのタイプは、表示するために記載します。 WordPress設定へのデフォルト。 有効値

原文(翻訳元):⇒(string) The type of archive list to display. Defaults to WordPress settings. Valid values:

  • yearly
  • monthly (Default)
  • daily
  • weekly
  • postbypost

limit

得るアーカイブの数。 デフォルトは限界ではありません。

原文(翻訳元):⇒(integer) Number of archives to get. Default is no limit.

format

アーカイブリストのために、フォーマットします。 有効値:

  • HTMLリスト(
  • )タグとストリングの前後にhtml。 これはデフォルトです。
  • 選ぶ(<select>)かドロップダウンオプション(<option>)タグのオプション。
  • リンク(<link>)タグの中にリンクします。
  • 習慣–カスタムリストが使用される、ストリングの前後に。

原文(翻訳元):⇒(string) Format for the archive list. Valid values:

  • html - In HTML list (
  • ) tags and before and after strings. This is the default.
  • option - In select (<select>) or dropdown option (<option>) tags.
  • link - Within link (<link>) tags.
  • custom - Custom list using the before and after strings.

before

形式オプションにhtmlか習慣を使用するときリンクの前に置くテキスト。 デフォルトが全くありません。

原文(翻訳元):⇒(string) Text to place before the link when using the html or custom for format option. There is no default.

after

形式オプションにtge htmlか習慣を使用するときリンクの後に置くテキスト。 デフォルトが全くありません。

原文(翻訳元):⇒(string) Text to place after the link when using tge html or custom for format option. There is no default.

show_post_count

アーカイブのポストの数を表示してください、(1–本当に)、(0–偽)はそうしません。 すべてがある使用には、’postbypost’を除いて、タイプしてください。 0がデフォルト。

原文(翻訳元):⇒(boolean) Display number of posts in an archive (1 - true) or do not (0 - false). For use with all type except ‘postbypost’. Defaults to 0.

関連テンプレートタグ

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

Home » 全体的なタグ » wp_get_archives - WordPress*リファレンス