Plugin / Count Posts in a Category, Tag, or Custom Taxonomy

bitacre

Frequently Asked Questions (FAQ)

You must insert the shortcode in location where you want to count to appear: (always replacing category-slug with an acutal slug name) For categories: * [cat_count slug="category-slug"] or for a tag: * [tag_count slug="tag-slug"] or for a custom taxonomy: * [tax_count tax="taxonomy-name" slug="taxonomy-slug"] The legacy shortcode assumes you are giving it slugs, but it can also accept category names or IDs: [ccp type="name" cat="Category Name"] [ccp type="id" cat="27"] or for a tag: * [ccp type="name" tag="Tag Name"] * [ccp type="id" tag="28"] With the new shortcodes, you can specify slug=””, id=””, or name=”” directly. If more than one is given, posts are selected in that order.
As of version 3.1… Yes! You can specify more than 1 ID or slug by separating the values with commas. You have to use either ID or slug, not a combination of both. Also, you cannot use the name attribute (since a name may ostensibly contain commas naturally, unlike a slug or ID). So, for example, if you had 3 categories with the slugs “cat-1”, “cat-2”, and “cat-3” each with 10 posts, you could get the count for all three (it would return “30”) using this shortcode: [cat_count slug=”cat-1,cat-2,cat-3″] Thanks to Jack Brand for this excellent suggestion.
Make sure you’re using the correct slug, sometimes they are different from the actual category name and capitalization matters. You can view them by clicking on the Categories link under Posts. Also don’t literally copy “category-slug,” you need to put the category you want counted there, that’s just a place holder. So to count the number of posts in a category called ‘Book Reviews’ with a slug name of ‘book-reviews’ you would insert [cat_count slug="book-reviews"].
The shortcodes without underscores are legacy shortcodes, I left them in the plugin so stuff won’t break, but you should use the new shortcodes if possible. The legacy shortcodes include: [ccp] [catcountposts] [countposts] [countpost] [postsincat] [postincat] The legacy shortcodes only work for categories and tags, and they all follow the format [ccp type="slug/id/name" cat="category-slug/id/name" tag="tag-slug/id/name"] The NEW shortcodes all have underscores, and follow a slightly different format. There are 3 seperate shortcodes: For Categories: * [cat_count slug="cat-slug"] or [cat_count id="45"] or [cat_count name="Category Name"] For Tags: * [tag_count {slug="tag-slug"} {id="45"} {name="tag name"} ] For Custom Taxonomies: * [tax_count tax="custom-tax-type" {slug="tax-slug"} {id="99"} {name="Taxonomy Item Name"} ] You only need to specify 1 of the following: slug="", id="", or name="". If you specify more than one, the plugin will ignore the other attributes in the order of slug > id > name. You also need to specify the tax="custom-tax-type" for the [tax_count] shortcode. This is so the plugin knows which custom taxonomy to count.
Can I? Yes. Will I? Yes, if I think it would be a helpful addition. I’m trying to keep things clean and simple, but there’s always room for improvement, so let me know if you think a feature is lacking!

Ratings

5
2 reviews

Rating breakdown

Details Information

Version

3.1

First Released

06 Dec, 2011

Total Downloads

6,985

Wordpress Version

2.8 or higher

Tested up to:

3.5.2

Require PHP Version:

-

Tags

Contributors

Languages

The plugin hasn't been transalated in any language other than English.

DIRECTORY DISCLAIMER

The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.

The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.

Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.

While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.

wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.

Keep Leading Your Followers!
Share it for them.