<tpl:Archives>

The <tpl:Archives> loop is used to navigate through the different publication dates of posts on the blog. It is mainly used to create a general archives page.

Attributes

type

Defines the precision level of returned dates. Possible values are:

  • day: blog days
  • month: blog months
  • year: blog years

Default value is month.

category

Use this attribute to only return archives of a given category. The value it takes is the category URL. For example:

<tpl:Archives category="Stories">

post_type

Indicates what type of post has to be used to return the archives. Default value is post.

post_lang

This attribute only returns archives including posts in a given language.

order

Indicates how to sort the dates. It can be either asc (ascending) or desc (descending). Default value is desc.

no_context

By default, the <tpl:Archives> loop takes different contextual filters into account. For instance, when displaying a category, only the periods during which articles were published are displayed. When setting this attribute to 1, stops taking these filters into account.

Default value is 0.

Examples

Display blog dates

<tpl:Archives>
  <h3>{{tpl:ArchiveDate}}</h3> 
</tpl:Archives>

Display days of blog posts in Japanese sorted by ascending dates

<tpl:Archives lang="ja" order="asc" type="day">
  <h3>{{tpl:ArchiveDate}}</h3>
</tpl:Archives>

Wiki powered by Dokuwiki.