Codex tools: Log in / create account
Contents |
First available with WordPress Version 2.5, this template tag returns the count of the rows in wp_posts that meet the post_type and post_status designated.
<?php wp_count_posts('type', 'status'); ?>
The default usage returns a count of the posts that are published.
<?php $published_posts=wp_count_posts(); ?>
Return the count of post drafts.
<?php $draft_posts=wp_count_posts('post','draft'); ?>
Return the count the number of published pages
<?php $published_pages=wp_count_posts('page','publish'); ?>
the_ID, the_title, the_title_attribute, single_post_title, the_title_rss, the_content, the_content_rss, the_excerpt, the_excerpt_rss, previous_post_link, next_post_link, posts_nav_link, the_meta
This page is marked as incomplete. You can help Codex by expanding it.