raghu
raghu

Reputation: 317

ERROR : Object of class WP_Error could not be converted to string

Catchable fatal error: Object of class WP_Error could not be converted to string in /home/winentra/public_html/s1.ssonline.co.in/wp-content/themes/peekaboo/admin/common-functions.php on line 186

Line No. 186

echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');

Any ideas on this please?

Upvotes: 1

Views: 11372

Answers (3)

Lokesh Singh
Lokesh Singh

Reputation: 11

elseif ( is_single() && !is_attachment() && get_post_meta($post->ID, 'cust_cat', true) ) {
      $cat = get_post_meta($post->ID, 'cust_cat', true);
      echo $cat;
      echo $currentBefore;
      the_title();
      echo $currentAfter;

    } 

    elseif ( is_single() && !is_attachment() && !get_post_meta($post->ID, 'cust_cat', true) ) {
      $cat = get_the_category(); $cat = $cat[0];
      echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
      echo $currentBefore;
      the_title();
      echo $currentAfter;

    }

Upvotes: 1

mariusnn
mariusnn

Reputation: 1897

The object you get returned if of a complex type that PHP is not able to convert into a string for printing.

Upvotes: 1

shankar
shankar

Reputation: 53

Reason and Solution for this problem is here

Upvotes: 1

Related Questions