Support » Fixing WordPress » Pulling the latest X number of posts, and then counting the # in each category

  • Hi, I can easily enough pull the latest X number of posts, for example 35. However, after I pull the most recent 35 posts, I’d like to count how many are in specific categories.

    Lets say I have a website about basketball teams. I’d like to pull the last 35 posts, and then of that dataset, I’d like to display how many are about the Lakers, the Clippers, and The Knicks, etc. The solutions I’ve found from wordpress, will count all of them, ever. But to me, its not valuable how many total posts have been posted about the Lakers, ever. Whats important to me is how many are considered recent. So I just want to get the count, from the last 35 posts, and not since the beginning of time.

    The reasoning for this is I want to do a menu that portrays interest, like the following:

    Recent Announcements:
    Lakers (2)
    Clippers (4)
    Knicks (1)

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.