Wordpress ‘Oldest to Newest’ Plugin

Wordpress ‘Oldest to Newest’ Plugin



A WordPress webmaster wanted a routine that would periodically take the oldest post and make it the newest post, showing up at the top of the home page. This would rotate articles through the system, recycling old material.

This was similar to something I was thinking of doing, so I did this one along the way.

See all of our WordPress Plugins

This routine checks to see if an article has been posted in the last week, and if not, it locates the oldest post and changes the timestamp to the current day and time.

The interval is initially set at 168 hours (one week); this means that every week, an old post will be rotated to the top of the list and stamped with the current time and day.

The interval may be changed to any number of hours that you prefer by editing the $hours variable. By setting this large enough, it could be a day, a number of days, or weeks, even a month. (A week would be 168 hours, a couple of weeks, 336, etc.) It’s up to you.

A rotation will not occur unless a page is loaded from your WordPress blog. So if you’re extremely low on traffic, the rotation will be delayed until you have a visitor.

You might not want to use this if the timestamp is a critical component of your website, as the routine will change the timestamp with each move.

Features

  • Checks to see if an article has been posted in the prior period; if not, the oldest post is made fresh with a new timestamp.

  • The method allows you to post new articles and they maintain new status. Old posts are made new only if there’s nothing new already.

  • The default period is 168 hours, one week. This may be adjusted depending on your requirements.

  • If the old post is over six months old, the pinging mechanism will be engaged, just as if you’d manually changed the timestamp and republished the post.

If this plugin is helpful, use it. If not, ignore it; I probably won’t be interested in upgrading it.

Instructions

  1. Simply download and unzip it.

  2. Edit the number of hours, if you want something other than 168.

  3. Put it in your plugins directory.

  4. Activate it.

Download

Version 1.1: Download

Version Log

Version 1.0: Initial release for WP 2.0.5.

Version 1.1: Changed to rotate an old post only if nothing new has been posted. Added ping routine for old posts older than six months. Changed default period to 168 hours.


6 Responses to “Wordpress ‘Oldest to Newest’ Plugin”

  1. Anon Says:

    Thank you thank you thank you! I’ve been looking for something like this for a year now.

  2. Tommy Says:

    Will this work with the latest wordpress version?

  3. Emil Says:

    Thank you!!! I have been searching for a plugin like this for 2 hours!

    The last sentence in your post is a bit sad.. “If this plugin is helpful, use it. If not, ignore it; I probably won’t be interested in upgrading it.”. :/

    Anyway, thank you!

  4. Rich Says:

    Sad, but true… now that the WP guys are changing WP four times a year, I can’t keep up. So I’m sticking with 2.0.

  5. Catherine Says:

    Thanks for a great plugin.

    I was wondering if there was a way to use this plugin on a specific category. I’ve tried to use cat_ID in the getvar but I failed miserably :)

  6. Ryan Yockey Says:

    Hey Rich, I was having trouble getting oldest2newest working on my Wordpress installation, version 2.5. I took a little time and fixed the problem. I guess you have to include the wp-config.php file in the plugin now.

    Here is a link to the file on my website…
    http://www.ryanyockey.com/oldest2newest.zip

    Thanks for such a helpful plugin. I’ve been using it for the last year or so.
    -Ryan

Leave a Comment


Comments are accepted under the Submissions policy in this website’s Terms of Use.

Get our ‘Minute of Magic’ Newsletter! FREE!

Name: Email: