• levani01

    (@levani01)


    When I try to view author archive page I get this error message in sidebar:
    Catchable fatal error: Object of class WP_Error could not be converted to string in /home/answersg/public_html/wp-content/themes/answers/sidebar_category.php on line 24

    This is the code on line 24:

    <?php
    $breadcrumbs = explode(‘|’,get_category_parents($cat,true,’|’));
    array_pop($breadcrumbs);
    array_pop($breadcrumbs);
    if ($breadcrumbs) foreach ($breadcrumbs as $crumb);
    ?>

    Please help if you know what’s wrong.

    Thanks in advance

Viewing 1 replies (of 1 total)
  • tomontoast

    (@tomontoast)

    There is a wordpress error resulting from get_category_parents($cat,true,'|') Without seeing what the variable $cat is, i don’t know what is going wrong. Make sure $cat is an integer and is the id of the category you wish to fetch.

Viewing 1 replies (of 1 total)
  • The topic ‘Error on author archive page’ is closed to new replies.