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.

The plugin in action
The plugin requires WordPress 3.7+

  1. Download the plugin and unzip it.
  2. Upload the folder simple-yearly-archive/ to your /wp-content/plugins/ folder.
  3. Activate the plugin from your WordPress admin panel.
  4. Installation finished.

  1. Deactivate the plugin from your WordPress admin panel.
  2. Upload the folder simple-yearly-archive/ to your /wp-content/plugins/ folder and overwrite the existing file.
  3. Activate the plugin from your WordPress admin panel.

Implementation / Usage

Since WordPress 2.5 the function can be called with a shortcode:
[SimpleYearlyArchive]
Some examples follow - each is a proper invocation of the plugin:
[SimpleYearlyArchive]
[SimpleYearlyArchive type="yearly_past"]
[SimpleYearlyArchive type="1249077600-1280527200"]
[SimpleYearlyArchive type="yearly" exclude="22,11"]
[SimpleYearlyArchive exclude="22,11"]
[SimpleYearlyArchive include="10,11"]
[SimpleYearlyArchive dateformat="%d/%m"]
[SimpleYearlyArchive posttype="my_product"]
Call the simpleYearlyArchive function like so:
simpleYearlyArchive('type', 'ExcludeCategoryIDs', 'DateFormat');
Some examples follow - each is a proper invocation of the plugin:
simpleYearlyArchive();
simpleYearlyArchive('','1');
simpleYearlyArchive('yearly','4,7,9');
simpleYearlyArchive('yearly_act','');
simpleYearlyArchive('1249077600-1280527200','');
simpleYearlyArchive('yearly_past','1,2');
simpleYearlyArchive('yearly_past','','1,2');
simpleYearlyArchive('yearly','','', 'my_product');
Parameter options are like following:

  • 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.
  • PostType (defaults to 'post'):
    - A registered post type to show.
  • DateFormat:
    - The date format string, according to http://php.net/strftime.

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:
[php]if (function_exists('simpleYearlyArchive')) {
simpleYearlyArchive('yearly','4,7,9');
}[/php]

Options menu

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

  • Date format:
    The date output be customized. Check http://php.net/strftime for date formatting.
  • Seperator between date and post title:
    The seperator is displayed between the date and the post title.
  • Linked years?:
    Wanna have the years linked?
  • Before / After (Year headline):
    HTML tags, that will be inserted before and after the date headlines.
  • Show post count for each year?:
    Show the total post count behind for each year?
  • Show comments count for each post?:
    Show comments count behind each post?
  • Show categories after each post?:
    Show categories behind each post? The output can be styled with the CSS class sya_categories.
  • Show optional Excerpt (if available)?:
    Show the optional excerpt below each post title, if available?
  • Max. chars of Excerpt (0 for default):
    How much chars of the excerpt to show? Enter 0 to show the entire excerpt.
  • Indentation of Excerpt (in px):
    How much pixels the excerpt should be indented.
  • Link back to my website in plugin footer?:
    Consider linking back to my homepage in the plugin's footer.

 

