The functions in this plugin let you select necessary posts from the templates. Below is the list of functions currently defined:

  • posts_random_by_category_id(catid, max) – fetches max random posts from the category specified by catid
  • posts_random_by_category_name(catname, max) – fetches max random posts from the category specified by catname
  • posts_by_category_name(catname, max) – fetches max last posts from the category specified by catname

Usage

There’s nothing to describe in fact. Just activate plugin and use it in your templates, like this:

$posts = PostTools::posts_random_by_category_name(’mycat’, 5)

The call above fetches maximum 5 random posts from the category mycat. The other functions work in a similar way.

Downloads

Installation Instructions

Installation is quite straight-forward:

  • Unzip the archive to your plugins folder
  • Go to the WordPress plugins admin panel then activate the [NCG] Post Tools plugin.

Future Directions

No idea so far.