store an array of all the terms existing

Not sure what the problem is, you’re practically there! You can use your code anywhere (as long as it’s after the init hook), not just in template files. $terms = get_terms( ‘MYTAXONOMY’ ); $term_slugs = wp_list_pluck( $terms, ‘slug’ ); wp_list_pluck() is a very cool little function that will pluck a field out of an array … Read more

get_terms Parent Tags

The parent argument should do what you are asking. parent (integer) Get direct children of this term (only terms whose explicit parent is this value). If 0 is passed, only top-level terms are returned. Default is an empty string. http://codex.wordpress.org/Function_Reference/get_terms That is parent=14 should get all of the immediate children of term 14, but no … Read more

Getting Term_id – Taxonomy Metadata plugin

Alright, I have found a way. If it can be useful for someone here is how I solved it: $terms = get_the_terms( $post->ID , ‘custom_taxonomy’ ); if($terms) { foreach( $terms as $term ) { $term_id = $term->term_id; } } Then you can use $term_id in your expression.

list of tags overlay

Notice that the strip_tags() will remove all HTML tags. If you want to allow <br>, then you can add it as the second input parameter: echo strip_tags( $text, ‘<br>’ ); I want to display them like a list For that case, you could try this example: <p class=”nom”> <ul> <?php the_terms( get_the_ID(), ‘project_tag’, ‘<li>’, ‘</li><li>’, … Read more

add links to list of post terms

Then try to add foreach ( $arr_terms as $terms_links ) { if(!empty($terms_links)) { echo ‘<a href=”#”>’ . $terms_links . ‘</a>’;  } } That checks if the $terms_links is empty, and if so it wont print it out.

get_terms not working when child_of is used

I got it solved on my own so, wanted to answer my own question. in options table the results are cached, so I queried it and delete that. SELECT * FROM `wp_options` WHERE `option_name` like ‘%department%’ department is my taxonomy name here. You can check the function _get_term_hierarchy in taxonomy.php in wp-includes folder.