• Hi,

    I keep getting this error message:
    Catchable fatal error: Object of class WP_Error could not be converted to string in /nfs/c09/h01/mnt/128610/domains/greatecology.com/html/wp-content/themes/greatecology/fn_breadcrumb.php on line 51

    If I try to access this page from the home page it works perfectly, but under our services page the link breaks.

    The coding up to line 51 is below.
    <?php

    function the_breadcrumb() {

    $delimiter = ‘ / ‘;
    $name = ‘Home’; //text for the ‘Home’ link
    $currentBefore = ‘<span class=”current-item”>’;
    $currentAfter = ‘</span>’;

    if ( !is_home() && !is_front_page() || is_paged() ) {

    echo ‘<div id=”crumbs”>’;

    global $post;
    $home = get_bloginfo(‘url’);
    echo ‘‘ . $name . ‘ ‘ . $delimiter . ‘ ‘;

    if ( is_category() ) {
    global $wp_query;
    $cat_obj = $wp_query->get_queried_object();
    $thisCat = $cat_obj->term_id;
    $thisCat = get_category($thisCat);
    $parentCat = get_category($thisCat->parent);
    if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ‘ ‘ . $delimiter . ‘ ‘));
    echo $currentBefore . ”;
    single_cat_title();
    echo ” . $currentAfter;

    } elseif ( is_day() ) {
    echo ‘‘ . get_the_time(‘Y’) . ‘ ‘ . $delimiter . ‘ ‘;
    echo ‘‘ . get_the_time(‘F’) . ‘ ‘ . $delimiter . ‘ ‘;
    echo $currentBefore . get_the_time(‘d’) . $currentAfter;

    } elseif ( is_month() ) {
    echo ‘‘ . get_the_time(‘Y’) . ‘ ‘ . $delimiter . ‘ ‘;
    echo $currentBefore . get_the_time(‘F’) . $currentAfter;

    } elseif ( is_year() ) {
    echo $currentBefore . get_the_time(‘Y’) . $currentAfter;

    } elseif ( is_single() && !is_attachment() ) {
    $cat = get_the_category(); $cat = $cat[0];
    echo get_category_parents($cat, TRUE, ‘ ‘ . $delimiter . ‘ ‘);
    echo $currentBefore;
    the_title();
    echo $currentAfter;

    } elseif ( is_attachment() ) {
    $parent = get_post($post->post_parent);
    $cat = get_the_category($parent->ID); $cat = $cat[0];
    echo get_category_parents($cat, TRUE, ‘ ‘ . $delimiter . ‘ ‘);

    Please help I have no idea what to do.
    Thanks!

  • The topic ‘Catchable fatal error: breadcrumbs’ is closed to new replies.