WP Manifestindependent plugin directory

On This Day

A widget that displays a 2x2 grid of posts from the current date in the last four years

by Matt Harvey · github.com/mattgharvey/otd · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/mattgharvey/otd/archive/refs/heads/main.zip

On This Day - WordPress Widget Plugin

A WordPress plugin that displays a 2x2 grid of posts from the current date across the last four years.

Description

The "On This Day" plugin adds a customizable widget that showcases posts published on the current date (month and day) from the previous four years (1-4 years ago). Perfect for highlighting historical content and encouraging visitors to explore your archive.

Features

  • 📅 Automatically displays posts from today's date from 1-4 years ago
  • 🎨 Beautiful 2x2 responsive grid layout
  • 📆 Year labels on each card
  • 🖼️ Featured image support with hover effects
  • 🔗 "See More..." link to view all posts from this day across all years
  • 📄 Custom archive page for browsing all posts from a specific day
  • 📱 Mobile-friendly responsive design
  • 🌓 Dark mode support
  • 🎨 Monochrome design that inherits your theme's link colors
  • ⚙️ Customizable widget title
  • 🎯 Easy to use - just add the widget to your sidebar or widget area

Installation

  1. Upload the otd folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Go to Settings → Permalinks and click "Save Changes" to register the archive page URLs
  4. Go to Appearance → Widgets
  5. Add the "On This Day" widget to your desired widget area
  6. Customize the title (optional) and save

File Structure

otd/
├── on-this-day.php           # Main plugin file
├── includes/
│   └── class-otd-widget.php  # Widget class
├── assets/
│   └── css/
│       └── style.css         # Widget styles
└── README.md                 # This file

How It Works

The plugin queries your WordPress database for posts published on the current month and day from:

  • One year ago
  • Two years ago
  • Three years ago
  • Four years ago

It displays up to one post from each year in a 2x2 grid format. The widget also includes a "See More..." link that takes users to an archive page showing ALL posts from the current day throughout your site's history.

Customization

Modifying the Date Range

To change the number of years displayed, edit the $years array in includes/class-otd-widget.php.

Styling

All styles are contained in assets/css/style.css. You can customize:

  • Grid layout and spacing
  • Colors and fonts
  • Hover effects
  • Responsive breakpoints

Post Types

By default, the widget displays standard posts. To include custom post types, modify the post_type parameter in the get_posts_from_this_day() method.

Requirements

  • WordPress 5.0 or higher
  • PHP 7.0 or higher

Support

For issues, questions, or contributions, please visit: https://github.com/MattGHarvey/otd

License

GPL v2 or later

Changelog

1.0.0

  • Initial release
  • 2x2 grid layout
  • Responsive design
  • Featured image support
  • Dark mode support