wordpress obtenir la taxonomie d'un post
//Get all terms (names) of a taxonomy of a post
$term_obj_list = get_the_terms( $post->ID, 'taxonomy_name' ); ?>
wordpress obtenir la taxonomie d'un article
<?php $term_obj_list = get_the_terms( $post->ID, 'taxonomy_name' ); ?>
obtenir la taxonomie nom dans singhle post
// RETRIVE TERM SLUG ( for single.php or template-part )
$terms = get_the_terms( $post->ID, 'your-taxonomy' );
if ( !empty( $terms ) ){
// get the first term
$term = array_shift( $terms );
echo $term->slug;
}
obtenir le nom de la taxonomie dans singhle post
// RETRIVE TERM SLUG ( for single.php or template-part )
$terms = get_the_terms( $post->ID, 'your-taxonomy' );
if ( !empty( $terms ) ){
// get the first term
$term = array_shift( $terms );
echo $term->slug;
}
get post par nom wordpress
$posts = get_posts(array('name' => 'your-posts-name', 'post_type' => 'faq'));