On This Day (formerly Room 34 presents On This Day) is a simple widget that displays a list of blog posts that were published on the same date in previous years. Customization options include:
- Message to display if no posts are found
- Maximum posts to display
- Show featured images (if available)
- Category filtering
- Optional On This Day archive page (new in version 2.0)
Important: While not technically required, the On This Day archive page assumes your theme includes an archive.php file that uses the the_archive_title() function to display the page title.
- Upload the plugin files to the /wp-content/plugins/ directory.
- Activate the plugin through the ‘Plugins’ menu in WordPress.
- Place the widget in one of your sidebars and customize as desired.
Note: This plugin requires PHP 5.3 or greater due to the use of anonymous functions (closures).
Why isn’t the archive page displaying the correct (or any) title?
If there’s an incorrect title, or no title, at the top of your page (before the title of the first post), check your theme. It should have an archive.php file, and that file must use the the_archive_title() function to display the page title.
“On This Day (by Room 34)” هو برنامج مفتوح المصدر. وقد ساهم هؤلاء الأشخاص بالأسفل في هذه الإضافة.المساهمون
ترجمة ”On This Day (by Room 34)“ إلى لغتك.
تصفّح الشفرة، تحقق من مستودع SVN، أو الاشتراك في سجل التطوير بواسطة RSS.
3.1.1 – 2021.11.20
- Updated plugin name on admin pages.
3.1.0 – 2021.11.20
- Changed displayed plugin name from “Room 34 presents On This Day” to “On This Day (by Room 34)”.
require_once()instances in main plugin file to use
- Updated tags in readme file.
- Bumped “tested up to” to 5.8.2.
- Removed support for the Category option if the widget block editor is enabled (included by default with WordPress 5.8). The functionality for loading the category list and saving that option does not work with the AJAX-based tools in the block editor, and the presence of this option was causing the plugin not to load at all in the widget block editor, although it still functioned properly on the site itself. If you wish to restore the old widget editing functionality, we suggest trying the Classic Widgets plugin.
- Changed shortcode behavior to return output instead of echoing it directly.
- Added shortcode support. Use
[on_this_day]anywhere shortcodes are supported. All of the regular widget options are available as shortcode parameters. See the plugin’s new settings page for details.
- Oh yeah, there’s also now a settings page! Go to Settings > On This Day.
- Added code to handle an arbitrary date (currently only works with shortcode, not widget).
- Fixed issue that was causing admin CSS file to load on front-end pages.
- Created separate front-end CSS file.
- Coming soon: translations!
- Modified conditions to show current year’s posts in widget when “Use post date” is set.
- Improved help text in widget configuration.
- Added text domain to i18n functions in preparation for translation support.
- Minor CSS tweaks in admin.
- Fixed displayed publish date of posts to resolve issues when post’s publish time falls on a different date between local time and GMT/UTC+0.
- Bumped tested up to version to 5.5.3.
- Fixed incorrect callback function name in
- Replaced all closures in actions and filters with named functions to give developers more flexibility in working with the plugin.
- Removed “On This Day” from archive page titles in keeping with the goal of avoiding any hardcoded front-end text until full i18n support is implemented.
- Made ‘See all…’ text string editable in widget configuration. This was the only non-editable text displayed on the front end. Making this text editable will allow for easier use of the plugin on non-English language websites while full i18n support is in development.
- Replaced uses of PHP
wp_date()for improved i18n support. (Full i18n support for all displayed text strings coming in a subsequent update.)
- Removed “See all…” links when a date has no posts.
- Removed “On This Post’s Date” when on archive pages.
- Fixed logic for “See all…” pages to work with a specific (not today’s) date.
- Added option to hide widget entirely when list is empty by leaving “Message to display if no posts are found” blank.
- Modified logic for hiding redundant lists so that if two lists on the same page are both empty and “Message to display if no posts are found” is set, then they’ll still appear.
- Added logic to prevent duplicate list of posts from appearing multiple times on one page. This allows creation of two widgets, one for showing today’s posts, and one for “Use post date” posts, for example.
- Added “Use post date” option to widget. If set, when viewing an individual post, the widget will show posts from the same date as the current post, not today’s date. On main blog or archive pages, widget will still show posts from today’s date.
- Added month/day filtering of Posts in admin to show all posts published on in given month/date.
- Fixed handling of a global array variable to resolve fatal errors with WP-CLI.
- Simplified date_query.
- Added On This Day Archive page.
- Refactored to use date_query instead of retrieving and then omitting posts from the current year.
- Made featured images clickable links to posts.
- Tested in WP 4.7.1.
- Updated “Tested up to” to 4.7.
- Fix for implode() warning when no categories were selected.
- Updated plugin repository description text.
- Added ability to filter list by category.
- Added ability to set maximum number of posts to display.
- Added option to display featured image with each post.
- General refactoring and code clean-up.
- Updated main function to use parent::__construct() for compatibility with WordPress 4.3.
- Updated link structure to use standard permalinks instead of custom-built URL format.
- Updated “Tested up to” tag.
- Added CSS class to ul tag and changed tag and class attribute for each li item.
- Original version.