• bijibuji

    (@bijibuji)


    How can I display term’s name & description for custom taxonomy within The Loop?
    currently I can show its name like this:
    the_terms( $post->ID , $taxonomy, ”, ‘,’, ”);
    but cant get the description

Viewing 7 replies - 1 through 7 (of 7 total)
  • J M

    (@hiphopinenglish)

    I think you’re looking for term_description.

    Thread Starter bijibuji

    (@bijibuji)

    Thanks HHIE, but how to provide it with $term_id, noting that I am on single page template for a post (I dont know if we can assume I am on The Loop or not)

    J M

    (@hiphopinenglish)

    OK, so I would try wp_get_post_terms which accepts $post_id as a parameter.
    It’s been a while since I used Custom Taxonomies though to be honest.

    Thread Starter bijibuji

    (@bijibuji)

    I think this would go and contact the DB, am I right?

    J M

    (@hiphopinenglish)

    Yes. Any call for information on a post/taxonomy/page does.
    What type of template are you editing? Is it a category page?

    Thread Starter bijibuji

    (@bijibuji)

    no, a single post template

    J M

    (@hiphopinenglish)

    You should be able to use term_description to which you can pass your custom taxonomy slug.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Custom Taxonomy Term – Name & Description’ is closed to new replies.