Catchable fatal error: Object of class WP_Error could not be converted to string
-
Hi– I’m using a custom theme and whenever I try to view a post I get this error: Catchable fatal error: Object of class WP_Error could not be converted to string in line 144.
Based on all of the other posts I’ve read, it seems like this error is usually the result of deleting categories. Makes sense, I had deleted a few right before this problem started. I’m working with the theme developer and changed line 143 from this:
$cat_tree = get_category_parents($category[0]->term_id, FALSE, ':', TRUE);
to
is_wp_error($cat_tree = get_category_parents($category[0]->term_id, FALSE, ':', TRUE)) ? '' : $cat_tree;
with no luck, and also tried changing 144 to this:
$top_cat = split(':',$cat_tree);
to
$top_cat = split(':',$cat_tree); is_wp_error($top_cat = split(':',$cat_tree) ) ? '' : $cat_tree;
Any other suggestions? Thank you people of wordpress!
- The topic ‘Catchable fatal error: Object of class WP_Error could not be converted to string’ is closed to new replies.