Website: http://fr.yoga-laurence-lhermitte.be/
Et's been up for almost 2 years. The problem appeared only recently, probably after some update but I don't know which one since we didn't realised the problem at once.
That site is a multisite. The problem occurs only on the sub-site. The main site behaves fine. I guess the reason is the permalinks settings:
Main site: I chose "Date & Title"
Sub-site : I chose (and need) custom permalinks: /%category%/%postname%/
Error message when trying to open an image from dashboard:
Catchable fatal error: Object of class WP_Error could not be converted to string in /homez.614/yogalaur/www/wp-content/themes/yoga/functions.php on line 144
I have tried to follow the fixing suggested here --> http://wordpress.org/support/topic/catchable-fatal-error-object-of-class-wp_error-could-not-be-converted-to-string-11?replies=17
but it dosn't work for me. I get the error:
[blockquote]Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /homez.614/yogalaur/www/wp-content/themes/yoga/functions.php on line 145[/blockquote]
The change I made is line 144 (not 145)
Here is my surrounding:
} elseif ( is_attachment() ) {
$parent = get_post($post->post_parent);
$cat = get_the_category($parent->ID); $cat = $cat[0];
echo get_category_parents($cat, TRUE, " $separator ");
echo '<a href="' . get_permalink($parent) . '">' . $parent->post_title . '</a> ' . $separator . ' ';
echo $before . the_title('','',false) . $after;
Line 144 is the fourth one.
echo get_category_parents($cat, TRUE, " $separator ");
Trying to follow the exemple in the WP post I mentionned earlier, I changed it to
echo is_wp_error( $cat_parents = get_category_parents($cat, TRUE, " $separator ") ) ? " : $cat_parents;
I know nothing in PHP. Is there something wrong in my new line?
Thanks in advance to anyone who could help.