Home

Awesome

Posts By Tag

Contributors: sudar
Tags: posts, sidebar, widget, tag, cache
Requires at least: 4.0
Donate Link: http://sudarmuthu.com/if-you-wanna-thank-me
Tested up to: 5.1 Stable tag: 3.2.1

Provide sidebar widget, shortcode and template functions that can be used to display posts from a set of tags using various options in the sidebar or anywhere in a post.

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 tags, post slug or form custom field. The custom fields can be specified in the edit post or 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.

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

To add the widget, log into your WordPress admin console and go to Appearances -> Widgets. You will find the widget with the title "Posts By Tag". Drag and drop it in the sidebar where you want the widget to be displayed.

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, $options);

The following options can be passed in the $options array

In addition to the above options the following options are available in the Pro addon

You can checkout some example PHP code that shows how you can call the template function with different options.

Shortcode

You can also include the following shortcode in your blog posts or WordPress page, 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 checkout some example shortcodes that shows how you can use the shortcode with different options.

Custom field

You can also specify the tags for each post or page and a custom title using custom field. The UI for the custom field is available on the right side of the add/edit post/page screen in WordPress admin console.

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.

If you want to output categories of the post as class names(so that you can style them differently), then you can get the code from this forum thread.

Caching

If you are using the widget, then the Plugin automatically caches the db queries. This will greatly improve the performance of you page. If this clashes with other Plugins or if you want to manage the cache yourself, then you disable the cache if needed.

However if you are going to use the shortcode or the template directly, then you might have to cache the output yourself.

Development and Support

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.

If you are looking for ideas, then you can start with one of the following TODO items :)

TODO

The following are the features that I am thinking of adding to the Plugin, when I get some free time. If you have any feature request or want to increase the priority of a particular feature, then let me know by adding them to github issues.

Support

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.

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. This is how the sidebar widget settings page looks like

Custom fields meta box. This is how the custom fields meta box looks like in the add or edit post/page screen

Readme Generator

This Readme file was generated using <a href = 'http://sudarmuthu.com/wordpress/wp-readme'>wp-readme</a>, which generates readme files for WordPress Plugins.