This 2012 is rather busy for me. At least I’m entering it with my laptop overloaded…
A week ago or so, I was asked by a client (happy new year, David!) to code a function to display featured posts in a magazine style in the thesis feature box. Rather simple job, at a first glance. But as the budget was correct (100 USD), I wanted to code something really easy to use for a beginner and a powerful tool for a developper (so that it is easy to adapt it to many other cases). I often see similar requests on DIYthemes forums, so many potential cases where to use such a code.
Here is how it should look out of the box :
The Idea of featured posts plugin
Main idea is to show a set of most important content of your site on the front page. So that the new visitor clearly see where to go by clicking an image (people adore clicky images).
How to accomplish this in thesis theme
Thesis has a box that you can use to add anything you want – Feature box. It is easy to configure it to be displayed on your front page, blog home page or all over your site via the Design settings. The difficulty for a beginner is that to add something to this box you need to use php function added to a hook
thesis_hook_feature_box… While adding a function there can be easy even for a beginner, coding such a function could be quite a challenge.
This is what this plugin does.
How featured posts plugin works
The plugin has two parts :
- setting page – where you can configure what content and how it is displayed
- loop – the function itself that displays the featured posts
Why a plugin and not a custom function?
Well, there are plugins and plugins. While some of them are badly coded and eat too much ressources for poor result, the others give you a functionnality you need and a human interface to control what the plugin does and how it does it… without too much jams. But all plugins are actually custom functions. So a badly coded php function stays bad thing for your site even if it is in your theme file and not in the plugin directory.
I coded it as a plugin for two reasons :
- code portability – install it from zip file, activate and you’re good to go
- automated distribution – it is not me personnaly who installs it on your site when it is 4:00 am (last client of mine has 11 hours time gap with me)
Features of the plugin (a teaser of)
- Real human interface to control the plugin functionnality. Yes you may configure pretty much everything you need in the featured post display via click-click way.
- Better image output.
- SEO for image links and titles (there is no
thumbnail forstuff, just post or image titles).
- Generates thumbnails either WordPress way or Thesis way (note in thesis way the posts are searched for images if you screwed up
the rightthesis post image settings).
- Character level of control over the excerpt lenghts (the length for first post is different from the others).
- Brandable read more links and their CSS classes.
- Possible shortcode integration into a page or post.
So if you interested in the similar functionnality to display your featured posts in thesis (or other wordpress theme), stay tuned by filling into the form below.