(Use sprintf-style date placeholders - %1$s for month and %2$d for day - to insert the month and day into your intro.)

(Show results as years with posts on this day, or as post titles from this day in past years)

On This Day Widget by Steve Ivy, 2007
"; if (empty($before_widget)) $before_widget='
'; if (empty($after_widget)) $after_widget='
'; foreach ( $defaults as $key => $value ) if ( !isset($options[$key]) ) $options[$key] = $defaults[$key]; echo $before_widget; echo $before_title; echo (!empty($options['title'])) ? $options['title'] : "On This Day In..."; echo $after_title; ?>

get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAY(post_date) AS `day`, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' AND MONTH(post_date)=" . date(n) . " AND DAY(post_date)=" . date(j) ." GROUP BY YEAR(post_date), MONTH(post_date), DAY(post_date) ORDER BY post_date DESC" . $limit); if ($otd_results) { ?> get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' AND MONTH(post_date)=" . date(n) . " AND DAY(post_date)=" . date(j) ." ORDER BY post_date DESC" . $limit); if ($otd_results) { ?>