Simple Yearly Archive Plugin// Making Archiving Easy & Elegant

Simple Yearly Archive is a rather neat and simple WordPress plugin that allows you to display your archives in a year-based list. It works mostly like the usual WP archive, but displays all published posts seperated by their year of publication. That said, it’s also possible to restrict the output to certain categories, and much more.

type (defaults to 'yearly'): - yearly: Displays a year-based list (Default). Can be empty aswell. - yearly_act: Only posts from the current year are displayed. - yearly_past: Only posts from the past years are displayed. - "date of year": Only posts from the given year are displayed. - "<unixtime-from>-<unixtime-to>": Only posts from the given (unix)time period are displayed.

ExcludeCategoryIDs: - A comma-separated list of category IDs you want to exclude.

IncludeCategoryIDs: - A comma-separated list of category IDs you want to include.

In order to run your blog proper and clean code, it's highly recommended to check if a plugin exists before calling it. If the plugin is not activated, it will "break" the theme and it may report errors or fail to load. It is therefore imperative to prevent the plugin from being detected in case it is turned off:

1

2

3

if(function_exists('simpleYearlyArchive')){

simpleYearlyArchive('yearly','4,7,9');

}

Options menu

There are a couple of options in the Simple Yearly Archive options menu.

Twitter

600 Responses

Hi ! Thanks for this useful plugin. This shortcode with include categories don’t run : [SimpleYearlyArchive type="yearly" include="60,52" order="DESC"] but This shortcode without categories run correctly : [SimpleYearlyArchive type="yearly"]

Thank you for your reply. The reason of the problem was a conflit with settings of an other plugin (Advanced Category Excluder Widgets). This is my fault … In fact, there is non problem with WordPress 3.3.1. But I upgraded it , by the way.

The updated plugin started showing both drafts and private posts in my archives, which freaked me out. When I updated it again, it stopped working. When I call the shortcode listed above it breaks the theme. What happened to this perfect plugin?

I’ll go activate the plugin now, and call it with [SimpleYearlyArchives]. You can see what it does here: http://dysfunksjonell.no/archive/ – let me know when you’ve seen it, so I can deactivate it again. Thanks!

I double checked, triple checked and checked again, and there’s no typo (that was the first thing I thought about).

My files doesn’t look anything like the ones referred to in the codex, but the debug didn’t say anything regarding Simple Yearly Archive, and I really don’t have enough experience with PHP to increase the memory limit when the file doesn’t contain what the codex says it’s supposed to contain..

well, if you’re okay with sending me a login to your WP site so I could see myself, that’d make things a lot easier for me to check. If you’re okay with it, please send the credentials to scripts (at) schloebe (dot) de

Hi Oliver, thank you so much for the great plugin but I have two questions:

1.- The first question and the more important is that when I install SimpleYearlyArchive Plugin, enter in conflict with Top Commentators Widget Plugin, SimpleYearlyArchive Plugin working perfect but Top Commentators Widget Plugin stop working.

2.- How I do a page with SimpleYearlyArchive Plugin for the catgories?

Thanks for your reply Oliver! Is there a quick fix on your code, where i could possibly change what you retrieve as results? For example instead of if year = XXX to get results between september and august or something like that? Is there a fast work around?

Well, as you can see here http://www.schloebe.de/archiv/ the list is separated by year… what’d be the seperator if you choose to use results between september and august? That’d pretty much be a monthly archive, so I’m sorry to say there’s no quick workaround I can think of.

thank you for this great plug-in. It works very well and it looks as simple and great as I could wish for!

One question: Is there a maximum number of posts the plug-in can handle? Right now, there are 646 posts altogether and most of them are in the archive. The archive is not shown when the shortcode is included in its basic version. But it is shown, when “yearly_past” is added.

Hi, thanks for the awesome plugin. I have a little problem with it. When I click on the year then it expands my news list, I choose the news and go to read it and now if I go back to the news list (just going back) then the news are not expanded anymore and I have to click again on the year number. How to change that so, that if I come back from reading then the news list are still expanded?

I know it can be kinda cumbersome, but I’m intending the plugin to be as lightweight as possible. Most people open links with their middle mouse button anways, which opens links in a new tab/window, so when they close the new tab, they’re on the archive page again.

I’ve used this plugin for several years on a site I manage. Now I’m relaunching the site—building from scratch—and hoped to continue using it. But when I paste the shortcode into a page, not only does it not display the archive, but it also removes my footer and sidebar. I disabled the other three plugins I’m using and it didn’t help. Any ideas? I’ve upgraded to the latest release of both the plugin and WordPress.

Hello Olivier, thanks a lot for your plugin. I have just started to use it today and it seems like i have a problem. The plugin is not showing all of my post just the ones that apparently have a certain category (its in spanish but for example the plugin is just showing the post that have the “Documents” category). I have created a static page and im using this shortcode : [ SimpleYearlyArchive].

