Category post count in loop
-
Hi,
I am trying to get the number of posts assigned to each category within a foreach statement and turn the get_the_category Multi-dimensional array that is returned, into a simple count array. I have tried array_count and array_filter with no luck. Below is the link to the relevant code. I am using the advanced custom fields plugin if the get_field function looks unfamiliar but it shouldn’t distract from the general principle. The overall goal is to count the amount of times a category is used for featured posts and then use that number to determine whether or not to load more of that category.
code: https://pastebin.com/0jnpcU5B
Any advice is much appreciated.
Thanks!
-M
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Category post count in loop’ is closed to new replies.