Plugin: Posts in category 1.1
This is my very first Wordpress plugin
The plugin shows a customizable list of links to the posts published in the specified categories (also multiple ones).
You can show posts from one or more specific categories, by passing an array of their IDs as a function value, or show other posts from the categories under which the currently active post is published (as I do in my sidebar!).
You can see the plugin code here. If you copy this code and paste it into a .php file, you’ll have the plugin ready to rock!
The features list include:
- Show posts published under one or more categories (also the current post’s one if you wish).
- Limit the number of shown posts.
- Customize the order in which post links will be shown.
- Exclude posts (from v.1.1)
Using this plugin is simple: install and activate it easily as usual, then call the function, inside The Loop, with this syntax:
Let’s explain briefly these arguments:
- categories-array is an array containing the IDs of the category of which you want to display posts;
- post-limit is the number of the posts link you want to show;
- order-by is the criteria for which you want to order posts by (that is no other from your POSTS table field names, comma separated);
- exclude contains IDs of the post to exclude. Can be a numeric string, array or empty.
You will find extended documentation and usage examples directly into the plugin source code.
This plugin is released under GPL license.
Special thanks goes to:
Mrbrown, that gave me the initial input for plugin development (in this forum topic), and the whole Wordpress italian community that made this possible.