Catchable fatal error: Object of class WP_Error could not be converted to string
-
I get this error when trying to:
global $post; $categories = get_the_category($post->ID); $category_parrent = $categories[0]->cat_ID; $cat = $category_parrent;
It is the line “$cat = $category_parrent;” which I get the error message.
I obviously tried to Google the subject, but failed to find anything of interest.
The problem only appears on two of my categories. Both of them, if my memory serves me right, is renamed after they where created. The rest of my categories can be written into $cat without any problem.
Any help is greatly appreciated.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Catchable fatal error: Object of class WP_Error could not be converted to string’ is closed to new replies.