WordPress.org

Ready to get started?Download WordPress

Forums

Problem with get_term_link() - Returns "Catchable fatal error" (1 post)

  1. ryansigg
    Member
    Posted 10 months ago #

    I've tried searching for this, but didn't see anything relevant to me...

    Full error when trying to echo get_term_link() w/in a home page template:
    "Catchable fatal error: Object of class WP_Error could not be converted to string"

    Usage:

    $term = get_term_by( 'id', $cat_id, $tax);
    echo get_term_link( $term->slug, $term->taxonomy );

    The term object is returning just fine; if I echo $term->slug or $term->taxonomy they return the correct value... The issue seems to be within get_term_link() itself...

    Don't see anything in the codex entry that helps (the term exists, obviously):
    http://codex.wordpress.org/Function_Reference/get_term_link

Reply

You must log in to post.

About this Topic