This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

A Year Before


With “A Year Before” you can show the titles of the articles which were written a certain time ago. So you can show in a “historical corner”, what happend in your blog e.g. 30 days, 6 months or a year before. You also can use the “anniversary-mode”, which will display all the posts through the years, which were written on this day and month.

You can use it as a wordpress-widget or put it in your theme as a php-function with parameters.


Using the widget

Just click on the configuration-button of the widget an use the selfexplaining popup-dialog.
Use the output-pattern to define the look of the found articles. Possible patterns are:

  • %title% The title of the article
  • %link% The link to the article
  • %date% The date of the article
  • %excerpt% The excerpt of the article. You can define the number of displayed characters bei appending the number like %excerpt80%, which will display 80 characters.
  • %thumbnail% The featured image of the article.

Not using the widget

You can call the plugin with a PHP-statement in a WordPress-Theme and pass some parameters in this scheme
parameter1=value1&parameter2=value2&parameter3=value3 …

You can use the following parameters

  • day : the number of days ago you want to show the articles.
  • month : the number of month ago you want to show the articles.
  • year : the number of years ago you want to show the articles.
  • before : piece of HTML to insert before the title of the articles. Default <li>
  • after: piece of HTML to insert after the title of the articles. Default </li>
  • range: number of days the plugin will search back in the future (relative to the values of day, month and year above) for an article. Meant as a “round about this day”-feature. Default 0
  • showdate: shows the date (showdate=1) before every title or not (showdate=0)
  • dateformat : dateformat as used by PHP. Default ist the german shortform “d.m.y”
  • notfound: the text the plugin will output, if no article is found on the defined date.
  • anniversary: if set to 1, the plugin will display all articles ever blogged with the same number of day and month. The parameters “day”, “month”, “year” and “range” will be ignored if used.
  • private: show private posts? 0: only public posts 1: private and public posts 2: only private posts. Default 0
  • showpages: show pages? 0: No, 1: Yes. Default 0
  • posts_max: number of articles to be shown. 0 means ‘all’. Default 0


ayb_posts("day=30&before=&after=<br />&showdate=0");

Shows the titles of the articles written 30 days ago without showing the date. The articles will not been showed as a HTML-list but simply seperated by a linebreak <br />.

ayb_posts("month=6&day=14&notfound=Nothing blogged on this day.");

The titles of the articles written half a year and two weeks before, also showing the date . If there was no article written on that day, the output will be »Nothing blogged on this day.«


Looks up a year back for written articles. If none are found, the plugin will check the next 14 days in the future. If a article is found on some of this days, all articles of this day will be listed with a “year-month-day”-format.


Shows the title of all posts, which were posted on the same day in the same month, independend of the year. E.g. on chistmas day you will see all posts, which are posted on december 24th since the blog was started.


If you like CSS, you can style the date with the class ayb_date, the link of the article with the class ayb_link and the notfound-message by using the class ayb_notfound.


Deactivate the plugin, then select “delete” in the plugin-panel. The files and the options of this plugin will be deleted. Thank you for using “a year before”. 😉


Using widgets in wordpress

  1. Download the plugin and put the directory “a-year-before” in the plugin-folder of your wordpress-installation.
  2. Then activate the plugin.
  3. Go “Themes/Widgets” and pull the widget in the sidebar. Ready to go! Configure it, if you want.

Not using widgets in wordpress

  1. Download the plugin and put the file ayb_posts.php in the plugin-folder of your WordPress-installation.
  2. Then activate the plugin.
  3. In your template – e.g. the sidebar – you can insert the following PHP-code:

    <?php if (function_exists("ayb_posts")) { ?>
    <div class="einjahr">
    <h2>Vor einem Jahr</h2>
         <?php ayb_posts('day=7'); ?>
    <?php } ?>


20 Mei 2019
Danke für die Anpassungen und Optimierungen mit der Version 1.0.3 – genau das habe ich gebraucht!
18 Julai 2017
I like the plugin: does what I need it to do. Nevertheless my website needs an update, PHP 5.3 is more or less an ‘ancient custom’… @@ -358,7 +358,7 @@ function ayb_posts($ayb_para = ”) { $ayb_parameter = explode(‘&’, $ayb_para); foreach ($ayb_parameter as $ayb_temp) { – $b = preg_split(‘=’, $ayb_temp); + $b = split(‘=’, $ayb_temp); $instance[$b[0]] = $b[1]; }//$ayb_parameter as $ayb_temp $widget_arr = array();
3 September 2016
Das Plugin ist relativ leicht installierbar, gut anpassbar (aber auch nur wenn man die Anleitung auf der Webseite des Autors anguckt) und funktioniert auch. Leider kann man die Jahreszahlen nicht ausstellen (weder über PHP, noch über Widget). Sehr häufig wird das Datum eines Ereignisses mehrmals aufgelistet.
Read all 5 reviews

Contributors & Developers

“A Year Before” adalah perisian sumber terbuka. Orang-orang berikut telah menyumbang kepada pemalam ini.


Translate “A Year Before” into your language.

Berminat dalam pembangunan?

Layari kod, periksa repositori SVN, atau langgani log pembangunan dengan RSS.



Add: #thumbnail’-pattern to show featured imagages of articles


Fixed some PHP-Notices (Patch by lostfocus )


Fix (again): Again sometimes other post-types (like menu-items) were shown.


Fix: Error with PHP 5.3 when called by PHP-statement. Thanks to for reporting the error


  • Fix: Sometimes other post-types than posts and pages were shown


  • Fix possible display-error in plugin-list


  • set number of articles to be listet
  • various fixes
  • changed url to my blog – is my new blog for programming, design, journalism, etc


  • show pages or not
  • public, private or both articles can be shown
  • widget output can be edited with patterns %link%, %title%, %date%, %excerpt% (thanks to Marcus from for the excerpt-idea)
  • fixed bugs, i.e. timezone-bug
  • use of wordpress’s widget-class (plugin works now wordpress 2.8+ only)
  • OOP-programming


  • added uninstall-feature for wordpress 2.7+. if the plugin is deleted, the options of this plugin will be deleted in the wordpress-database.


  • fix: check if functions are already declared (for multiple use of the plugin)


  • unknown changes


  • kicked out debug-messages … =:-)


  • bit of cleanup
  • make date-calculation gmt-sensitive. the wordpress-timezone-option is used now. should fix problems, where articles, written a few hours (the timezone-difference) before or after midnight are not displayed correctly.
  • some minor bugfixes


  • adding anniversary-mode. if anniversary=0, all articles matching the current day and the current month will be show, regardless of which year (beside the actual year of course). all settings of day, month, year and range will be ignored.


  • using the wordpress timezone-offset


  • fixed: plugin generated invalid XHTML in some cases


  • added range-parameter. you can use e.g. year=1&range=7 if you want to look back one year for articles. if no article is found on this day, the plugin will look up to 7 days back and lists the articles of the day the first article was found.


  • Fix for sidebars not named ‘sidebar’


  • Minor clean-up


  • Fixed finding localization files


  • Localization
  • Added german language-file


  • Make sure the non-widget-use of the plugin


  • ‘Widgetize’ the plugin


  • XHTML-Bugfix (unnecessary span)
  • Bugfix PHP 5 Error with empty function-parameter


  • Bugfix for more tolerant date-values (e.g. day > 364). Thanks to AlohaDan for hinting and testing.


  • Adjustment for MySQL-versions older than MySQL 4.1.1


  • First public beta