0

I'm creating a template for a custom taxonomy for my theme.

At the beginning of the page, before the loop that lists all the posts associated to a term of that taxonomy, I want to output the description for that term.

I have tried with

term_description()

but it doesn't work, no output... get_the_terms and other functions I know are meant to work within a loop for individual posts (with post->ID)...

Anyone has a clue on how to achieve this? many thanks

2
  • 1
    Are you using echo or print to show the function's output?
    – mrwweb
    May 21, 2012 at 20:13
  • oh had to echo it, that was simple to solve, thanks!
    – unfulvio
    May 21, 2012 at 20:37

1 Answer 1

1

The term_description() function returns the description rather than echoing or printing it.

To fix the issue, use:

echo term_description();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.