WordPress.org

Ready to get started?Download WordPress

Forums

[closed] Catchable fatal error: Object of class WP_Error could not be converted to string (7 posts)

  1. Iyke Charles
    Member
    Posted 1 year ago #

    Catchable fatal error: Object of class WP_Error could not be converted to string in /home/ravensne/public_html/wp-content/themes/continuum/single.php on line 120

    Please i really do need your help on correcting this error and am new to wordpress and css...

    this is d line of code, from line 117 to 123

    <?php // get parent category
    $category = get_the_category();
    $cat_tree = get_category_parents($category[0]->term_id, FALSE, ':', TRUE);
    $top_cat = split(':',$cat_tree);
    $parentObj = get_category_by_slug($top_cat[0]);
    $parent = $parentObj->name;
    ?>

    I would really appreciate your help.

  2. Iyke Charles
    Member
    Posted 1 year ago #

    this is the code from line 117 to 123

    <?php // get parent category
                                    $category = get_the_category();
                                    $cat_tree = get_category_parents($category[0]->term_id, FALSE, ':', TRUE);
                                    $top_cat = split(':',$cat_tree);
                                    $parentObj = get_category_by_slug($top_cat[0]);
                                    $parent = $parentObj->name;
                                    ?>
  3. Andrew
    Forum Moderator
    Posted 1 year ago #

    Just to verify, which line is 120?

  4. Iyke Charles
    Member
    Posted 1 year ago #

    this is line 120
    $top_cat = split(':',$cat_tree);

  5. Andrew
    Forum Moderator
    Posted 1 year ago #

    Your query may be better resolved in the 'How to' or 'Themes' forum.

  6. Iyke Charles
    Member
    Posted 1 year ago #

    thanks a lot, i appreciate

  7. esmi
    Forum Moderator
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic