So, I have to show the taxonomies that are present on a custom post, with their terms.
I have some taxonomies (around 10) and all of them have a few terms. Eacho post can have any number of taxonomies, but all of them will have only one term selected.
I need to show a list of the terms that are present on the post and in place of the taxonomy name, I need to show a custom name.
For example: Taxonomy: Bikes Term: BTT
Instead of showing something like "Bikes : BTT", I need to show something like "Bicycle : BTT".
I have a code that gives me the taxonomy and the term, but couldn't think of the best way to 'change' that taxonomy for a custom name.
Here is the code so far:
//creates the array to format the list of taxonomies
$args = array(
'template' => __( '%s: %l.' ),
'term_template' => '<a href="%1$s">%2$s</a>',
);
//creates the array to receive all the taxonomies
$taxList = get_the_taxonomies( $post->ID, $args );
//shows every taxonomy separately
foreach ($taxList as $taxItem) {
echo $taxItem;
endforeach;