WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Count Posts

Count Posts is a simple plugin that provides a template function to count posts, as well as filtering by category and over time in days. The function

Changes

1.0

  1. Initial release.

Count Posts Function

The Count Posts function can be called anywhere in a WordPress template and has three variables:

count_posts($category, $daysago, $display)

$category

The $category variable is used to count the number of posts in a category (or Term in WordPress 2.5 or greater). Simply put the name of your category in the function call e.g.

count_posts('mycategory')

If it is left blank, which is the default, the function will count post in all categories.

$daysago

The $daysago variable is used to count the number of posts from a specified number of days ago e.g.

count_posts('mycategory', '8')

If it is left blank or set to 0, the default, the function will count all posts.

$display

The $display variable is used to either output the count number or to return it.

count_posts('mycategory', '8', true)

If it is left blank or set to true, the default, the function will output the number of posts to the page. If it is set to false, the function will return the number.

Known Issues

No known issues at this time.

If you find any bugs or want to request some additional features for future releases, please log them the projects tracker page

Requires: 2.1 or higher
Compatible up to: 2.6.2
Last Updated: 2008-10-18
Downloads: 3,702

Ratings

3 stars
3.8 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1