Proper use of wp_get_object_terms

To fetch the archive url for that taxonomy term, use something like this (I’m using your naming conventions above, and assuming that $theZielgruppe is a term object. $url = get_term_link( $theZielgruppe, ‘ge_zielgruppe_taxonomy’ ); To get the name, just use $theZielgruppe->name Is that what you’re looking for? EDIT The link above would then look like this: … Read more

Ordering taxonomy output in this function

get_ancestors() returns an array with the parent first, then the grandparent, etc. What you need to do change get_ancestors() to array_reverse( get_ancestors() ), so that you have the level of the parents descends, instead of ascending.

How do I print a term list but alter the link text?

<?php $terms = get_terms( $taxonomies, $args ); $term_name_array = array(); foreach($terms as $term){ $term_name_explode = explode(“-“,$term->term_name); $myterm_name=””; for($i=0;$i<count($term_name_explode)-2;$i++){ $myterm_name.=” “.$term_name_explode[$i]; } $myterm_name = ltrim($myterm_name); if(in_array($myterm_name,$term_name_array)) continue; $term_name_array[] = $myterm_name; ?> <li><a href=”https://wordpress.stackexchange.com/questions/48983/<?php echo get_term_link($term->term_id)?>”><?php echo $myterm_name;?></a></li> <? } ?>

wp_insert_term does not insert description. [closed]

I was having the same problem the other day, due to a completely different typo 😉 $args = array( ‘description’ =>”My Desc”, ‘slug’ => “My Slug”, ‘parent’ => 0 ); $result = wp_insert_term(“Term1”, “category”, $args); Note the corrected ‘description’ element in the $args array.

How to write sql query to get the posts from a custom taxonomy term name

@Sisir linked you to the appropriate place, if you had read the question/answer and the linked Codex documentation you’d have seen that you could do something like the following: $args = array( ‘post_type’ => ‘dealers’ ‘tax_query’ => array( array( ‘taxonomy’ => ‘state’, ‘field’ => ‘slug’, ‘terms’ => array(‘bob’,’angela’,’john’,’smith’,’jan’,’doe’,’etc…’) ) ) ); $query = new WP_Query( … Read more