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.31   Updated Tuesday, July 7th, 2009 at 6:18pm

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. You can also choose to only shift a post if it has been more than a set number of hours since the last post.

Download

  If you have found this page useful, please consider donating. Thanks!

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

  • 07-07-09 Version 1.31 – Added option to only shift a post if it has been a set number of hours since the last post was added.
  • 02-22-09 Version 1.3 – Updated to work better in recent WordPress versions. Log file support added, and several other updates. Can also shift posts when no drafts are available.
  • 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.

Only Shift after X Hours

If used, a post will only be shifted automatically if it has been more than this many hours since the last post was added.

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.

Log File

Full path on your server where you would like the log saved. You can leave this specific to this blog, or set up a global log for multiple blogs. Leave blank to disable this feature. Be sure to give this file write-access

Pages: « 6 [5] 4 3 2 1 » Show All

  1. thank you very much for the post! just subscribed to your rss! ;)

  2. 74
    Ajay

    I was wondering that in addition to the changing the postdate / time stamp function whether it will also ping also.

    Thanks & Regards,
    Ajay

  3. Trinifieds: Sure, currently, the setting is in hours. So find this line in the script:

    wp_schedule_event(((int)get_option('ddps_delay') * 3600), 'ddps_schedule', 'ddps_postshift' );

    3600 is the number of seconds in an hour. So if you change that to 1800 for example, then a setting of 1 would mean 30 minutes. Just divide it however you like.

    If you wanted to, you could even remove the multiplication, and then the value you enter is the number of seconds until the script runs.

  4. Hi, is there a way to set the rotation to less than an hour?

  5. Version 1.31 Released

    This update adds an option to only shift a post if it is been a set number of hours since the last post was added (set to 0 to disable this feature).

    This plugin has been tested, and works, in the latest release of WordPress – 2.8

  6. 70
    Barry

    My plugin is working fine now. I just needed to imput the category I’d number instead of the category name.

    Thank you. Barry

  7. 69
    Barry

    My selected post are not rotating.
    I created a new category for the post I wish to rotate. I called it ‘Top Post’. That is what I typed in for my Category ID(s)field in the plugin set up. Everything seems like it should be working. Did I miss something?

    I get this response in my Scheduled Draft Publish log:

    06/14/09 08:37:24 wp_ Unable to find a post to shift.
    06/14/09 17:05:25 wp_ Unable to find a post to shift.
    06/15/09 17:12:17 wp_ Unable to find a post to shift.
    06/15/09 19:03:25 wp_ Unable to find a post to shift.
    06/15/09 19:06:12 wp_ Unable to find a post to shift.
    06/15/09 20:00:20 wp_ Unable to find a post to shift.

    Please help, and thank you very much. I think the plugin will be awesome when I get it running.

    Barry

  8. 68
    Lee Boswell

    i am trying to use the plug-in on a WordPress MU site but the script gives me the following error..Any ideas?

    Fatal error: Cannot redeclare ddps_add_option_pages() (previously declared in /home/ttpstude/public_html/blogs/wp-content/mu-plugins/dd-scheduled-post-shift.php:26) in /home/ttpstude/public_html/blogs/wp-content/plugins/dd-scheduled-post-shift.php on line 29

  9. 67
    Brian

    Maybe I’m doing something wrong, but the posts seem to shift for a day, and then revert back to the normal posts the day after. I’m running WP 2.7.1

  10. This is a great way to save time everyday. I’m glad I found it!

  11. What a great little plugin. Thanks mate. It gives my home page a renewed look everyday :)

  12. nice thanks man….

  13. 63
    Richard

    Thanks for the update. I can confirm this is now working correctly on wp2.7 Many thanks!

  14. Richard: The wrong copy was uploaded – This has been fixed. The category selection should be working now, and the shift should start 1 specified interval after the time you enable it.

    As for the file being created automatically – that is by design. Otherwise you would have to have a pre-created folder with write permissions for it to create the file in. It is no less work to just create the file manually if you choose to.

    Please re-download and give it a shot :)

  15. 61
    Richard

    One further point; Your directions state “The schedule will start as soon as you click the ‘Enable Post Shift’ button.” On this version clicking the enable button appears to create an immeadiate shift, as well as starting the time delay.

Pages: « 6 [5] 4 3 2 1 » Show All

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.