Plugin / Smarter Archives
Robin AdrianseDescription
Description
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 the Smart Archives plugin by Justin Blanton.
Usage
The [smarter-archives]
shortcode takes these arguments (default values included):
mode
(default:output
) — if it’s set tooutput
, the plugin prints the listing. Set it tofalse
to return the valuewrapper_class
(default:smart-archives
) — class given to the tag wrapped around the listing (<div>
by default)wrapper_tag
(default:div
) — tag wrapped around the listingyear_link_class
(default:year-link
) — class given to each year linksyear_tag
(default:p
) — tag around each year groupyear_class
(default: none) — class for the tag around each year groupafter_year
(default::
) — value after the year and before the list of monthsmonth_link_class
(default:month-link
) — class given to each month linkmonth_tag
(default:span
) — tag around each monthafter_month
(default:
) — spacer between monthsempty_month_class
(default:empty-month
) — class applied to empty months (can use this to gray them out)order
(default:DESC
) — order the years are shown in (ASC
for ascending,DESC
for descending)
Advanced Usage
There is a function, get_smarter_archives()
, that returns the raw array with the years, months, and post counts. You can use this for ultimate customization.
Example Usage
[smarter-archives order="DESC" after_month="•"]<h3>License</h3>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
A full version of the license is included with the plugin in license.txt
.
Ratings
Rating breakdown
DIRECTORY DISCLAIMER
The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.
The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.
Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.
While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.
wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.