Forums Get help. Give help.

Display WordPress custom taxonomy tags but not as links
  • I'm working on a WP theme and I've got a custom post type for videos, and then a custom taxonomy set up like tags to display the people in each video.

    The standard way of spitting out those custom taxonomy tags is to use this function, yes?

    <?php echo get_the_term_list($post->ID, 'people', 'People: ', ', ', ''); ?>


    But that makes each term a link, but I don't want a link, I just want plain text.

    I would appreciate any help or ideas on how to do this. Thanks!
  • seeingsoundseeingsound March 2011
    Here you go:


    <?php $terms_as_text = get_the_term_list( $post->ID,'people', 'People: ', ', '); if (!empty($terms_as_text)) echo '<p>', strip_tags($terms_as_text) ,'</p>'; ?>
  • Works like a charm. This is just what I was looking for. Thanks a ton!
  • carsoncarson April 2011
    This is awesome. Thanks.



Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

Tips

Just some helpful hints to get the most out of the forums.