Do any of you know what could cause this error? A Catchable

Hello, Do any of you know what could cause this error? A Catchable fatal error: Object of class WP_Error could not be converted to string in (link) ?

It is happening on Mobile phones but only for 2 users that have Author permissions. But no other Author users have experienced the issue and as an Admin, I have not be able to replicate the issue either. Any other help or suggestion would be great.

  • Vinod Dalvi
    • WP Unicorn

    Hi Will,

    I hope you are well today and thank you for your question.

    It seems from the error message shared in the screenshot that the theme resportsive you are using on your site is creating such a situation where the WP_Error class object is being used as a string which is causing the error.

    We can avoid this error by checking using the function is_wp_error whether the variable is string or WP_Error class object and not use it if it's the WP_Error class object.

    To do this could you please share me the code from the functions.php file of your resportsive theme.

    Also would you mind if I logged in to your site and did some troubleshooting? This might help get to the bottom of this faster. If this is ok, just grant me temporary admin access to your site by clicking "Grant Access" button in the WPMU DEV Dashboard Settings as described on the following page and reply on this thread after granting it?

    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Kind Regards,
    Vinod Dalvi

  • Will Designs
    • Design Lord, Child of Thor

    I have no problem, granting you access but the error seemed to go away on its own which worries me. But no one has said that it has happened since the post....

    On a seperate note on the same site

    http://getfit4lifeinc.org/store/

    I am trying to figure out how i can level all the pictures out the 1st 3 are level and the last 2 are level but lower than the 1st 3. I will grant you access in a moment if you could help me with both issues

  • Vinod Dalvi
    • WP Unicorn

    Hi Will,

    I have no problem, granting you access but the error seemed to go away on its own which worries me. But no one has said that it has happened since the post....

    You can try resolving the issue by editing the functions.php file of your resportsive theme on line number 313 as displayed below.

    Before Editing :

    $cat = get_the_category($parent->ID); $cat = $cat[0];
    
    echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');

    After Editing :

    $cat = get_the_category($parent->ID); $cat = $cat[0];
    if( !is_wp_error( $cat ) && !empty($cat)  ){
    echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
    	}

    Alternatively you can just use the attached modified functions.php file that contains the above change so just replace your theme functions.php file with the attached file.

    On a seperate note on the same site

    http://getfit4lifeinc.org/store/

    I am trying to figure out how i can level all the pictures out the 1st 3 are level and the last 2 are level but lower than the 1st 3. I will grant you access in a moment if you could help me with both issues

    I resolve this issue on your site by adding the following CSS code in the Edit CSS option in your site admin area as show in the attached screenshot so just check it and let me know how it works for you now.

    #mp_product_list .mp_one_tile {
      margin-top: 0;
    }

    Best Regards,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.