Articles of get the term list

Sorting Attributes order when using get_the_terms

This code has worked to display product attributes on a page. How do I sort/order them by slug? They are currently sorted by name. global $post; $terms = get_the_terms( $post->ID, ‘pa_size’); foreach ( $terms as $term ) { echo “<li>” .$term->name. “</li>”; }

How to add class on term link?

I am looking for a way to add tag slug as a class. I can’t figure out how to achieve this… Here is how I display the products tags <?php echo get_the_term_list( $post->id, ‘product_tag’); ?> The output is <a href=”” rel=”tag”>My tag</a> And I want <a href=”” class=”Tag_Slug” rel=”tag”>My tag</a>

How do I list custom taxonomy terms without the links?

I’ve searched far and wide to try and find an answer to my question. I’m hoping I can get help here. Here goes… I’m currently retrieving the terms of my custom taxonomy using: <?php echo get_the_term_list( $post->ID, ‘skills’, ‘<ul><li>’, ‘</li><li>’, ‘</li></ul>’ ); ?> What I’m trying to do is retrieve these same post-specific custom taxonomy […]

Get the Term List – Ordering

I have a country taxonomy with children taxonomies > state & city. For a given entry for a restaurant in Nantucket, I want it to say “Nantucket, Massachusetts, United States (each linked to those taxonomy pages)”, but the code I have gotten to work (I’m new to PHP) outputs: Massachusetts, Nantucket, United States $terms_as_text = […]

Limits amount of terms displayed? Is it possible?

I have a custom taxonomy/terms named “Cast”. And it may contain lots of names sometimes even over 50 and it consume too much space of the theme. Is it possible to limit the maximum terms displayed in post? For example the limit is 15 names from that taxonomy so it only shows 15 and hides […]

Change order of Custom Taxonomy List

By default WordPress orders custom taxonomies (as tags in this case) by alphabetical order not by the order they were entered in the tag box. Is anyone aware of a way to show the custom taxonomies in the order they were entered in the post edit screen? The url in question is: The GGW […]

get_the_term_list without links in 3.1

What function will display custom taxonomies associated with a post as text? I’m currently using get_the_term_list which works great for a singular page but not so much when using a taxonomy in the archive-postype.php permalink title tag.