Viewing 3 replies - 1 through 3 (of 3 total)
  • wp_count_posts() does not seem to be loop dependant:
    if the docu does not answer your question,
    http://codex.wordpress.org/Function_Reference/wp_count_posts

    you may need to describe in more detail where you want to use this.

    (btw: the examples in the docu assign the results to variables; if you want to output the results, you would need to use the echo command.)

    Thread Starter thetvstop

    (@thetvstop)

    http://www.thetvstop.com/watch/ if you look at the TOP TV SHOWS, section on top you will see how I am trying to display post counts.

    For some reason the default <?php count_posts(); ?> works to count the total number of posts.

    However, the <?php count_posts(‘pages’); ?> function does not work. Any clues?

    However, the <?php count_posts(‘pages’); ?> function does not work.

    maybe because it does not exist?
    have you read the docu?

    if you want to show the number of published pages, try:

    <?php
    $count_pages = wp_count_posts('page');
    echo $count_pages->publish;
    ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wp_count_posts’ is closed to new replies.