How can I display a single post link, based on title sample and change monthly?

Here are few suggestions if you use a tag for the “Tarot Card Of The Month” posts and want to randomly select a single post each month:

  • It’s possible to order by random seed (see ticket here) in WP_Query. You could e.g. try it with the current month number.

  • Note that ordering by random does not scale well. A semi-workaround, for huge number of posts, could be to fetch first n posts and order them by random with PHP. Maybe change the order ASC/DESC by random as well? But there are lot’s of tricks out there.

  • Another possibility is to store the result from your random Tarot query with transients with ttl as 1 month. This might not be very accurate as the number of seconds in each month varies.

  • We could also check the current month number, before running the Tarot query. E.g. store it in the options table and when it’s different than the stored value, we update the stored query result.

  • Yet another approach could be to update the query results using wp-cron or unix cron for better accuracy.

There are few examples here that might be helpful.