Or configure it: ‘, $daysbefore = '3', $daysafter = '3', $mode='1', $yearsago = ‘1′, $limit = ‘5′); ?> or ‘, $daysbefore = '3', $daysafter = '3', $mode='2', $lastxyears = ‘2′, $limit = ‘5′); ?> or ‘, $daysbefore = '3', $daysafter = '3', $mode='3', $sinceyear = ‘2004′, $limit = ‘5′); ?> License This plugin is free software; you can redistribute it and/or modify (without commercial purposes) it under the terms of the Creative Commons License (don’t remove credits to author, please) You can view the full text of the license here: http://creativecommons.org/licenses/by-nc/2.5/ Installing 1. Once downloaded the file, change the file extension from .phps to .php 2. Upload it through FTP to the server where your Wordpress blog is hosted. 3. Copy it to the folder /wp-content/plugins/ . 4. Activate it through the plugin management screen. 5. Introduce the funtion (with or without parameters) wherever you want to show the X years ago entries. Changelog v.0.6.1 = Fixed bug when having quotes in post's title. Thanks to Mike Koepke for bug repporting and helping with fixing. v0.6 = Added 2 new modes, last X years and since year X. Corrected bug in $start_ago and $end_ago. v0.5.2 = XHTML valid. Thanks to to Luis Pérez v0.5.1 = Added the $daysbefore and $daysafter parameters. v0.5.01 = Now the limit option works, for real ;) v0.5 = First release. I decided to start on version 06 because of preserving version relation with “One year ago” plugin. Thanks Thanks to Borja Fernandez[ http://www.lamateporunyogur.net ] and Chris Goringe [ http://tis.goringe.net ] for writing those plugins and to Luis Pérez and Mike Koepke for their contribution. */ function around_this_date ($before = 'This week las year...:', $after = '', $daysbefore = '3', $daysafter = '3', $mode = '1', $yearsago = '1', $lastxyears= '1', $sinceyear='2005', $limit = '4') { global $wpdb; if ($mode == '1') { // "classic" mode $start_ago = (365*$yearsago)+$daysbefore; $end_ago = (365*$yearsago)-$daysafter; $entries = $wpdb->get_results ("SELECT " . "ID, post_title " . "FROM $wpdb->posts " . "WHERE post_status = 'publish' && (( TO_DAYS( NOW() ) - TO_DAYS( post_date ) ) BETWEEN " . $end_ago . " AND " . $start_ago . ")". "ORDER by 'asc'" . "LIMIT $limit" ); if ($entries) { echo "$before"; echo "