950 Responses

  1. Ach Mist, da hast wohl doch recht.

    Fatal error: Allowed memory size of 67108864 bytes exhausted […]

    Naja, Pech halt. Und wenn ich mir Google und die WordPress-Foren gebe, das kann soviel Ursachen haben, ich lasse es gut sein.

    • Der Ursachen mag es viele geben, aber eine einfache Lösung wäre es, beim Hoster um Erhöhung des RAM zu bitten. Schaden kann es ja nicht. 🙂

  2. Thanks so much for the great plugin.

    One question is how would I wrap the year text in a tag (i.e h2) so I can style it? I can see where you would add a class to the link tag if the year were a link but can;t seem to work out how to add it in the .PHP file.

    Cheers

  3. Hola,

    dein Archiv-Plugin ist wirklich super. Genau danach habe ich gesucht.

    Ich habe ein kleines Problem und ich konnte nicht finden, wie ich das Format verändern kann. Also, die Ganze etwas nach rechts verschieben und ebenso die Größe der Jahreszahlen ändern. Bei mir sehen alle gleich aus.

    Ich habe immer Probleme mit dem ganzen PhP-Kauderwelsch. =D

    Vielleicht kannst du mir da raushelfen? ^^

    claudia

  4. Hallo Oliver,

    gibt es eine Möglichkeit, die Anzeige auf nur bestimmte Kategorien zu beschränken (also include statt exclude)? Das wäre angesichts von 50 Kategorien, von denen nur 1(!) in einem jährlichen Archiv angezeigt werden soll suuuuper-hilfreich.

    Danke.
    liqui

    Translation: Is there a way to INclude only one or several categories instead of EXcluding all the others?

  5. Hallöchen,

    als workaround habe ich nach Zeile 120
    $allcatids = get_all_category_ids();
    eine Zeile ergänzt, in der ich die gewünschte Kategorie(n) eintrage
    $allcatids = ‘1,4,6’;
    Das überschreibt die anzuzeigenden IDs gnadenlos 😉

    Ich hoffe aber auf ein sauberes, überarbeitetes Plugin. Schön wäre übrigens auch eine Funktion, in der die Jahreslisten auf mehrere Seiten gesplittet würden – oder sich per AJAX/jquery überlagern oder Accordionmäßig ausklappen. Bei meiner zu bearbeitenden Seite gibt es nämlich Beiträge, die bis 1999 zurückreichen. Und da ist selbst bei 20-30 Beiträgen in der Kategorie schnell eine lange Seite entstanden.

    Wünschende Grüße
    liquido

    • Hallo liquido,

      Version 1.1.20 ermöglicht es nun, auch Kategorien zu includen. 🙂

      Das Archiv auf mehrere Seiten aufzuteilen ist bereits möglich mit dem Parameter ‘type’ (siehe Dokumentation oben). Damit wäre auch folgendes möglich:

      [SimpleYearlyArchive type="2007"]

      etc…

      • Das war ja schnell, Danke sehr!!

        Das mit den einzelnen Jahren ist schon klar, da muss ich aber am Anfang jedes Jahres eine neue Seite einrichten, obwohl das plugin doch selbstständig zurückzählen kann 😉

        Liebe Grüße
        liquido

        • Musst du nicht unbedingt. Du kannst ja mit

          [SimpleYearlyArchive type="yearly_act"]

          das jeweils aktuelle Jahr ausgeben lassen, und die Seite musst du nie ändern.

          • Richtig, es geht aber um die älteren jährlichen Archive, zu denen dann das nicht-mehr-aktuelle Jahr zum Jahreswechsel hinzugefügt werden muss. Im Moment kann ich eine Seite mit dem aktuellen Jahresarchiv machen und 1 Seite mit *allen* älteren Jahren, aber keine X Seiten mit den X bisherigen Jahresarchiven… 😉

            ist ja auch nur ne Idee…

            l. grüßt

  6. Genau das Plugin, das ich gesucht habe. Leider bin ich eine php-Null …

    Wohin muss die deutsche Sprachdatei, damit ich die Monate auf deutsch bekomme? Oder muss ich die Datei per php aufrufen? Wenn ja, wie uns wo?

    Danke!

    • Hey nectarine (mmhm, lecker! :-)),

      PHP-Kenntnisse brauchst du gar nicht, du musst einfach nur
      [SimpleYearlyArchive]
      in den Beitragseditor schreiben, dann wird das Archiv angezeigt.

      Das Datum kannst du auf der Plugin-Optionsseite selbst einstellen. Bei Datumsformat also z.B. ‘d.m.’ eingeben.

      • Vielen Dank für die Hilfe! 🙂
        Es hat alles geklappt, nur die Monatsnamen werden auf Englisch angezeigt, und ich hätte sie gern auf Deutsch …

        Viele Grüße
        nectarine

        • Was hast du denn in den Plugin-Optionen als Datumsformat eingegeben? Und gibt es einen Link zur Seite?

  7. When you say in the instruction to call the plugin where in WordPress 2.91 do I put t6his code? How do I see the archive?

  8. Hallo Oliver,
    alles ist schön, nur wenn ich auf die verlinkte Jahreszahl klicke, schaltet die Seite zurück auf die homepage. Fehlt mir ein zsätzliches Template (Archives ist vorhanden), oder besteht ein Konflikt mit der Permalinkstruktur? Vielleicht habe ich da etwas nicht verstanden.
    GRüße,
    Os.

    • Hallo Namensvetter. 🙂

      kannst du einen Link geben? Der Link auf die Jahreszahl sollte dich eigentlich auf das Jahresarchiv leiten á la domain.de/2008/. Ich nehme an, deine archive.php unterstützt einfach noch keine Jahresarchive.

  9. When I attempt to activate the plug-in I get an error message:
    Plugin could not be activated because it triggered a fatal error.
    Parse error: syntax error, unexpected $end in /Users/seanj/Sites/clients/lisapetrucci/wp-content/plugins/simple-yearly-archive/simple-yearly-archive.php on line 795

    I’m using WordPress 2.9.2

    Any idea what is causing the error?

    Thanks

      • Hallo,
        Kann ich auch mal erfahren, was das Problem ist?
        Wenn ich das Plugin auf meinem lokalen Rechner laufen lasse, kommt der Fehler auch.
        Im Web kommt der Fehler (bei exakt gleichem Theme, etc.) NICHT!
        Hast’n Tipp für mich?

        • Hallo Andreas,

          leider habe ich keine Ahnung, was das Problem hervorruft. Bei mir klappt es einwandfrei, sowohl lokal als auch online. Hast du mal alle Plugins deaktiviert außer das Simple Yearly Archives Plugin, um andere Fehlerquellen auszuschließen?

  10. Thanks. Exactly what I was looking for. After some initial fatal memory issues I managed to make it work. Kudos!

    Suggestions for future upgrades: 1) Instead of using the custom excerpt, why not just grab the first xx characters from the post content? 2) Create a container with anchored year links at the top that such that you can jump to the year and/or month below. I post almost every day and it’s a looooong way down to my previous posts from last year.

      • I just had another great idea: Is it possible to add a thumbnail? While I don’t have too many people browsing my archives and then clicking on the post they want, an added thumbnail would make the posts more attractive.

        As to the anchored year thingie: Another option could be to paginate years/months rather than jumping down one looong archive. Is that possible? Can I tweak the php for that already now, since it is already separated by year?

  11. Hello Oliver,

    I’d like to thank you for the plugin, it’s exactly what I was looking for.

    However, I have a question regarding the performance of the script. The archive page now seems to generate over 41 queries instead of 9 with simple wp_get_archives(‘type=monthly’). I guess that’s quite a lot. I wonder if that number could be reduced a bit.

    I know the archives page will only be displayed from time to time by some users (if at all :>), but still, it’s a chance for some abusers, etc, to kill my bandwidth limits.

    Cheers!

    • Hey sibelkacem,

      you’re right, the plugin should definately get an overhaul. When I released the initial version of the plugin, WP 2.1 was the current release, so the code base is pretty ancient indeed. 😉

  12. Sali Oliver,

    Bin Super zufrieden mit dem Plugin setzte es atm auf der wwww.hundeclub.ch seite ein, hab aber ein Problem.
    Ich habe keinen Einzug bei der Archive Auflistung, da kommt direkt:

    2010
    14.April – XXXXX

    Anstelle wie auf deiner Archive Probeseite einen Abstand zu lassen.

    2010

    14.April – xxxxxx

    Wo kann ich das ggf. Einstellen?

    Besten Dank im vorraus
    Simon

    • Hallo Simon,

      das kannst du via CSS steuern. Einfach folgendes in deiner style.css-Datei hinzufügen:

      .sya_container h2 {
      margin-bottom: 10px;
      }

      • Vielen Dank Oliver

        Hab das ganze jetzt mal umgesetzt, leider tut sich nichts die Page wird immer noch gleich wie zuvor Angezeigt.
        Ich Ruf die Archiv Page via Befehl auf auf der Seite: http://www.hundeclub.ch/hdc/?page_id=205
        In der style.css Datei hab ich wie geschrieben alles Eingetragen evtl. liegts aber auch an meinem Design Benevolence DE 2.1

        Ansonsten aber wie schon gesagt Top 🙂 wen die Darstellung dan noch kappt Perfekt.

        Wünsche noch ein schönes Weekend
        Simon

  13. Hello Oliver,

    Thank you for making this pluggin. I believe it will provide exactly what I need. Unfortunately, the archive list doesn’t have enough space between each line or post so the posts end up listed on top of each other. This page demonstrates the problem http://www.dreadscottart.com/chronology

    Do you know what would be causing this to happen and how I might fix it?

    Any thoughts on this would be greatly appreciated.

    All the best,
    Dread

    • Hey Dread,

      that’s due to your theme’s styles. Just add the following to the end of your style.css and everything should be fine:

      div.pages .sya_container ul li {
      	line-height: 14px;
      }
      • Hi Oliver,

        Thank you for the quick reply. I added the code above and it worked perfectly. It’s a great pluggin and your support for it is amazing.

        Best,

        Dread

  14. Hi Oliver,

    Thanks for your wonderful plug-in! How can I style the links to each post? Is there something I can add to the style.css that would style the a:link, a:active, a:visited, and a:hover cases so that they would match the rest of my site?

  15. Hallo Oliver,

    danke für das wirklich coole Plugin. Eine Frage habe ich jedoch dazu: Gibt es eine Möglichkeit, das Datum fett zu drucken, während der reguläre Schrifttyp beim Link zum Eintrag beibehalten wird?

    Viele Grüße,
    Felix

    • Probier mal folgendes:

      .sya_container ul li {
          font-weight: 700;
      }
      .sya_container ul li a {
      	font-weight: 200;
      }
  16. Hi Oliver,
    Thanks for this great plugin! I’ve been using it for several years, but am just now upgrading to the current version while I’m upgrading my WP installation. Now I’ve got a mysterious CSS bug that I can’t track down: my html header now includes

    #wpadminbar { display:none; }

    html { margin-top: 28px !important; }
    * html body { margin-top: 28px !important; }

    and I am, accordingly, getting an extra 28px of whitespace I don’t want at the top of my page at http://vavstuga.com/news/ .

    Since I don’t find other people mentioning this same problem (and since I can’t find anything relevant in the plugin files themselves), I assume it must be coming from my own CSS elsewhere somehow? But I can’t find anything related in my own theme either. Can you help me figure out where to look?

    Thanks for any suggestions.

    ~lydia

  17. Hey Lydia,

    are you using a plugin/hack to hide the new admin bar in WP 3.1? Seems like it, as you hide the #wpadminbar element, but still it seems to add a margin on top where the admin bar resides.

  18. Hi Oliver,

    Great plugin, thanks for sharing.

    I have a problem though. The dates are not displaying correctly.

    It seems to only go as far as the 6th of each month and that’s it. Posts that have been written after this date, simply show the 6th of each month.

    An example of this is found here:

    http://www.flyingferret.com/archives-by-comics/

    Has anyone else had this problem or can you think of a reason as to why this may be happening?

    Thanks if you/ or anyone else can offer any advice.

    • Hey James,

      a user named Dread (thanks, dude!) made me notice that the dates are ordinals of the days Sunday through Saturday (Sunday being zero, Monday being 1 etc.), so I guess you made a mistake in setting the date format in the plugin’s settings.
      Do you have a ‘w’ in your date format? Here you can see what ‘w’ does translate to: http://de2.php.net/manual/de/function.date.php 🙂
      Try ‘l, j F’ and it should be working for you.

      • Thanks Oliver,

        That fixed it.

        One other small issue. I have the author included and it shows as admin, rather than using the nickname. Is there any way around this? The nickname shows in posts and comments, just not in the archives.

        Thanks for your help – much appreciated.

        • You’re right. Version 1.1.50 that I just submitted to the repository should fix that. Thanks for pointing out!

  19. Could be nice to add date format in the short codes options for Multi-language posts. I use qTranslate and in the English part I could use this for French and English dates… If you see an alternative for my purpose, let me know! 🙂 By the way, I like your plug-in! Thanks!

    • Hey Patrick,

      thanks for the idea that I just integrated into version 1.2. Should be coming via plugin auto update in a few minutes/hours. 🙂

  20. Hallo,

    habe soeben Simple Yearly Archiv upgedatet.

    Nun bekomme ich dieses Fehlermeldung beim Aufrufen der Archivseite:
    Warning: Missing argument 4 for get_simpleYearlyArchive(), called in /www/htdocs/xxxxxxx/wp-content/plugins/simple-yearly-archive/simple-yearly-archive.php on line 503 and defined in /www/htdocs/xxxxxxxx/wp-content/plugins/simple-yearly-archive/simple-yearly-archive.php on line 114

    WordPress Version 3.2.1–de_DE
    Simple Yearly Archive 1.2

    Wo kann der Fehler liegen?

    Gruß Peter

    • Hallo Peter,

      danke für den Hinweis. Habe gerade 1.2.1 rausgehauen, das sollte den Fehler beheben!

      • Hallo,

        leider ist hat sich nach dem update nichts verändert:

        Warning: Missing argument 4 for get_simpleYearlyArchive(), called in /www/htdocs/xxxxxxxx/wp-content/plugins/simple-yearly-archive/simple-yearly-archive.php on line 503 and defined in /www/htdocs/xxxxxxxx/wp-content/plugins/simple-yearly-archive/simple-yearly-archive.php on line 114

        Gruß Peter

  21. Hallo,

    habe einfach dieses [SimpleYearlyArchive] bei meiner schon erstellten Seite erneuert, abgespeichert und es klappte ohne Fehler.

    Wobei dieses ja schon so bestand…. 🙁

    Gruß Peter, Danke für die Hilfe

    • Hallo Sven,

      nutze stattdessen lieber [SimpleYearlyArchive] zum Aufruf des Plugins, dann sollte es wieder funktionieren. 🙂

  22. I have been using Simple Yearly Archive for some time and am very happy with it. But recently, when I click on my “Articles by date” menu item, the following appears above the list of articles:

    Warning: Missing argument 4 for get_simpleYearlyArchive(), called in /home/cj5547/public_html/wp-content/plugins/simple-yearly-archive/simple-yearly-archive.php on line 505 and defined in /home/cj5547/public_html/wp-content/plugins/simple-yearly-archive/simple-yearly-archive.php on line 114

    How can I fix this?

  23. Hallo Oliver.

    Kompliment zu diesem tollen Plugin.

    ich würde gerne die Jahreszahlen ausblenden. Du hast das zwar vor einiger Zeit schon mal dargelegt, jedoch nicht für die aktuelle Version.

    Könntest du mir sagen, was ich auskommentieren müsste. Danke

  24. Hmm…

    ich habe den Codeschnipsel in die style.css des Themas reinkopiert. Leider tut sich da gar nichts. Blockiert das Thema vielleicht etwas?

    • Du musst ggf. das h1 ersetzen mit h2 oder h3, je nachdem, was du in den Plugin-Optionen eingestellt hast.

  25. hallo, ich hätte eien frage wie ich folgendes umsetzen kann.

    problem: bei mir soll das archiv nciht nach jahren sondern nach saisons gehen.

    mgl 1: die saisons sind je eine kategorie und man könnte ggf danach filtern?

    mgl 2: nciht so schön aber würde vermutlich reichen: man müsste die kategorie (also saison 2011712) VOR das datum setzen in der übersicht.

    kann mir da vll jemand weiterhelfen?

    • Du kannst in der Liste bestimmte Kategorien ein- und ausschließen. Infos dazu findest du weiter oben in der Pluginbeschreibung.

      • sorry ich hab mich dann falsch ausgedrückt mit dem “filtern”. natürlich habe ich die anderen postings schon ausgeschlossen. mit “danach filtern” meinte ich statt “jahr 2010” “jahr 2011” … dass man nach kategorien unterteilt. also “saison 2010/11” “saison 2011/12” weil ja die spielzeiten leider nicht von 1.1. bis 31.12. laufen

        wenn ich nach “2010” wie es aktuell ist das anzeige habe ich ja spiele von der sison “2009/2010” und “2010/2011” da drin

        • Das geht leider nicht. Die Definition des Plugins geht davon aus, dass ein Jahr vom 01.01. bis 31.12. geht und 365 Tage hat. Eine Saisonlogik ist damit leider nicht möglich.

  26. First of all, thanks for this wonderful plug-in. I’ve been using this plugin for the past few years with great joy and success.

    I have a quick question, though. I am using this on a WordPress page to list the title of all my posts. Previously, when I clicked the title, it moved directly to the post, but now (maybe with the newest upgrade) I am getting back to yet another list, like “Archive for August 26th, 2011.”

    Is there anyway I can make the link go directly to the actual post rather than yet another intermediary page?

    Thanks!

  27. Nice plugin. Is there a way for the date link to go to the archive page just for the category specified? I’m using:

    But the year link goes to a default archive, not even the archive for that category (ie not linking to category-98.php)

  28. I really like this plugin and it’s exactly what I was looking for, but unfortunately I get an error message on top of my archives page saying:

    Warning: implode() [function.implode]: Bad arguments. in /home/content/n/a/t/hostname/html/websitename/wp-content/plugins/simple-yearly-archive/simple-yearly-archive.php on line 306

    I’m using [SimpleYearlyArchive] and WP 3.2.1

    How can I make this message disappear, because the archives show just fine?

    Thanks in advance!

      • HI Oliver, I’m using version 1.2.5, use the Exec-PHP plugin and if it matters, I’m hosting with godaddy.com.
        Thanks for looking into it!

        • Your hosting configuration seems to be set to display warmings. Try adding

          php_value display_errors 0

          to the end of your .htaccess

          • So it’s not a problem that there is this code error? It’s weird with GoDaddy, as I cannot see a htaccess in my root, so I uploaded one, and it looked like there was one already (hidden?), but now my blog is inaccessible, with an internal server error (500). I’ve uploaded an empty htaccess as I don’t think I can delete it (because I can’t even see it) and still my site is showing the server error. 🙁 What now?

            • Ignore my previous comment – I could delete the htaccess-file. My site is back, but now I cannot access any categories,or pages, just the “home page”. Weird! Now I’m getting a 404 error (The requested URL /page/2 was not found on this server.Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.) I guess one should never touch a running system…especially if blond! ;o) I guess I don’t need to bother you any further as this has nothing to do with your plugin that I really would like to use…once I get my site back and running…sigh.

  29. I’ve just talked to GoDaddy and could recover my site with a previously working htaccess file. They didn’t recommend to use htaccess for trying to hide the php errors and said this is a programming code error that has nothing to do with their server. I’ve tried it again and whenever I put php_value display_errors 0 in my htaccess-file I get an internal server error and my site is gone.

    • Well, I agree with GoDaddy that you shouldn’t hide php ERRORS, but what you’re seeing is a warnung, and these usually are turned off for public site environments.

      May you please try adding

      ini_set('display_errors', 0);

      to your wp-config.php file?

      If that doesn’t help either, I’m going to edit my plugin’s code although it wouldn’t be necessary, but I’d do it just for you. Heh. 🙂

      • Hey Oliver, Thanks for your kindness! But, you don’t need to sweat, haha.
        The ini-set code in wp-config.php didn’t work; I got 404’s on all my pages and your plugin didn’t work at all, but then I placed this

        error_reporting(0);
        @ini_set(‘display_errors’, 0);
        

        into wp-includes/class-wp-error.php
        just at the top, underneath the opening php tag…

        …and guess what?! Your plugin now works fine without the error message above it on my page. Blondies have more fun – when code works! :)))

        P.S.: I shall be honest and mention that I didn’t figure this out myself. Well, I wanted to find out why the wp-config didn’t accept the added code and landed here: http://wordpress.org/support/topic/hide-php-error-message ;o)

        • Hehe, super. 🙂 Just dont forget to insert the code again after you update WP next time as it will be overwritten.

  30. Guten Tag Oliver,

    danke für dein Plugin.
    Meine PHP Kenntnisse sind nicht ausreichend, um den Plugin an meine Bedürfnisse anzupassen.
    Vielleicht kannst du mir helfen oder mir auf einen bereits existierenden Kommentarbeitrag hinweisen.

    Die Site:
    http://www.bocqbox.de/kunden/lebalto/category/realisierungen-realisations/

    Ich brauche eine jährliche Archiv für die Kategorie “Realisierungen” (ID 3) und eine für die Kategorie “Wettbewerbe” (ID 4).
    Die verlinkte Jahreszahlen funktionieren nicht wie gewollt.

    Ich habe vor dem Loop in category.php, archiv.php und single.php folgendes eingefügt:

    Merci beaucoup.
    Céline

  31. Ich habe vor dem Loop in category.php, archiv.php und single.php folgendes eingefügt:

    Merci beaucoup.
    Céline

  32. Bonjour Céline,

    mit diesem Code sollte es doch genau nach deinen Wünschen sein, oder? 🙂

    [SimpleYearlyArchive include="3"]
    und
    [SimpleYearlyArchive include="4"]

    Das fügst du einfach im Editor (da wo man die Seite mit Inhalt befüllt) ein, und es sollte funktionieren. Was genau meinst du mit “Die verlinkte Jahreszahlen funktionieren nicht wie gewollt.”?

  33. Lieber Oliver, ich bekomme hier ein out of memory:
    vielleicht ist dieses schon einmal untergekommmen, aber ich finde dazu keinen Eintrag hier oderüber Googlle:
    http://www.dorfdisco.de/archives

    Die Fehlermeldung ändert sich dabei = verschiedene dateine werden oom gezeigt:

    zB,

    Fatal error: Out of memory (allocated 54263808) (tried to allocate 1415 bytes) … /wp-content/plugins/simple-yearly-archive/simple-yearly-archive.php on line 297

    Fatal error: Out of memory (allocated 54263808) (tried to allocate 294 bytes) in /home/www/doc/9402/dorfdisco.de/www/wp-includes/wp-db.php on line 1354

    Fatal error: Out of memory (allocated 54263808) (tried to allocate 47 bytes) in /home/www/doc/9402/dorfdisco.de/www/wp-includes/functions.php on line 3183

    … Ideen? Danke!!!

  34. Hello,
    I was wondering if it was possible to change something in your plugins code so that I can select the post type to be listed. Because indeed I would like to use your plugin to list a precise custom post type called “livres”…
    Any idea ?
    Thank you anyway for your work !

  35. I kind of fixed it maybe not the good way but it works! I did not delete any code, I just styled the heading with “display:none”. Good day!

  36. I have allso fixed that problem by max it to 3 only post. I want the dates to be bold with this CSS = is this possible? How do I do it? Thanks

  37. Oliver,

    I inherited a wordpress-blog wich uses your simple-yearly-archive-plugin.
    I noticed when invoking the plugin, an error-message appears :
    Warning: Missing argument 4 for get_simpleYearlyArchive(), called in C:\domains\vierwindenhuis.nl\wwwroot\zuidhal\wp-content\plugins\simple-yearly-archive\simple-yearly-archive.php on line 525 and defined in C:\domains\vierwindenhuis.nl\wwwroot\zuidhal\wp-content\plugins\simple-yearly-archive\simple-yearly-archive.php on line 114

    line 114 = function get_simpleYearlyArchive($format, $excludeCat=”, $includeCat=”, $dateformat) {

    Line 525 = $sya_archives = get_simpleYearlyArchive($format, $excludeCat);

    The blog is using WordPress 3.2.1

    I am hopeless at PHP, so I would hope you could shed some light on this.

    Cheers, Fried

    • Hey Fried,

      how do you invoke the plugin? By shortcode within a post in the editor or via function call in the template?

      • To tell you the truth, I am not too sure how it is done.
        The blog uses as Theme : Gear 1.3.6 This deploys in the banner/header a menu-structure ( buttons).
        One of them is called Archief ( dutch for archive). I found a Page called Archief, and all that does is employ a
        permalink : http://zuidhal.vierwindenhuis.nl/index.php/archief/

        Pretty normal I would think.

        Simple Yearly Archive Options are all unchecked apart from the option :
        Show optional Excerpt (if available)?

        So I am still at a loss. Would it hurt do uninstall/re-install the plugin ?

        Cheers, Fried

  38. Hi, thanks for your useful plugin.
    I have a strange issue with date localization. I’m using version 1.2.5 of your plugin, on a localized (italian) version of WP 3.3.1.
    My timezone on general wordpress settings is set as “Rome”, so yes, it’s Italy.

    In plugin’s options page I set “j F Y” as date format.
    I’m using a simple [SimpleYearlyArchive include="1"] shortcode in a page.
    But in frontend, on that page, the name of the month is rendered in english. I mean, month’s name is rendered as “january”, ” february”, etc. and not “gennaio”, “febbraio”, et. (italian names) as I would expect.
    Italian month names are correctly translated in other parts of the site and by other plugins.

    Am I missing something?
    Thanks for your help!

    • Hey Kroom,

      month names should be localized too. I’ll have a look at it when I get home later. 😉

      • Hey Kroom,

        just pushed an update to 1.2.6 that you should be getting soon. Please note that you have to update your date string in the plugin’s settings! In your case that’d be ” %d %B %Y ” 😉

        • Thanks!
          your new 1.2.6 solved the problem 🙂
          And thanks for your suggestion about the new date string!

          kroom

        • Oliver, can’t remember if this bug – or feature? 😉 – was there in previous version, but with version 1.2.6:
          – If I check “Anchored overview at the top?” in global options AND uncheck the above option “link for years”,
          the overview in frontend is created, but no links to anchors are generated (well, links are generated, but no anchors), so if I i click on a year of the overview, nothing happens.
          If i check also “links for years” anchors are correctly generated.

  39. Möhhhnsch, warum wird eigentlich was geändert, was bislang einwandfrei funktionierte, damit es dann nicht mehr funktioniert :(?

    Jetzt habe ich statt dem Datum des Artikels überall ein “d.m.Y H:i” stehen, hurrah.

    Dem nicht genug, sieht die große Gesamtansicht zum Ende der Seite sehr abenteuerlich aus, mit schwarzen Blöcken und in der Ansicht ein heilloses Durcheinander von sich überlagernden Auflistungen.

      • Es hat leider bisher nicht funktioniert. Wenn ein italienischer Blog z.B. den Monatsnamen anzeigen ließ, wurde dieser immer in Englisch und nicht korrekt in Italienisch angezeigt, daher war die Anpassung nötig. Nach dem Update solltest du einen Hinweis bekommen haben, dass das Datumsformat angepasst werden muss, und unter dem Feld für das Datumsformat findest du einen Link, welche Werte eingetragen werden können. Z.B. “%d/%m”. 😉

  40. Hallo Oliver

    Danke für Dein exzellentes Plugin, bei dessen jetzt anderem Datumsformat ich zuerst auch einmal wie der Ochs vorm Scheunentor dastand, und dann “hier geholfen wurde”. *zwinker*

    “%d.%m.%Y” zeigt so richtig z.B. “26.04.2012” an, “%d.%B %Y” zeigt aber den Umlaut im Monat März unrichtig so mit einer schwarzen Raute (o.s.ä.) an. Dito erscheint die abgekürzte Form Mär mit falscher Umlautdarstellung durch “%d.%b %Y” bzw. durch “%d.%h %Y”.

    setlocale(LC_ALL, ‘de_DE.UTF8’, ‘de_DE’);
    habe ich in wp-config.php eingetragen.

    Hast Du eine Idee wegen des einen Umlautes in “März”?

    HERZLICHEN DANK(!) und Gruß

    Gunther

  41. Any idea why i keep getting this error?

    Warning: Missing argument 4 for get_simpleYearlyArchive(), called in /home/dreamiez/domains/illusi0n.net/public_html/wp-content/plugins/simple-yearly-archive/simple-yearly-archive.php on line 558 and defined in /home/dreamiez/domains/illusi0n.net/public_html/wp-content/plugins/simple-yearly-archive/simple-yearly-archive.php on line 146

  42. Hi,

    This is excellent, just what I’m looking for – however… could you possibly add an option to sort the posts in either ascending or descending order?

    For now, I’ve tweaked the plugin PHP file (for the 2nd time, I forgot I did it then updated it to the latest version today!) – having this as a configurable option would be great, it would then simply need to order the posts either asc or desc when selected from the database 🙂

    Cheers!

    • Hey Garry,

      I’m not sure people (well, except you 🙂 ) will actually use the option. An archive typically lists posts from newest to oldest, and that’s what people expectt. I probably will, however, put the option into an “Advanced” section of the options panel. 😉

      • Hi Oliver,

        That’ll be great 🙂 I’m using mine as a project log for my 1967 Ford Anglia project, where I’d like the page to list it in oldest first, so they can work their way through from the top of the list to the bottom to follow the progress 🙂

        Look forward to the update if you decide to do it – I’ll keep checking the release notes!

        Cheers!

        • Hi Oliver,

          I see you’ve added the sort option – you’re a star! I can rest safely in the knowledge I can continue to update this excellent plugin on my site without it breaking my design! 🙂

          Thanks again!

          Garry

  43. Hey Oliver. This is just the plug in I’m looking for. Thanks. I’ve installed it as best I understand, but I’m getting a repeating error at the top of the page:

    Warning: Missing argument 2 for standard_process_link_post_format_title() in /home3/marcala1/public_html/marcalanschelske.com/wp-content/themes/standard/functions.php on line 1379

    I am calling the plug-in via the short code in the page. [SimpleYearlyArchive]

    So, what next? I appreciate your help.

  44. Thanks for the plugin, richtig clever.
    It even works in a textwidget, cool.

    One question: can I omit the display of date?
    So that my archive will look like:
    YEAR
    my post
    another post

    • Sure, just go the plugin setting and empty the values for “Date format” and “Seperator between date and post title”. 🙂

      • Ah, offcourse (I changed the dateformat in the shortcode and that didn’t work)

        Thanks!

        The plugin is great and the support too.
        I voted 5 stars and donated through PayPal,
        damit du dir ein Bier kaufen kannst!

  45. Hello and thank you for an excellent plug-in! It’s been a life-saver in many ways, and I use it on several of my sites.

    I have found, though, a handful of my posts are not picked up by the archive. In one particular site (www.skiffy.ca), my 4 most popular posts do not appear in the archives produced. I can find nothing special about these particular posts. Any ideas?

  46. Hey Ray,

    can you link me the posts that don’t show up in the sitemap? Possible reasons would be, the posts are marked private/draft or have a future date, but these are just wild guesses… I’ll probably know more once you link me the posts. Thanks!

  47. Any guidance on how I can turn this into “Simple Monthly Archives” without too much trouble?

    Basically, I need an archives list that lists links by month, and where I can restrict categories, and show several archives lists on one page.

    Any wisdom or suggestions are greatly appreciated. Thx!

  48. Hallo,

    ich bräuchte mal Hilfe.
    Ich habe das Plugin hochgeladen, aktiviert und eingestellt und eine neue Seite “Archiv” angelegt und dort in den Editor den Shortcode [SimpleYearlyArchive] eingefügt.
    Beim Aufrufen der Seite erscheint aber kein Archiv sondern nur der Shortcode.
    Ich verwende WordPress 3.3.1 mit dem Twenty Eleven Theme.

    Die Archivseite ist hier: http://fantasylife.square7.ch/archiv/

    Fehlt noch was?

    Grüßle

    fantasylife

  49. Entschuldigung, ich hatte die Plugin-Empfehlung aus einem Artikel und der war leider etwas unübersichtlich, deshalb hatte ich die Plugins wohl verwechselt und so konnte natürlich der Shortcode nicht mehr stimmen. Sorry!

  50. Ahoi, ich habe hier ein Fehler und weiß nur das der durch das Plugin zu Stande kommt.
    Ein Link ist durchgestrichen.

    .broken_link, a.broken_link {
    text-decoration: line-through;

    Wie kommt dies zu Stande und wie kann ich es beheben?

    Liebe Grüße
    Kiki

    • Hallo Kiki,

      inwiefern hat .broken_link, a.broken_link etwas mit meinem Plugin zu tun? 🙂

  51. Hi,
    I’ve been trying to exclude a category adding this:
    [SimpleYearlyArchive type="yearly" excludecategoryids="2012-13"], where 2012-13 is the name of one my categories. But it will still show the posts categorized as “2012-13”.
    Is there something that I’m doing wrong?
    Thanks,
    Yves

  52. Hi Oliver. Great plugin. We want to display author names with our archives, which is an option in your plugin. However, we are now using custom fields for our author names, as in: get_post_meta($post->ID, ‘author’, TRUE);

    I’m wondering if there is a way to modify your code so that it displays the custom field value instead of the regular author. I was looking at the following part of your code and wondering it could be modified to call the custom field value. Thoughts?

    }
    if(get_option(‘sya_showauthor’)==TRUE) {
    $userinfo = get_userdata( $post->post_author );
    $listitems .= ‘ (‘ . __(‘by’) . ‘ ‘ . $userinfo->display_name . ‘)’;

    • Hey Michael,

      yep, would be possible. Using get_post_meta($post->ID, ‘author’, TRUE) should do the trick. You would have to change it in line 265ff AND 343ff. Also keep in mind that you will have to change it every time a new plugin version comes out. 😉

  53. Guten Tag

    ich bin auf der Suche nach einer Möglichkeit, die Beiträge zu archivieren und hatte gehofft, ich könne dies in der Sidebar tun, die halt lang und länger wird…
    Theme ist WP Twenty-Eleven.
    Und ich habe so ziemlich gar keine Ahnung was ich tu… Im deutschsprachigen Forum fand ich eigentlich keine Antworten zu diesem Thema überhaupt, obwohl ide Frage öfter mal aufzutauchen scheint.

    Gibt es eine nachvollziehbare Anleitung für die Anwendung dieses PlugIns? Aktiviert ist es, aber was nun passiert ist mir noch schleierhaft.

    Herzliche Grüße aus Fiji
    Andrea Fuchs
    SY AKKA

    • Hallo Andrea,

      im Grunde ist es oben beschrieben. Kurzes Tutorial:

      1.) Erstelle eine Seite in WordPress, z.B. namens Archiv
      2.) Füge im Editor als Inhalt folgendes ein: [SimpleYearlyArchive]
      3.) Wenn Du die neu erstellte Archiv-Seite jetzt anschaust, sind dort alle deine Beiträge nach Jahren geordnet.

      • Guten Tag, Oliver
        Mittlerweile habe ich es begriffen – ich hatte nicht zu hoffen gewagt, es sei so einfach, Im Prinzip prima.
        Ich habe das Archiv dennoch wieder rausgenommen – zum einen, weil wohl zunächst der Optik wegen neue Seiten und Unterseiten schaffen mmuss, zum anderen, weil ich trotz Archiv immer noch alle Monatszusammenfassungen der Beiträge seit 2007 im Sidebar habe, Und last but not least sieht das Archiv sehr unschön aus – ich hatte gehofft, man könne die Monate beibehalten und nicht alle Beiträge einzeln erscheinen lassen.

        Gruß aus Fiji
        Andrea / SV AKKA

        • … vielleicht sollte ich mal die Kategorie aus dem Sidebar herausnehmen… Fällt mir gerade ein.
          Aber die Optiksache bleibt.

          Andrea

        • Zu früh gesendet – es fehlt die konkrete Frge ob man wohl das yearly Archive dazu bringen kann, die Monatszusammenfassungen zu archivieren und nicht die Einzelbeiträge – oder habe ich etwas überlesen?

  54. Hi, Oliver

    vielen Dank!
    Ich lerne… und dann habe ich als erste Notlösung mal gelernt, dass mein Theme (default von WP) ein “Monthly Archive” bietet. Reine Fundsache.
    Für ‘ne 60-Jährige ein schweres Brot, sich in der Flut von Infos (und in dem Wust von schwarzen Löchern in all den Informationen 😉 ) zurecht zu finden.
    Ich hab’ ja schon Berührungsängste beim Umgang mit FTP, wenn man sonst alles intuitiv macht.

    Herzlichen Dank nochmals
    Andrea

  55. HI,

    What the format for including either a full excerpt or say the first 100 characters?

    I’ve tried [SimpleYearlyArchive excerpt="100" include="3"] but no excerpt gets displayed.

  56. Great plugin but I have one question: can I create pages? its a big call up doing a full year so if It could be broken to say 50 a page would be great 🙂 cheers

    • Not automatically, but it’s possible by creating several pages manually and defining a specific year by using the shortcodes. So as an example just create pages for 2010, 2011 and 2012 and use the shortcodes

      [SimpleYearlyArchive type="yearly_act"]
      [SimpleYearlyArchive type="2010"]
      [SimpleYearlyArchive type="2011"]

      See “Implementation / Usage” section above. 🙂

  57. Does your site have a contact page? I’m having problems locating it but, I’d like to shoot you an e-mail. I’ve got some ideas for your blog you might be interested in hearing. Either way, great site and I look forward to seeing it develop over time.

  58. Great plugin that *almost* provides exactly what I was looking for… the one main thing I really need that’s missing is the ability to place the date format string after the post title, rathher than before. For example, “my post title – December 2010”. In other words, it would be wonderful if the before/after placement of the date string be configurable.

    The second item is tougher (and I’m prepared to do without) but it would be wonderful to somehow support multi-column output, or at least two column output.

    And the last item is just wishful thinking, but it would be nice to be able to place the post’s featured image inline with the post title (again, before or after the text).

    Thanks!

  59. This works (almost) perfectly for me! I would like to request a feature for your plugin. Would it be possible to add the option of collapsing posts by year? So all you see is a list of years, and you can click on the year and it expands to show all the posts from that year.

  60. Hallo Oliver,
    ist es vielleicht möglich, das Jahresarchiv in nur jeweils einer bestimmten Sprache wieder zu geben? Ich habe eine deutsch-italinische Seite und dort tauchen die Artikel auf beiden Seiten in jeweils beiden Sprachen auf, allerdings sollten auf der italienischen Seite nur die italienischen Artikel nach Jahr gelistet werden und auf der deutschen nur die deutschen. Verstehe leider (noch) nichts von PHP, um selbst was zu probieren 🙁 Und meine Google Recherchen oder anderen Plugins gaben alle nicht das her, was ich im Sinn hatte!
    Danke und liebe Grüße!

    • Hallo Cynthia,

      das kommt darauf an, wie die Beiträge angelegt sind. Wie wird bestimmt, welche Sprache der Artikel hat? Über Kategorien? Oder nutzt Du ein Plugin für mehrsprachige Beiträge in WordPress?

  61. Hi the plugin works fine with archived posts posts going back to Augusr 13 2012. Any post priot to this doesn’t load

    I’ve noticed the permalinks don’t appear to work correctly for any of thes posts prior to August 13 e.g
    Post August 13 2012
    http://www.jaggybunnet.co.uk/rally-reports/rally-report-speyside-classes/
    Pre August 13 2012
    http://www.jaggybunnet.co.uk/rally-reports/2079/

    Permalnks were set to /%catgory%/%postname%/

    Ive got it to work using /%year%/%monthnum%/%postname%/ but ideally want to use %catgory%/%postname%/

    Any idesa why this doesn’t work for older posts before August 13 2012?

  62. Hallo Oliver

    Vielen Dank für dein Plugin. Es macht genau das, was ich will. Super.
    Leider verursacht es seit 3.5.1 einen merkwürdigen und hoffentlich für dich interessanten Fehler. Sobald ich im simple-yearly-archive.php etwas verändere und das File speichere, ist beim Einfügen einer Datei die Mediathek leer und bei Uploads gibts die Fehlermeldung “Bei dem Upload ist ein Fehler aufgetaucht. Probiere es später noch einmal.”. Per Undo dein File wieder auf den Ursprungszustand zurückzusetzen hilft nichts. Einzig ein erneutes installieren des Plugins klappt.
    Die Manipulation mache ich deshalb, weil ich die augelisteten Links gerne ohne Datum hätte.

    Hast du eine Idee dazu?
    Jürgen

  63. Nachtrag:
    Halb so dringend. Hab das Datum mit CSS “ausgeblendet”. Wäre aber cool, wenn du beim nächsten Update das Datum in einem Span packen würdest. Dann wäre das eleganter zu lösen. Ich lass vorerst die Finger von simple-yearly-archive.php.
    Grüsse
    Jürgen

  64. Hi there. Suddenly, when trying to access the “archive”, I get the following error: “Allowed memory size of 94371840 bytes exhausted (tried to allocate 32 bytes) in /misc/32/748/188/906/user/web/blog.deonandan.com/wordpress/wp-includes/meta.php on line 563” Any idea what’s going on?

    • Hey Ray,

      does that error message still appear if you downgrade to the plugin version 1.4?

  65. Love the plugin.

    Is there a way to put in a dropdown menu or even checkboxes at the top to show certain categories?

    • Hey Jani,

      not possible yet, sorry. You could, however, split your archives into several pages (e.g., an archive page per year).

  66. longchamp handbagsJuly 19, 2013 at 8:41 pm

    There is certainly some validity but I will take hold opinion until I look into it further. Very good write-up

Leave a Comment