Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Version 1.22   Updated Thursday, August 28th, 2008 at 7:19pm

Scheduled Post Shift Plugin for WordPress

This plugin automatically takes your oldest post, and updates its timestamp so that it appears as the latest post on your WordPress site. It does this by utilizing the cron feature built into WordPress 2.1 (and newer). It can rotate all the posts on your site, or just ones in specific categories. You can currently schedule it by setting the number of hours between shifts. For example, set it to 24 hours and it will shift the oldest post every day, at the time that you enabled it.

Download

Instructions

  • Download the above file, rename it from .txt to .php, and upload it to your plugins directory
  • Enable the plugin
  • Configure the plugin options (under DDPostShift)
  • Click the ‘Enable Post Shift’ button to start

Disabling the Schedule

To stop the schedule, simply click the ‘Disable Post Shift’ button on the options page.

Change Log

  • 08-28-08 Version 1.22 - A few bugs fixed. Now supports multiple category rotation.
  • 04-27-08 Version 1.21 - Updated for WordPress 2.5 and to be compatible with WP Security Scan plugin
  • 09-29-07 Version 1.2 - Updated for WordPress 2.3
  • 05-16-07 Version 1.1 - Updated for WordPress 2.2
  • 04-09-07 Version 1.0 - First release

Options

Here are the options available in this plugin’s options page in the WordPress admin panel.

Shift Delay

This is the number of hours between post shifts. The schedule will start as soon as you click the ‘Enable Post Shift’ button.

Category IDs

