Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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!

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

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.

share|improve this answer
add comment

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:

delete_option('taxonomy-name_children');

where 'taxonomy-name' is the name of the taxonomy.

Hope this help.

share|improve this answer
    
Reported as working solution by author of duplicate question. Relevant trac ticket seems to be core.trac.wordpress.org/ticket/14485 –  Rarst Feb 21 '13 at 13:30
add comment

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):

if (!term_exists($row->vendor,'manufacturer')){
    $v = wp_insert_term($row->vendor,'manufacturer');
    $lv = $v['term_id'];
}

if (!term_exists($row->series,'manufacturer',$lv)){
    $s = wp_insert_term($row->series,'manufacturer',array('parent' => $lv));
    $ls = $s['term_id'];
}

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.

share|improve this answer
    
Renaming the "option_name" is enough (adding _old at the end for example). Thanks! –  jorghe Oct 8 '13 at 8:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.