Support » Developing with WordPress » wp_count_posts – specific category

  • I have got a full post count using the wp_count_posts method (see below). But I want to display post count for a specific category. Does wp_count_posts support this yet?

    wp_count_posts in Codex

    <?php
    $count_posts = wp_count_posts();
    $published_posts = $count_posts->publish;
    echo 'Total published items: '.$published_posts;
    ?>

    edit: version 2.5.1 used.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wp_count_posts – specific category’ is closed to new replies.