Archive-Pro-Matic | Documentation
Shortcode Attributes
Shortcode Attributes
Archive-Pro-Matic includes two shortcodes to include an archive list on a post or page: [archives]
and in case ‘archives’ is already in use by another plugin or theme, [arcpromat]
may be used instead.
Below is a full list of all shortcode attributes that can be used to customize the archive list. Further examples and demonstrations of the latest features can be found on our testing site under the category: Archive-Pro-Matic.
Use the cat_id attribute to display an archive list filtered by single or multiple categories. Attribute accepts a single category ID or a comma separated string of multiple category IDs. Using a negative category ID value will omit the category.
[archives type="monthly" cat_id="55,43" limit="10" /]
Type of archive to retrieve. The following values are accepted by the type attribute:
[archives type="daily"/]
[archives type="weekly"/]
[archives type="monthly"/]
[archives type="yearly"/]
[archives type="postbypost"/]
[archives type="alpha"/]
[archives type="quarterly"/]
[archives type="seasonally"/]
The alpha and postbypost archive types both display a list of post titles instead of dates. The difference between alpha and postbypost is that alpha orders the archive by post title and postbypost orders by post date.
Use the cat attribute to display an archive list filtered by single category. Attribute accepts a single category slug.
[archives type="monthly" cat="monkey"/]
The limit attribute controls the number of results displayed.
[archives limit="2"/]
The taxonomy attribute is used to select all posts that have a specific taxonomy defined. The term attribute can be added to limit the results to a specific taxonomy.
Show an archive of all posts that have at least one post tag:
[archives type="monthly" taxonomy="post_tag"/]
Show an archive of all posts that have at least one category:
[archives type="monthly" taxonomy="category"/]
The order attribute controls the sort order of all post types except alpha and postbypost. Valid values are DESC and ASC. Descending (DESC) is the default value.
[archives type="yearly" order="ASC"/]
By default alpha lists are displayed A->Z ascending. To reverse the order of alpha archive type the alpha_order attributes must be set to DESC.
[archives type="alpha" limit="3"]
[archives type="alpha" alpha_order="DESC" limit="3"]
The term attribute is used with the taxonomy attribute to display an archive of posts from a single taxonomy.
Only show an archive of posts that have been tagged with ‘monkey’:
[archives type="monthly" taxonomy="post_tag" term="monkey"/]
By default postbypost archive types are displayed by date, newest to oldest descending. To change the order of an postbypost archive type the post_order attributes must be set to ASC.
[archives type="postbypost" limit="3"]
[archives type="postbypost" post_order="ASC" limit="3"]
Use the date_format attribute to adjust the way dates are displayed in the archive list. See the php date function for format parameters.
[archives limit="3" date_format="Y. F"/]
List archives by a custom post type. Default is ‘post’.
[archives limit="3" post_type="monkey"/]
Use the highlight attribute on yearly type archives to assign a special class to the current and/or active year in an archive list. Valid values for the highlight attribute are:
Including ‘current-year’ in the value of the highlight attribute will add a current-year class to the current year in the archive list. If ‘active-year’ is included, the archive year that is currently being viewed will be assigned a active-year class. Note: This class is only assigned to the active year when viewed on a yearly archive page.
If active-season highlighting is used on a seasonally archive type that is also using a option format (drop-down select), the active year+season will be automatically selected.
CSS:
.current-year a {
color: #ff0000;
}
Shortcode:
[archives type="yearly" highlight="current-year"/]
Active Season Highlighting:
[archives type="seasonally" format="option" sub_options="true" sep=" - " highlight="active-season"/]
Add an alphabet heading for each letter group when using alpha type archives. Valid values are:
[archives type="alpha" limit="5" alpha_headings="1"/]
The format to display the archive list. Default value is ‘html’. Valid values for the format attribute are:
[archives format="option"/]
See WordPress codex for more detail on format parameters.
HTML tag to wrap the alpha heading when using alpha type archives.
[archives type="alpha" limit="5" alpha_headings="1" alpha_tag="h4"/]
Text to place before the link when using html or custom format options. There is no default.
[archives type="yearly" limit="3" before="archives for: "/]
Use the all_is_link
attribute to included any text added using the ‘before’ and ‘after’ attributes as part of the archive link. Valid values are:
[archives limit="3" before="++" after="++" all_is_link="1"/]
Text to place after the link when using html or custom format options. There is no default.
[archives type="yearly" limit="3" after=" was a good year"/]
the sub_options attribute is used to create add a sub-select in the archive list. For example, setting ‘true’ for a seasonally archive will present a year link on a seperate line, with the seasonal sub archives listed below. If the sub_options is set to ‘block’ the both the main and sub elements will appear on the same line.
Using sub_options to break out seasons or quarters on a seperate line:
[archives type="seasonally" sub_options="true" /]
[archives type="quarterly" sub_options="true" /]
See Archive-Pro-Matic – Quarterly and Seasonal Archives.
Using sub_options to do display all links on the same line and create a unique ‘block’ style archive:
[archives type="monthly" sub_options="block" /]
The select_text attribute is used to change the default text that is displayed as the default selected value when using the option format.
[archives limit="5" format="option" select_text="Choose Wisely"/]
The sep attribute can be defined to give more separation between the year and the sub-options.
[archives type="seasonally" sub_options="true" sep=" -- " /]
This attribute has been depreciated, use the show_post_count attribute instead.
Display the number of posts in an archive. For use with all archive types except ‘alpha’ and ‘postbypost’. Valid values are:
[archives limit="3" show_post_count="true"/]
[archives limit="3" show_post_count="1"/]
Set the show_empty attribute to true to allow placeholders to be displayed for empty archives. The show_empty attribute currently only works with monthly archives with the ‘year/month’ sub_options activated.
[archives type="monthly" sub_options="true" show_empty="true" /]
Controls the list type to be use in ‘html’ and ‘link’ type archives. Any valid HTML tag may be used.
[archives limit="3" tag="ol"/]