I am experiencing an issue where terms with a parent are not being displayed in the category admin screen. The screen gives the total number of terms that should be there (i.e., 32), but only displays parent terms (i.e., 9).
Interestingly, if run:
var_dump( get_terms( 'category' ) );
all 32 terms are returned.
Does anyone have an idea as to how I might be able to get those terms to display?
Thanks!
I’ve encountered this kind of problem when i was building some front end post / term creation form. The number oh the ‘Right Now’ dashboard shows the right number of term, but the new term doesn’t shows up in the taxonomy admin screen.
The solution:
where ‘taxonomy-name’ is the name of the taxonomy.
Hope this help.
The issue was that somehow the “category_children” value in “wp_options” was reset to a blank, serialized array. In certain contexts, WordPress uses this value to determine the parent child relationship. The value in my DB suggested no such relationships exist. The fix for the issue was to add/edit/delete a category as it updates this value.
I don’t have a ’15 reputation’ … however, thank you ifdion
For those sitting behind phpMyAdmin or a MySQL client, you can also do:
DELETE FROM wp_options WHERE option_name LIKE 'TAXNAME_children';
I came across this doing a 14K “product” import with code similar to (inside a huge loop):
And for some reason, all the posts inserted worked, but just wern’t displaying the child taxonomies on the admin page. Thanks again for this tip.