-2

Can you pull in the description of a custom tax on pages other than the taxonomy-(custom-tax).php

i.e on the home page you want to show the description of a custom tax.

This works on the aforementioned archive page but nowhere else:

<?php echo term_description( '', get_query_var( 'taxonomy' ) ); ?>

Many thanks for any help.

1 Answer 1

1

Simply use the term id to replace '' and the taxonomy name to replace get_query_var( 'taxonomy' ).

echo term_description( $term_id, 'your_custom_tax_name_here' );

P.S. Have you ever heard about Codex?

2
  • Thank you but it doesn't work <?php echo term_description( $term_id, 'test-tax' ) ); ?> on the home page for example, crashes the page...
    – user4630
    Aug 22, 2013 at 12:10
  • That is probably a syntax error. You have an extra closing parenthesis in your the code in your comment. Try <?php echo term_description( $term_id, 'test-tax' ); ?> Aug 22, 2013 at 15:49

Your Answer

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

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