views:

24

answers:

2

Trying to print my custom post type's taxonomy but without the link. Tried this, but doesn't seem to work, any suggestions?

$text = the_terms($post->ID,'type','','',''); 
echo strip_tags($text);

Any help would be greatly appreciated... I'm about to start punching babies.

A: 

the_terms() display the terms, but you cant store them into a variable because they are echoed. You should try get_terms() instead.

$myterms = get_terms('category', 'orderby=count&hide_empty=0');

For future use, the the_something() methods print the specific content ito the template and the get_something() methods return the content so you can store it into a variable.

Coquevas
A: 

Found on the answer on the other board. Here's a link.

http://wordpress.stackexchange.com/questions/3405/strip-tags-from-a-the-terms-function/

philmadelphia