Posts by Tag WordPress Plugin, provides sidebar widgets which can be used to display posts from a specific set of tags in the sidebar.
The Plugin caches the posts of each widget separately, and issues database queries only when needed. This will reduce the amount of database queries involved for each page load and will therefore be light on your server.
Download
You can download the Plugin as a zip file from the WordPress Plugin repository.
Installation
Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page. You should see a new widget called “Tag Posts” in the widgets pages, which you can drag and drop in the sidebar of your theme.
Features
Posts By Tag Plugin provides a sidebar widget which can be configured to display posts from a set of tags in the sidebar. You can have multiple widgets with different set of tags configured for each one of them.
Each widget allows you to choose
- The set of tags whose posts should be displayed
- The number of posts to be displayed.
- Option to enable post excerpts to be displayed with post titles.
- Option to display post thumbnail if present.
- Option to specify the sort order for posts
Screenshot
![]()
Template Tag
The Plugin also supports the following template tag which can be used to display the posts in any part of the theme.
postsbytag($tags, $num, $excerpt = false, $thumbnail = false, $order = “desc”);
- $tags (string) – set of comma seperated tags
- $num (number) – number of posts to display
- $excerpt (bool) – To display post excerpts or not
- $thumbnail (bool) – To display post thumbnails or not
- $order (asc,desc) – To change the order in which the posts are displayed.
Translation
- Swedish (Thanks Gunnar Lindberg Årneby)
- Turkish (Thanks Yakup Gövler)
- Belorussian (Thanks FatCow)
The pot file is available with the Plugin. If you are willing to do translation for the Plugin, use the pot file to create the .po files for your language and let me know. I will add it to the Plugin after giving credit to you.
Feedback
If you have any comments or if you want to report any bugs, please leave a comment below or contact me.
Stay updated
I would be posting updates about this Plugin in my blog and in Twitter. If you want to be informed when new version of this Plugin is released, then you can either subscribe to this blog’s RSS feed or follow me in Twitter.
Changelog
- 2009-07-26 – v0.1 – Initial Release
- 2009-08-02 – v0.2 – Added Template function and Swedish translation.
- 2009-08-14 – v0.3 – Improved cache performance and added Turkish translation.
- 2009-09-16 – v0.4 – Added support for sorting the posts (Thanks to Michael http://mfields.org/).
- 2010-01-02 – v0.5 – Removed JavaScript from unwanted admin pages and added Belorussian translation.
Works great, thank you…
@Baron,
Nice to know that you like the Pluign
This is real nice but do you think you could do one for categories too?
@Yuna,
There is a Plugin called Category Posts which does the same for categories.
Does it support custom taxonomies too? It would be nice if this plugin can also support template code too so that we can show the posts whereever we want.
@Navjot,
The Plugin don’t support custom taxonomies (yet
). I have added support for template tags in the latest version of the Plugin.
hey, firstly, great work on the plugin! I am just wondering if there is a php template for the widget, thanks.
@Hercules,
I have added a template tag in the latest version of the Plugin. Check out the readme file to find out how to use it.
Hey, there’s a slight bug (or maybe it’s my version of WP), but i keep getting this when I try to activate the plugin:
Fatal error: Class ‘WP_Widget’ not found in /home/content/j/a/w/jawatech001/html/LIQUIDASSETSTV/wp-content/plugins/posts-by-tag/posts-by-tag.php on line 69
@DrDrinx,
What is the version of WordPress you are using? The Plugin works in WordPress 2.8+ only.
nice plugin. i am sure a lot of wordpress user is waiting a plugin like that.
but… in wordpress 2.8.3. it doesnt show thumbnail. And it is very important.
and there should be also someting: we could make excerpt word limit .-) why Not:-)
@Şahin Çimi, the plugin uses ‘post_thumbnail’ special fields of your posts. So if you add thumbnails has different names to your posts, the plugin won’t display it. Edit the plugin’s file, find ‘post_thumbnail’ and change as you use, for example ‘thumbnail’.
Dear Sudar,
I translated your plugin to Turkish. You can download here and you can read my post about your plugin here.
Thanks for your plugin.
@Yakup,
Thanks for the translation. I will include it in the next update.
Yakup Kardes olmadi..
bak calisan bir ornek var:
<div class="post “>
<a hr
bunu bu eklentiye nasil entegre edicez. seninkinide indirdim. olmadi.
tesekkurler.
Cool plugin! I have been wanting to add a ‘featured posts’ menu to my site for a while now.
@Richard,
Nice to know that my Plugin was useful to you.
Hey! thanks for adding the template stuff! Only problem is the plugin doesn’t work on my wordpress 2.6.3 lol….. any chance it get it to work somehow? it triggers a fatal error when I try to activate it. thx again!
@Hercules,
The Plugin is compatible only from 2.7. If it’s possible try to upgrade WordPress. The older version has some security issues also.
@Sudar
Unfortunately, my theme only supports up to 2.6.3 I believe, I just tried to install 2.7 locally but the theme is all broken…..any chance I can get this plugin to work on 2.6.3? Thanks a lot for your help!!!
nevermind
i think i might be able to get it to work on 2.7 – thx
sorry, just another question…..
Is it possible to display posts in a list by using the template? for some reason i’m not able to do this on single pages (where I’m hoping to display the links)…. any ideas? thanks again!!
@Hercules,
Right now it is not possible