« Object Oriented Javascript with Mootools
» Speed Up Visual Studio 2005


Future Posts Widget

Chris Spurlock | 11.17.07 | Plugins, Project Releases, Widgets, Wordpress
future-posts-widget

Would you like to keep your readers informed on what you are currently writing? Perhaps you already have a method of displaying what you are working on through a standard text box widget in WordPress. We used to manually add and delete titles through that text box widget, too. But wouldn’t you rather have a plugin to automatically search your database for drafts and display the titles for you? Well, if you are just as lazy as us, then TehDevs has your answer!


Future Posts Widget

Future Posts Widget is a widget for WordPress that searches for articles in your WordPress database with a post status of either draft or future and extrapolates those articles’ authors and titles. These titles are displayed just as the default Recent Post widget displays them. Using the widget framework, the titles from your drafts will be displayed in the same theme as your current theme.

Figuring out this framework was the hardest part for me. I referred to this example to see the layout of the widget framework and how the plugins are registered within WordPress. If you want to see which methods are defined and what they do I recommend reading this template as it is well commented. However, it has an error in the options part of the code pertaining to updating. If you read through all of the comments on that page you can figure out what you need to do. Simply the line that reads:

$options = get_option(’your_widget_name’);

This line really needs to read:

$options = $newoptions = get_option(’your_widget_name’);

That should get the template up and running. However, the template does not really accomplish much other than display a box on the page with a title and some text. It is just that; a template. But, once I had the general layout and framework figured out I could swim around in database land.

One feature of this plugin is the ability to group the upcoming articles by author. This is handy for multi-author sites such as TehDevs.net. This is selectable in the options via a radio selection, along with a custom title for the dialog.


Future Posts Options

If you do not choose to group by author then you will see a simple list of the articles currently saved, yet unpublished, appear without the authors’ names.


Future Posts Not Grouped

Selecting the group by author option will display the titles under their respective authors. As you can see, I was writing this article and it has been displayed in the future posts for a while. I was hoping a few people would catch this “easter egg”. Do you get it? Future Posts Widget was listed under the Future Posts list… ahhhh… never mind…


Future Posts Grouped

To use this plugin download this file and unzip its contents. Then, upload the folder it contains into your WordPress wp-content/plugins directory. After you do this you must activate this plugin through the Plugin Management page. To add this widget to your page you do this through the Widgets tab under the Presentation page. This is also where you change the options.

Download V1.01

3 Comments

:

:


« Object Oriented Javascript with Mootools
» Speed Up Visual Studio 2005