WordPress.org

Support

Support » Plugins and Hacks » Why this counting posts system doesn’t work ?

Why this counting posts system doesn’t work ?

  • Hi guys,

    I’d like to list, in a fancy way and outside the loop, some categories and how many posts they include.

    For instance, I’ve found this useful info.

    But, why this other code isn’t working for me ?

    <?php
    
    	$cat_posts = get_posts('category_name=BLAH');
    
    	echo
    		'<h5 class="italic">There are '
    		. count($cat_posts) .
    		' Posts in <a href="http://url.com/blog/category/blah/">BLAH CATEGORY</a></h5>';
    
    ?>

    For some cats is working, for other it shows me less than there are.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Why this counting posts system doesn’t work ?’ is closed to new replies.