=== Posts By Tag === Contributors: sudar Tags: posts, sidebar, widget, tag, cache Requires at least: 2.9 Donate Link: http://sudarmuthu.com/if-you-wanna-thank-me Tested up to: 3.5.1 Stable tag: 2.7.4
Provide sidebar widgets that can be used to display posts from a set of tags in the sidebar.
== Description ==
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 specify the tags using custom fields in the edit post of page screen.
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.
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 specify the target attribute for links
- Option to display links to tag archive pages.
- Option to disable the cache if needed.
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, $options);
The following options can be passed in the $options array
- $tags (string) - set of comma separated tags. If you leave this empty, then the tags from the current post will be used.
- $options (array) - set of options. The following are the fields that are allowed
- $number (number) - default 5 - number of posts to display
- $exclude (bool) - default FALSE - Where to include the tags or exclude the tags
- $excerpt (bool) - default FALSE - To display post excerpts or not
- $thumbnail (bool) - default FALSE - To display post thumbnails or not
- $order_by (date,title) - default title - Whether to order by date or by title.
- $order (asc,desc) - default desc - To change the order in which the posts are displayed.
- $author (bool) - default FALSE - To display author name or not.
- $date (bool) - default FALSE - To display post date or not.
- $content (bool) - default FALSE - To display post content or not.
- $exclude_current_post (bool) - default TRUE - To exclude current post/page.
- $tag_links (bool) - default FALSE - To display link to tag archive page or not.
- $link_target (string) - default empty - target attribute for the permalink links.
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
You can also specify the tags for each post or page as a custom field also.
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.
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.
- Swedish (Thanks Gunnar Lindberg Årneby)
- Turkish (Thanks Yakup Gövler)
- Belorussian (Thanks FatCow)
- German (Thanks Renate)
- Dutch (Thanks Rene)
- Hebrew (Thanks Sagive SEO)
- Spanish (Thanks Brian Flores of InMotion Hosting)
- Bulgarian (Thanks Nikolay Nikolov of IQ Test)
- Lithuanian (Thanks Vincent G , from http://www.host1free.com)
- Hindi (Thanks Love Chandel)
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.
The development of the Plugin happens over at github. If you want to contribute to the Plugin, fork the project at github and send me a pull request.
If you are not familiar with either git or Github then refer to this guide to see how fork and send pull request.
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.
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.
== 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.
== Screenshots ==
- Widget settings page
== Changelog ==
- Initial Version
- Added template functions
- Added Swedish translation (Thanks Gunnar Lindberg Årneby)
- Improved caching performance
- Added Turkish translation (Thanks Yakup Gövler)
- Added support for sorting the posts (Thanks to Michael http://mfields.org/)
- Removed JavaScript from unwanted admin pages and added Belorussian translation.
- Added option to hide author links.
- Fixed an issue in showing the number of posts.
- Added support for shortcode and sorting by title.
- Fixed an issue with the order by option.
- Fixed issue with shortcode.
- Fixed issue with shortcode, which was not fixed properly in 1.0
- Fixed issue with shortcode, which was not fixed properly in 1.0 and 1.1
- Fixed some inconsistency in documentation and code
- Added German translations
- Added Dutch translations and fixed typos
- Fixed an issue in handling boolean in shortcode
- Added support for displaying post dates.
- Fixed a bug which was corrupting the loop.
- Added support for displaying content (Thanks rjune)
- Added Spanish and Hebrew translations.
- Added option to exclude tags.
- Fixed bug in displaying author name
- Added support for post thumbnails
- Don't display widget title if posts are not found
- Added Tag links
- Added the option to take tags from the current post
- Added the option to take tags from the custom fields of current page
- Added option to include tag links from shortcode and template function.
- Fixed undefined notices for nouncename while creating new posts
- Fixed issues with order by option.
- Added Bulgarian translations
- Added filter to the get_the_content() call
- Moved caching logic to widget
- Added the option to exclude current post/page
- Added Lithuanian translations
- Added option to disable cache if needed
- Fixed the sorting by title issue
- Added support for specifying link targets
- Changed the argument list for the posts_by_tag template functions
- Added support for custom fields to all post types
- Added autocomplete for tag fields in custom field boxes
- Added Hindi translations
- Renamed all template functions with a prefix to avoid clash with other Plugins
- Fixed the bug which caused the comment to be posted to another post
- Fixed the bug which caused PHP to timeout when content option is set to true
- Exclude current post by default
==Readme Generator==
This Readme file was generated using wp-readme, which generates readme files for WordPress Plugins.