Update top level category count when posts are added
-
Hi,
I am working on a restaurant listing site. I have a sidebar that shows top level categories (which are the State names). Each state has subcategories for Counties. Posts must have a category (state) and subcategory (county) selected to be posted to the website. I have noticed that the field ‘Count’ in wp_tems_taxonomy gets updated for the County the post is tied to. I would like to also update that County’s parent (the state) to have it’s count incremented by 1, so I can easily display the number of posts within a state without having to do joins and calculations. Can anyone point me in the right direction?
- The topic ‘Update top level category count when posts are added’ is closed to new replies.