wp_set_post_terms($post_ID, 'my_term', 'my_taxonomy');
My problem is that in wp_term_taxonomy, the count is 0 but running that line of code should be making it 1.
I have also added to the register_taxonomy:
'update_count_callback' => '_update_post_term_count'
If I manually change the count to 1 then my other functionality displays so everything is being done correctly apart from the count column always being 0.
Does anyone know why this is happening?
if it’s custom taxonomy for attachment, you should add to the register_taxonomy :
Are they drafts, if they are in draft mode they won’t be in the count.