If left blank, the plugin will operate on all of your posts. If you enter a comma-separated list of category ID’s, it will only update posts in those categories.

  1. 39
    John

    Great plugin. I’d like to get it to work in conjunction with Scheduled Draft Publish, in that it won’t post shift if there are drafts still available to publish. How’s that sound?

  2. ovidiu: If you stop using the plugin, the posts will be just as they were when you disabled it. It will not go back and change any dates.

    If you only want some posts from a category shifted, the easiest method would be to just add them to a secondary category, and just shift that one.

  3. Version 1.22 has been released

    A bug was fixed in which it was not properly checking for published posts, which would cause the plugin to not rotate posts in newer versions of WordPress.

    The plugin also now supports multiple categories. It can rotate posts from all categories, or just those you specify.

    Special thanks go to Marios for his code fixes and suggestions.

  4. 36
    ovidiu

    also it would be nice, if there was a way to stop certain posts from being recycled this way, even if they are inside the specified category, maybe using a special tag in the post or a custom field

  5. 35
    ovidiu

    just wondering what will happen if one day I decide to stop using the plugin: will all posts shift back to their original post date, or will they just remain shifted?

  6. I’m using WP 2.6, after upload the .php file, I can’t see the plugin to be activate in the plugin admin page.. Is I did anything wrong?
    Thanks..

  7. I am using a WordPress 2.3.1. It can make use of it?

  8. The re-posting doesn’t happen for me if I specify a category ID. All is good if the category ID is blank though. Any thoughts on how I can figure out what’s wrong? I’m using WordPress 2.5.1.

    Thanks!

  9. using plugin my website: http://2009.ater.com.br/

  10. represent our special blog -

    http://saturn.efx2blogs.com/40354/

  11. I cannot understand what the benefit would be for activating such a wordpress plugin. Is there just an idea behind this or is there people or a person that used this with great results. Do not be afraid to share your ideas. We all need to hear… :-)

  12. I was wondering if this plugin is bad for SEO? also if I have a site map does it effect the sitemap also? Thanks for a response

  13. Thanks for the wonderful plugin. This is such a time saver!!

    I was wondering if there is a way to exclude a certain category? Thanks in advance!

  14. Feature suggestion… Rather than restrict posts to just one category, it’d be handy to be able to provide a list of category IDs from which to rotate or to provide a list of categories from which to NOT rotate.

    Very cool plug-in though!

  15. i’m using oldest2newest plugin now and it works pretty good.
    i modified it to included scheduling post in a category.

  16. did a check on the sql code and it seems that one part of it is wrong.
    it should be
    AND {$tp}posts.post_status = ‘publish’
    instead of
    AND {$tp}posts.post_status = ‘published’

    even though i have change to publish, it doesn’t work on 2.5.1 too.

  17. Doesn’t work on my site using Wordpress 2.5.1. Nothing happens.

  18. I love the plugin. I have a site that functions as an online breviary (a book of prayer). It follows a 28 day morning and evening cycle and then repeats. Your plugin is PERFECT for this.

  19. This plugin works great on one site I have, but on two others it simply refuses to rotate any posts once enabled. I believe all 3 sites are WP 2.3+ and use nearly all the same plugins.

    Any ideas on how I could begin to troubleshoot why it would work on one site, but not two others? I realize your time is scarce, any help is appreciated! =)

  20. Yes it does change it can break your links if they are date based, I am trying it with permalinks based upon categories

  21. This may be the ticket for a couple of my sites but I am curious about the URL change. My permanent link will display the date in the URL. Does this change? I would be concerned that anyone that had linked to my permalink would then have a broken link. Here is an example of the permalink for one of my sites:
    http://www.vacationspotscomments.com/2007/09/23/maui-kapalua-bay-resort/

    Note the date. Does this change as the post is recycled to the top of the list?

  22. What happens to the comments posted once its has been reposted

    Could you add a feature which excludes a certain category out of the reposting

    Its a great plugin love it, had to change my permalinks though

    Thanks

  23. I love the plugin. I have a site that functions as an online breviary (a book of prayer). It follows a 28 day morning and evening cycle and then repeats. Your plugin is PERFECT for this. Unfortunately, the RSS feed goes stale after the first cycle. In other words, those folks that have subscribed for over a month don’t get a new feed when the cycle begins anew. Any suggestions?

  24. Thomas: I may actually consider that for a future version. But yes, if you make sure to keep everything unique (plugin name, function names, option names, scheduled items, etc..) you can run more than one copy.

  25. 15
    Thomas

    Hello,
    Would you ever consider making it possible to have multiple schedules for multiple categories? In the meantime, if I wanted to do this w/o much coding skill, do you think it would work for me to copy your plugin, and rename all the references within it that have to be unique, thereby having two ‘copies’ of the plugin runinning at the same time?

  26. Christian: Yes, there are other ways to keep one article ‘on top’, but this is not that kind of plugin.

    Also, like a lot of WordPress plugins, this was not written for WPMU, and will not work with it.

  27. Is there no other WAY to keep an artiel UP? as First one! Problem with this PLUGIN is the RSS FEED! All Feed users get everytime a NEWS two news FEED MESSAGE after ONE NEW ARTICEL IS ON.

    The NEW one and the ONE which should be ON Top!

    And if you use you WP as MULTIBLOG with diffent regions then this plugin is not useable cause you cannon define aticeles in categories to stay on TOP!

  28. Rick: For free plugins and scripts, there is no promised troubleshooting. I get a lot of requests and try to help as many as I can, but I simply do not have the time it would take to troubleshoot everyones situation.

    I am not sure how you can check cron, but there may be some other plugins out there that work with it. I was looking for one myself that would list the current jobs, and allow you to delete them. If there is not one already for that, I may see about creating one eventually.

  29. 11
    Rick

    Thanks for the response!

    I have tried everything from 1 to your default.
    Once I enable it, should it immediately make a change or does it wait for the time period for the first one? I have waited for the time period but I was wondering if there was a quick turn around time for troubleshooting.

    Is there a way I can know if my cron is working or if the problem is with your plugin? Is there another plugin that makes it easy to test the cron?

    Your plugin is just what I need so I am willing to work to get this going!

    Thanks

  30. Rick: I do not believe that wp-cron.php was meant to be ran directly. That is why it does not display anything.

    I am not sure what to suggest as far as troubleshooting. This plugin is my first use of the wp-cron functionality, and creating it was a bit of a learning experience with wp-cron.

    What did you set the delay to in the options?

  31. Installed with 2.1.2 but doesn’t seem to work. Is there a way to troubleshoot this. If I run wp-cron.php directly I get nothing…
    Thanks for any help!

  32. ziranfaze.com: Once again, yes. This is, of course, not a plugin that everyone should install. It was made in particular for certain types of applications, where there is a need to have posts rotated.

  33. then for those readers who have been following our blogs will read the same thing repeatedly? Is this the purpose?

  34. ziranfaze.com: Yes.

  35. Will it affect the rss display? When an old post updated its timestamp, will it show in rss reader as new post?

  36. Miriam: You can choose to only shift posts in a specific category. Perhaps in the future I will make an option to shift all posts except those in a specific category.

  37. Hi, it’s me again (I wrote about your plugin for creating category columns, and asked if it’s possible to do one for links too, which you did!). This is a good plugin since we invest time in posts, and they get lost in the time-space continuum. However, I definitely have written posts that are dated and refer to events or occurrences that were relevant then, but are not relevant in the present. So I wouldn’t want every single one of my posts to reappear. Maybe there is a way to specify posts as dated and omit them from this cycle, i.e. with a custom field or something?

    Just an idea, not a criticism. Thanks!

  38. Christian: This tool does not do a one time placement of an article, it continually takes the oldest (post with the oldest date) article and moves it to the front. It keeps doing this, so posts are cycled.

  39. hmm Great IDEA :) We use Wordpress als CMS for 19 NEWS-Sides. I was looking for a TOOL that handle a TOP-Article(s) for the sides.

    f.e. You habe a HEAD-LINER Article and want it to stay online for 1 DAY! as FIRST ARTICLE! then another writer post a “simple police text message”. Normaly you MEGA 1st artikel is then at pos. 2 and the textmessage is on pos1!

    I think thats the main idea between “Scheduled Post Shift Plugin for WordPress”! But i saw that you cannot enter an ARTICLE ID! to be sheduled! What means “oldest article?”

    better NAME for the TOOL is “SET TOP-Article” :)

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.