count by category
-
I used to have a plugin that could count posts by category, so I used it to count the number of recipes on my site (https://www.mattfischer.com/ramen). WP 2.3 broke the plugin with the new schema, that I frankly do not understand.
So using the Post Count plugin, I tried to get it work work like this:
SELECT COUNT(*) FROM $wpdb->posts WHERE post_category = 2 ….
The issue now seems to be that Category 2 is a “parent” category and this query didn’t include the sub-cats. Is there any easy fix to this without saying OR category = 3 OR category = 4….?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘count by category’ is closed to new replies.