n the WordPress Codex you can find:

For get_the_terms: “Retrieve the terms of the taxonomy that are attached to the post.”

For get_terms: “Retrieve the terms in a taxonomy or list of taxonomies.”

So, as you said, get_the_terms() will get the terms (e.g. categories) attached to a post, whereas get_terms() will retrieve the terms in a taxonomy (e.g. categories in the category taxonomy). For example, get_terms( ‘category’ ) will return all categories that you have added to your WordPress site.

Share :
Tag :