Category post counts incorrect
-
Hello everyone. I’m working on updating the blog I started about my daughter before she was born and she’s 13 now. When I started, it didn’t occur to me to set up post categories so visitors could just to link to the posts for the right year. Over time I accumulated 857 uncategorized posts…
I couldn’t find a plugin that would let me assign categories to posts based on date, so with some help I put together an SQL statement that does just that:
UPDATE wp_term_relationships SET term_taxonomy_id = (SELECT term_taxonomy_id FROM wp_rfowje_term_taxonomy WHERE term_id = '20') WHERE object_id IN ( SELECT p.ID FROM wp_posts p WHERE p.post_date LIKE '2009%' AND p.post_status = 'publish' ) AND term_taxonomy_id = ( SELECT term_taxonomy_id FROM wp_term_taxonomy WHERE term_id = (SELECT term_id FROM wp_terms WHERE name = 'Uncategorized') );
This works quite well, and I can see in the WP UI that the posts are no longer ‘Uncategorized’ and are now ‘2009’. The thing I can’t figure out is that when I tell the sidebar widget to show post counts for the categories … the count is clearly wrong.
It’s not a terribly big deal, but I like to get things right. Seems like there’s another place where something has to change to get the post count right. Any idea what that is?
Thanks for your help,
- Steve
The page I need help with: [log in to see the link]
- The topic ‘Category post counts incorrect’ is closed to new replies.