Hey Steffen, would be possible but isn’t creating post types aiming to separate posts from the normal ones? Why list the normal posts along with the custom post type posts? Wouldn’t categories be better for that matter?

Suddenly, maybe since the last automatic update?, the plugin isn’t working for me anymore It just says: “Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 93510 bytes) in /customers/c/f/8/jemaco.se/httpd.www/wordpress/wp-content/plugins/simple-yearly-archive/simple-yearly-archive.php on line 417″

Hi, I’m having trouble with the exact notation of the shortcode. If I want to exclude category id3, i guess I the following shortcode, but it still shows all categories: [SimpleYearlyArchive ExcludeCategoryIDs="3"]

Can I just say what a comfort to find a person that actually knows what they are discussing over the internet. You actually understand how to bring a problem to light and make it important. More people ought to read this and understand this side of the story. It’s surprising you aren’t more popular since you certainly possess the gift.

Hi, I noticed the following: When following the link from the Year (e.g http://mysite/?m=2014&lang=en) the posts displayed belong to all the categories of the selected year (e.g. 2014) and not only to the category I have selected. How can this be resolved?

Hi guys, the problem with the code is that while Simple Yearly Archive allows to filter the archive list for multiple category IDs, WordPress doesn’t. So when someone includes the categories 1,3,5, and clicks the Year link, it won’t work. The link would look like /2014/?cat=1,3,5 but WP does only allow single category filter IDs, so it would filter the list to category ID 1 only and the list wouldn’t be accurate nevertheless.

Hi Oliver. Thanks for your answer. I have 3 post categories. My purpose is to get all the posts of each category (not from multiple) for each year for e.g. 2014 with cat id ’12’. The problem is that i get the posts of 2014 from all the categories instead of only “12”. The code of Youda didn’t help also. I work in wordpress 3.9.1.

It works for me. I know that it doesnt wokr for mulitple but i am not usiong it. Maybe Oliver could help you. I am not a web developer and i just changed what i needed. i know it isnt done in proper way. try changing the right line.https://justpaste.it/h52g

With a couple of changes seems to work only for my default language (Greek). Your code changed: https://justpaste.it/h55z (with red letters the changes). What can i do to work in an second language (english)?

oh i dont know why but “justpaste.it” changed the braces from round to square. of course they need to be round. I think you just need to find out what URL works on your web. For me “/2014/?cat=100″ works so my code alse works.

Hi, I do think this is a great site. I stumbledupon it I will return yet again since i have book marked it. Money and freedom is the best way to change, may you be rich and continue to guide other people.

Hi, Thanks for this plug in.Its really good one. I need to display year wise category list like 2014 2013 2012 … etc. But i am using short code like this [SimpleYearlyArchive type="yearly_past" include="2" ] and [SimpleYearlyArchive type="yearly" include="2" ] It shows like 2012 2013 2014. I need present year is first .

Thank you, Yes i updated the settings now its working perfectly. But still i am having one problem when i am using [SimpleYearlyArchive type="yearly" include="3"] this short code all list will be displayed perfectly, But that list shows when user logged in to the site only. If we are visiting site that list are not displaying properly,it shows only present year

Thank you for your reply. I checked that one Reverse order is enabled. But still i am having some other problems. when i am using this short code [SimpleYearlyArchive type="yearly" include="3"] its displaying values will be correct but it showing when we logged in to the site that time only shows exact out put. But without logged in its not displaying all values shows only present year.

Hey Venu, having different output for logged in and logged out users sounds like a Cache issue. Do you happen to have a cache plugin installed that could cause different output for not logged in users (i.e. outdated cached output)?

Hi Gino, there’s no problem when using the plugin on more than one page.

One thing to consider is that the plugin does not only show posts that are associated to a particular category exclusively, but also if the category selected with include=”27″ is IN the list of associated categories for a post.

Please disregard my previous post. For some reason it is working correctly now. I’m not certain, but I think I may have made an edit, then clicked Preview page, then made an edit to the PREVIEW page and not the actual page that was open in another tab. So, the plugin works like it is supposed to. I’m just careless. Thanks!

Hi Mike, you could create several pages and add shortcodes to the content like for the current year: [SimpleYearlyArchive type="yearly_act"] For other years create specific pages like “Archives: 2014″ and add the shortcode [SimpleYearlyArchive type="2014"] etc.

Follow-up question: Is there a way to show in a single archive page the posts of a subset of years (like 2013 AND 2012 AND 2011) or pick a year and display all posts in that year AND all posts in years previous?

Hi, I’m having a little language problem when displaying short month names. Do I call SYA by a shortcode in a page everything is fine. When I call SYA by PHP in order to add an archive to a particular page the month names are in english?!? The whole site is set for german. What am I doing wrong?

The new customizable date field makes no sense to me. I’ve read through the linked file about the date string, and I can see the variables I want to use, but no matter what I enter into the field all I ever get on the front-end is %x where the date should be. What am I doing wrong?