I have this error in my custom breadcrumbs : Notice: Trying to get property of non-object.
This is the code :
$taxonomy_exists = taxonomy_exists($custom_taxonomy);
if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {
$taxonomy_terms = get_the_terms( $post, $custom_taxonomy );
$cat_id = $taxonomy_terms[0]->term_id; // ERROR LINE
$cat_nicename = $taxonomy_terms[0]->slug; // ERROR LINE
$cat_link = get_term_link($taxonomy_terms[0]->term_id, $custom_taxonomy); // ERROR LINE
$cat_name = $taxonomy_terms[0]->name;
}
How i can solve this problem ?