0

i need help with this:

Catchable fatal error: Object of class WP_Error could not be converted to string in /home/.../public_html/wp-content/themes/toroplay 2.1.2/inc/single-series.php on line 156 its this line: 153-156 :

$array_directors = array();
$term_list_directors = wp_get_post_terms($post->ID, 'directors_tv', array("fields" => "all"));
if(!is_wp_error($term_list_directors) and !empty($term_list_directors)){
    foreach($term_list_directors as $director_single) { $array_directors[]='<a href="'.get_term_link($director_single->term_id, 'directors').'">'.$director_single->name.'</a>'; }
  • And which is line 156? – kero Jan 24 '18 at 13:15
  • foreach($term_list_directors as $director_single) { $array_directors[]='<a href="'.get_term_link($director_single->term_id, 'directors').'">'.$director_single->name.'</a>'; } – Bzium Jan 24 '18 at 18:29
0

You get the terms of directors_tv taxonomy, but try to get the next link in the context of directors taxonomy. You probably should use directors_tv in both places or rethink your DB structure as you can not use the same term id in the context of different taxonomies.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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