Once in a while, we get “WordPress Questions” submitted to Post Status. They can range from first-time site builder questions to highly technical, advanced developer questions. So now, when we get a good question that’s not too easy, we’ll share it in Post Status Slack‘s #learntogether
channel and consider writing a post with answers contributed by the Post Status community. We may even follow up later to see how our advice actually played out, in a Post Status version of “Stump the Chumps.”
Anyone can play! If you don’t mind being featured here as an expert/chump, please take a shot at answering or improving (in the comments) our latest question from a WordPresser out there in the wild. Or, you can submit your own stumpers. Educational (and entertaining) answers are preferred.
Thanks to Tiffany Bridge, product manager at Nexcess/Liquid Web, and Mark Root-Wiley of MRW Web Design for their answers to our first question below. 🙏
Our Latest Question:
1. I am working on a “saint of the day” project for my website. There is a link on the homepage which should take the viewer to the saint for that day. I have created a page for each day. How do I make that link change automatically every day to the page for that day’s saint?
2. I also need a calendar on the homepage where each day links to the page for that day’s saint. The archives calendar sort of does this but (a) it only shows an excerpt from the page and (b) the archives calendar is only on the sidebar and I need the calendar to be a main feature
— Anonymous Post Status Reader
Possible Solutions from the Post Status Community:
- A very simple solution that doesn’t add much to WordPress would be to make 365 posts (perhaps in a custom post type or category) published on each day of the year they correspond to at
00:00:00
hours. Some of the posts would be backdated and published in the past. Others would be scheduled to be published on future dates.- Displaying the latest post in a “Saint’s Day” category or content type would give you the daily saint content wherever you want it, using your choice of content display blocks and custom archive page templates. Tiffany Bridge suggests using a Latest Posts Gutenberg block that’s set to display only one post, which would be the latest/current day’s saint, according to the website’s local time settings.*
- Possibly a boon to your SEO, you would need to use an auto-republish posts plugin (there are several) to recycle your 365 saints’ posts annually, which would also give you a chance to update them and keep the content fresh. Alternatively, you could update the published date on all the saints’ posts to the current year every New Year’s Day at
00:00:00
using a run-once custom plugin, code snippet, or database query. (Beware: there is a lot of potential for mishaps in this solution.) For this to work, it would be important not to use a chronologicalyear/month/date
permalink structure for your posts, although some auto-republish plugins (in their commercial versions) can cope with date-based URLs.
- An even simpler solution would be to create the 365 posts in a custom post type and then use Jeremy Herve‘s Posts on This Day plugin to display the current day’s saint in a widget position. However, this requires you to use widgets, which are going the way of the dinosaur as they’re replaced by blocks and full-site editing. You can still use a widget block to make use of Gutenberg and FSE with widgets, at least for the near term.
- Tiffany Bridge suggests a similar solution using the On This Day plugin to display your blog posts from the current date in previous years as a sidebar widget. (The “On This Day” plugin allows you to enter historic or future events and display them with an included widget and shortcodes.) Tiffany notes there’s also a This Day in History plugin that has a ton of shortcode attributes that might work too. (Tiffany also located a Catholic Liturgy Calendar plugin that has offsite links to the saint of the day. This is a totally different, ready-made solution that may not work in this case, especially if a different liturgical calendar is being used.)
Almost any recent post display widget or block would work with these solutions, and the core calendar widget (or something like the Archives Calendar Widget) can be used in the main content area. (There’s a plugin or simple code solution to load widgets in the_content
with shortcodes, but a future-facing Gutenberg solution would be better.) A really nice display for the unique purposes of a particular use-case would probably require some custom front-end work.
Focusing on the goal of having a nice display and interface, Post Status Member Mark Root-Wiley writes:
I don’t actually like this solution, but it would work to hack a calendar plugin with one event post per day. Then you get the calendar view for free and use an “upcoming event” widget showing the next 1 event for your “X of the day.” But like I said, feels like abusing a tool.
*In all of these solutions (apart from using a good event calendar plugin) one potential gotcha is that visitors on the other side of the international date line would be shown the wrong saint, relative to their local date/time. If that’s a concern, you could use chronological permalinks for your saints’ posts and a simple PHP (date
) or WordPress (function date_i18n
) to link to the proper URL based on the local date. And then make sure that link doesn’t get cached.
What’s your solution? Tell us in the comments.
And come learn with us at Post Status!
You — and your whole team can join Post Status too!
Build your network. Learn with others. Find your next job — or your next hire. Read the Post Status newsletter. ✉️ Listen to podcasts. 🎙️ Follow @Post_Status 🐦 and LinkedIn. 💼