• suge1w

    (@suge1w)


    I have the following code:

    <?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); echo $term->name; ?>

    Works perfectly well in displaying terms but doesn’t retrieve titles.

    Example, I have a taxonomy “engine”.. I want the the results displayed as “Engine: V8”

    Can any coding guru’s offer me any words of wisdom on how to rectify this please?

Viewing 2 replies - 1 through 2 (of 2 total)
  • mrsminkie

    (@mrsminkie)

    I don’t think you can get the title using this method.

    If you look here, you’ll see these are the values that you can grab:

    term_id
    name
    slug
    term_group
    term_taxonomy_id
    taxonomy
    description
    parent
    count

    Thread Starter suge1w

    (@suge1w)

    Thanks for the response mrsminkie!

    I’ve tried playing around with those values but I can confirm it definitely doesn’t do what I want!

    Something like this is what I need really but I need it for multiple terms!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Displaying taxonomy titles’ is closed to new replies.