Smarter Archives
When you use the [smarter-archives] shortcode anywhere in a post or a page, it gets replaced by a listing of every year since you started posting, with a list of links to each month for that year. However, the plugin is smart enough to know if you didn’t create any content in any given month, and do
When you use the [smarter-archives] shortcode anywhere in a post or a page, it gets replaced by a listing of every year since you started posting, with a list of links to each month for that year. However, the plugin is smart enough to know if you didn’t create any content in any given month, and doesn’t make a link for that month. See the Screenshots section for an example of it in action.
See the Usage section for a complete list of the arguments the shortcode takes, and how you can use them to customize your archives listing.
The month names are internationalized with the WordPress translation API . A POT file is included, and if you want to translate please feel free to do so and submit a new pull request on GitHub. If you do not know how to use GitHub, you can also contact me directly . Here are the translations that have been done so far:
- Dutch (nl_NL)
- French (fr_FR)
- German (de_DE)
- Italian (it_IT)
- Spanish (es_ES)
- Russian (ru_RU)
The original concept for this plugin comes from a plugin by Justin Blanton.
Usage
The [smarter-archives] shortcode takes these arguments (default values included):
- mode (default: output ) — if it’s set to output , the plugin prints the listing. Set it to false to return the value
- wrapper_class (default: smart-archives ) — class given to the tag wrapped around the listing ( <div> by default)
- wrapper_tag (default: div ) — tag wrapped around the listing
- year_link_class (default: year-link ) — class given to each year links
- year_tag (default: p ) — tag around each year group
- year_class (default: none) — class for the tag around each year group
- after_year (default: : ) — value after the year and before the list of months