I'm looking for solution that will display all the tags that are used on a custom post type. wp-admin/term.php?taxonomy=tour-destination&tag_ID=316&post_type=tour&wp_http_ref From a destination, I want to show all the labels of the destination.

For example: From Germany - All labels from germany

I have the code:

$terms = get_the_terms( $post->ID, 'tour_tag' );
echo '<div class="conjunto-de-etiquetas-archive">';
echo '<center><ul class="etiqueta-archive">';
foreach ($terms as $term) {
    echo '<li><a href="'.get_term_link($term).'">'.$term->name.'';
    echo '<span class="contador-etiquetas-archive">';
    echo "$term->count";
    echo "</span>";
    echo "</a></li>";
echo '</ul></center></div>';

But the problem is that it shows me only the tags of the first element of the page. Here is an example of my problem https://guiamoscow.website/tour-destination/egipto/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.