Retrieves the terms of the taxonomy that are attached to the post.
$post, $taxonomy
Sortie :
@param int|WP_Post $post Post ID or object. @param string $taxonomy Taxonomy name. @return WP_Term[]|false|WP_Error Array of WP_Term objects on success, false if there are no terms
// Utilisation de la fonction get_the_terms
$result = get_the_terms($post, $taxonomy);
if ($result) {
// Votre logique ici
}
Chargement des actualités...