Plugin Directory

Posts By Tag

Provide sidebar widgets that can be used to display posts from a set of tags in the sidebar.

Posts By Tag WordPress Plugin, provides sidebar widgets which can be used to display posts from a specific set of tags in the sidebar.

These tags can be specified in the widget or the Plugin can automatically retrieve them from the current post.

You can also use shortcode or template function to display the posts.

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. If this clashes with other Plugins, you also have an option to disable it.

Features

Sidebar Widget

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 from where posts should be selected (or excluded)
  • 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 display post author.
  • Option to display post date.
  • Option to display post content.
  • Choose the order in which the posts should be displayed.
  • Option to exclude current post/page.
  • Option to display links to tag archive pages.
  • Option to disable the cache if needed.

Template function

In addition to using the widget, you can also use the following template function to display posts from a set of tags, anywhere in the theme

posts_by_tag($tags, $number, $exclude = FALSE, $excerpt = FALSE, $thumbnail = FALSE, $order_by = "date", $order = "desc", author = FALSE, date = FALSE, $content = FALSE, $exclude_current_post = FALSE, $tag_links = FALSE);

  • $tags (string) - set of comma separated tags. If you leave this empty, then the tags from the current post will be used.
  • $number (number) - number of posts to display
  • $exclude (bool) - Where to include the tags or exclude the tags
  • $excerpt (bool) - To display post excerpts or not
  • $thumbnail (bool) - To display post thumbnails or not
  • $order_by (date,title) - Whether to order by date or by title.
  • $order (asc,desc) - To change the order in which the posts are displayed.
  • $author (bool) - To display author name or not.
  • $date (bool) - To display post date or not.
  • $content (bool) - To display post content or not.
  • $exclude_current_post (bool) - To exclude current post/page.
  • $tag_links (bool) - To display link to tag archive page or not.

Shortcode

You can also include the shortcode, to display the posts from the set of tags

[posts-by-tag tags = "tag1, tag2"]

All the parameters that are accepted by the template tag can also be used in the shortcode

Caching

Note that the Plugin caches the db queries only when it is used as a widget. If you are going to use the template tag or use shortcode, then you have to cache it yourself. Even while using the widget, you have the option of disabling the cache if needed.

Styling using CSS

The Plugin adds the following CSS classes. If you want to customize the look of the widget then can change it by adding custom styles to these CSS classes and ids.

  • The UL tag has the class posts-by-tag-list
  • Every LI tag has the class posts-by-tag-item
  • Each LI tag also has the id posts-by-tag-item-{id}, where id is the post id.

Translation

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.

Support

Support for the Plugin is available from the Plugin's home page. If you have any questions or suggestions, do leave a comment there or contact me in twitter.

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.

Links

Requires: 2.8 or higher
Compatible up to: 3.3.2
Last Updated: 2012-5-1
Downloads: 17,104

Average Rating

5 stars
(9 ratings)

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,2,2
0,1,0 100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1 0,1,0 100,1,1
100,2,2 100,1,1 100,1,1 100,1,1