archivespress-dates

Developer Knowledge Level

This content is intended for WordPress developers, and it may require coding knowledge of WordPress, PHP, and JavaScript. Code examples provided here may contain errors or needs some additional coding. Make sure to test the code before using it on a live website!

Definition
[archivespress-dates post_type="post" order="asc" /]
Attributes
Name
Type
Description
Default
_source
string
Internal output source identifier; normally leave this unset.
shortcode
layout
string
basic or compact.
basic
post_type
string
Public post type slug; default can be filtered.
post
order
string
Sort direction: asc or desc.
desc
years
string
Comma-separated years; empty includes all years.
Empty
year
string
show or hide year headings.
show
month
string
auto for localized month names, or number.
auto
show-year-counts
boolean
Show year counts; use true or false.
true
show-month-counts
boolean
Show month counts; use true or false.
true
show-day-counts
boolean
Show day counts; use true or false.
false
class
string
Additional CSS class.
Empty
var-font-size
string
Optional font size; for example 16px.
Empty
var-line-height
string
Optional line height; for example 1.5.
Empty
var-year-background
string
year background color.
Empty
var-year-color
string
year text color.
Empty
var-month-background
string
month background color.
Empty
var-month-color
string
month text color.
Empty
var-day-background
string
day background color.
Empty
var-day-color
string
day text color.
Empty
Output
HTML index of matching dates, or an empty string when the post type is invalid or no data exists.

Indexes published, non-password-protected posts by date. Compact falls back to basic when year is hidden. The definition shows example attributes, not a complete list. Style values are validated before output: font sizes require an accepted unit (except zero), line heights may be unitless or use px, em, rem, or %, and colors must use a supported color syntax. Invalid values are ignored. Date links use WordPress archive URLs by default, including for custom post types.

Example

[archivespress-dates years="2024,2025" show-day-counts="true"]
Rate this reference
0
0
3

You are not allowed to rate this post.

Leave a Comment

0
0
0
0
0
0
0
0
0