WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Display number of posts within category (4 posts)

  1. bondigor69
    Member
    Posted 1 year ago #

    hey guys how can I display the number of post within a specific category??

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    Try <?php echo $wp_query->found_posts;?>

  3. bondigor69
    Member
    Posted 1 year ago #

    ok I got it by my own
    for people who need the code is below

    $a = query_posts('category_name=appetizers');
    	 $result = count($a);
    	  echo $result;
  4. southcast
    Member
    Posted 1 year ago #

    @bondigor69, I had to thank you. It helped a lot.

Topic Closed

This topic has been closed to new replies.

About this Topic