Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 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?

share|improve this answer
    
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 '13 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' ); ?> –  Charles Clarkson Aug 22 '13 at 15:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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