Site logo

Archived topic

display categorie-description of a custom taxonomy

7 replies · Started by Jens on March 24, 2022

Viewing posts 1–8 of 8

The PHP snippet displays the categories of a custom taxonomy. It works. Instead of the categories, the category description should now be displayed. What needs to be changed?

<?php echo get_the_term_list( get_the_ID(), 'struktur', '', ' ❘ ' ); ?>

Many thanks for your help.

Hi Jens,

Just to confirm that you want the term description, but not the term list?

Correct. I just want to show the description of the category, not the category itself.

Try this:
<? php echo term_description( get_the_terms($post->ID , 'struktur')[0], 'struktur' ); ?>

There will only ever be one term, not a list.

Have you tried the code? Does it work?

<?php echo term_description( get_the_terms($dlp_document->ID , 'struktur')[0], 'struktur' ); ?>

Thanks very much. I adapted your suggestion to the used posttype and it works. The problem is solved.

You are welcome :)

This archived topic is closed to new replies.