• Resolved alexbueno1

    (@alexbueno1)


    Hi there,

    First, thank you for this great plugin! I’m starting using it to display historical events (“On This Day”) on my WordPress site, and it’s working well.

    However, I have multiple posts for the same date (for example, two or more events that happened on July 31), but the plugin always displays the same event and doesn’t show a random one each time the page reloads.

    Is there a way to configure or customize the plugin so it randomly displays one of the multiple posts for the same date on each page load?

    If this feature doesn’t exist yet, I would love to see it added in a future update.

    Thanks in advance for your support and help!

    Best regards,

    Alex

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Ah, thanks for the suggestion! The plugin is generally designed with the assumption that you’d want to display several (if not all) of the past years’ posts, so I hadn’t really accounted for the possibility of just showing one.

    It sorts them chronologically, so yes, you would always get them all. It would be pretty easy to add a randomize option though. Look for that in the next update.

    Thread Starter alexbueno1

    (@alexbueno1)

    Hello! Thank you for you answer 🙂

    That’s a very good idea and option, especially to improve the aesthetics of a site when you don’t want to show many “On This Day” posts in sidebars.
    Currently, I chose to display only one, and it would be fantastic if it always shows one but randomly selected each time..

    I will eagerly await that update! Thank you very much!

    I should probably mention this (since I frequently forget it myself)… if you’re using a caching plugin, the randomize feature would still show the same post every time until the cache gets cleared, because — at least right now — the plugin is entirely PHP, so its output is static with the rest of the page content. I could investigate reworking it to load over AJAX instead so it’s independent of caching, but that would be considerably more involved.

    Adding the PHP-based randomize feature is so trivially easy that I could probably implement it and have a new version ready in 5 minutes, but I’ve learned from past experience to avoid releasing updates in too quick succession. People don’t like it. And I just rolled out an update this afternoon.

    Thread Starter alexbueno1

    (@alexbueno1)

    Alright! I just updated the plugin, and that’s actually what gave me the idea to open this thread and ask about it. And yes, thanks for that observation regarding caching.
    Even so, for sites that constantly load new content (and efemerides) daily, I think it could work very well if the random posts refresh every 30 minutes or 1 hour (in cases where there are more efemerides loaded than the ones selected to display, of course).

    Currently, I’m using it like this on my site svmusica.com (right sidebar, near the top of the homepage) 🙂

    So, I’ll wait for the next update! Thank you very much for your attention 🙂

    As I mentioned it would not take long to add this feature (at least, the non-AJAX version). I don’t want to release more than one update in one day, but if you want access to it right now, I’ve checked in a beta version with it added:

    https://downloads.wordpress.org/plugin/room-34-presents-on-this-day.3.6.1-beta-1.zip

    Thread Starter alexbueno1

    (@alexbueno1)

    Thank you very much for the link! Unfortunately, I have installed the new beta version and cleared the cache of my site and browser (in different browsers, actually), but I still see that the posts are not showing randomly yet…

    Did you turn on the new option? It still defaults to chronological, but there’s a new setting in the Widget for “Random order”. If you’re using a shortcode, you’ll need to add random_order="true" to it.

    Thread Starter alexbueno1

    (@alexbueno1)

    Sorry, I hadn’t done it!! Haha

    Now yes, and the plugin works perfectly. Thank you very much my friend, this is exactly what I was looking for 🙂

    Excellent. I’m not sure when the next official release will be, but your site’s updater should just resume getting them automatically, and this change will be in there going forward.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Help: Display Random “On This Day” Posts When Multiple Exist for Same Date’ is closed to new replies.