Simply check this by using:
if ( $terms && ! is_wp_error( $terms ) ) {
//your code
}
Take a look at the codex page for get_the_terms()
for a deeper insight, especially the »Returns« and »Examples« section.
Simply check this by using:
if ( $terms && ! is_wp_error( $terms ) ) {
//your code
}
Take a look at the codex page for get_the_terms()
for a deeper insight, especially the »Returns« and »Examples« section.