I purchased a Wordpress theme, for a restaurant.
The theme uses Posts for each (food)menu entry, and Categories to segment the menu into sections.
The theme is built for 1 level hierarchies. e.g:
>Menu
>>>Breakfast
>>>Lunch
>>>Dinner
However, the restaurant I am working for has a more complex menu:
>Menu
>>>Breakfast
>>>>>>Food
>>>>>>Sides
>>>>>>Drinks
>>>Lunch
>>>>>>Small
>>>>>>Large
>>>>>>Sides
Here is the original index.php
Here is my modified index.php, which attempts to iterate first within the 1st level of categories (e.g. Breakfast, Lunch...), and then through all 2nd level categories (e.g. Breakfast > Food, Breakfast > Sides...).
In both, $menuCat refers to the "Menu" parent category.
This is the live site, using a child theme, and the new index.php. It manages to find the "Lunch" category, but not the "Breakfast" category, and it doesn't output the subcategories.
I receive a PHP exception:
Warning: Illegal offset type in isset or empty in /.../wp-includes/taxonomy.php on line 1236
Here is taxonomy.php from line 1234:
if ( $parent ) {
$hierarchy = _get_term_hierarchy($taxonomies[0]);
if ( !isset($hierarchy[$parent]) )
return $empty_array;
}
So, it seems the $hierarchy of the parent is not not set. I don't know what this means.