I am trying to figure out how to get taxonomy(checkboxes) label from a custom post type that is checked/selected to show on the single custom post. The code below is outputting all the taxonomies not just the checked ones.
function get_terms_chekboxes($taxonomies, $args) {
$terms = get_terms($taxonomies, $args);
foreach($terms as $term){
$output .= $term->name ;
}
return $output;
}
echo get_terms_chekboxes('genre', $args = array('post_type' => 'movie','hide_empty'=>false));
How to get checked taxonomy labels.
Thanks.
Aucun commentaire:
Enregistrer un commentaire