WordPress.org

Ready to get started?Download WordPress

Forums

Update top level category count when posts are added (1 post)

  1. adrienneg
    Member
    Posted 3 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic