Let me preface this post with the fact that this is a technically oriented post. If you don’t program Wordpress then this post will be of no use to you. After browsing the web trying to find an effective recent posts plugin for a client’s website, I decided to make my own. I couldn’t find a plugin that made it easy to completely customize how recent posts are displayed. The version that I made includes a template system. As of now I have added support for the post title, date, permalink, and comment content. After uploading the plugin into your plugins directory, simply call the function neo_recent_posts().
The function has six arguments:
- Number of Posts – This is the number of posts that you would like to have displayed.
- Offset – Offset is how many posts you would like to skip over.
- Post Length – Post length will limit the length of the post comment to the number of words specified.
- Before – Any html that you would like before each post.
- After – Any html that you would like after each post.
- Post Style – This argument provides the main benefit of this plugin. Currently accepted tags are:
- {POST} – This is the content of the post.
- {TITLE} – This is the title of the post.
- {DATE} or {DATE, dateformat} – These two tags will display the date. If you would like to customize the date format, simply append the date format to the tag using standard MySQL DATE_FORMAT specifiers.
- {PERMALINK} – This is the post permalink.
I will be adding additional functionality in later versions to include categories, and post author. If you have any questions, don’t hesitate to contact me. You can view an example of the recent posts in action over at Bluey Blog. Take a look at the ‚ÄúRecent Posts‚Äù on the sidebar.
March 10th, 2007