Problem with sub-categories
Hi All,
I would like to ask your help. Has anyone met with the following message?
I created a main category (eg: CARS) then a sub-category (eg: AUDI) and when I go to the main category to see the ads then I get this notice on the right side of the page.
The program will create the sub-categories, but this notice is not nice on the page.
Notice: Undefined index: 17 in /home/....../
wp-includes/taxonomy.php on line 2806
Notice: Trying to get property of non-object in /home/...../
wp-includes/taxonomy.php on line 2806
The code is:
// Touch every ancestor's lookup row for each post in each term
foreach ( $term_ids as $term_id ) {
$child = $term_id;
while ( $parent = $terms_by_id[$child]->parent ) { <-----THIS IS LINE 2806 ------>
if ( !empty($term_items[$term_id]) )
foreach ( $term_items[$term_id] as $item_id => $touches ) {
$term_items[$parent][$item_id] = isset($term_items[$parent][$item_id]) ? ++$term_items[$parent][$item_id]: 1;
}
$child = $parent;
Any idea what could be the problem?
I already deleted all the categories and ads then re-created the categories, but I still have this issue.
Many thanks!!!