Custom Taxonomy Term Caching?
There are some bugs related to hierarchical term caching, indeed: http://core.trac.wordpress.org/ticket/14704 http://core.trac.wordpress.org/ticket/14485
There are some bugs related to hierarchical term caching, indeed: http://core.trac.wordpress.org/ticket/14704 http://core.trac.wordpress.org/ticket/14485
There is nothing in term_description() and deeper (that I see) that checks for user. You can try this and see if it returns WP_Error that might make term_description() return empty string: get_term_field( ‘description’, $term, $taxonomy )
If you don’t see your custom post types or taxonomies, look under the Screen Options to make sure they are checked to be Show on Screen.
Try this: $jobsTerms = get_terms(‘jobtype’,array( ‘taxonomy’ => ‘jobtype’ )); foreach($jobsTerms as $term){ $checked = (has_term($term->slug, ‘jobtype’, $post->ID)) ? ‘checked=”checked”‘ : ”; echo “<label for=”term-” . $term->slug . “”>” . $term->name . “</label>”; echo “<input type=”checkbox” name=”term” . $term->slug . “” value=”” . $term->name . “” $checked />”; } Replace $post_id with whatever you need to … Read more
Had to write a method to do it. Here is the method… hope it helps someone else 😉 syntax: copy_terms($term->term_id, “taxonomy1”, “taxonomy2”, 0); //will copy to root of destination /** * Copy a term and its descendants from one taxonomy to another. * Both taxonomies have to be hierarchical. Will copy across * posts as … Read more
You could do it using the term_link filter. Something roughly as follows: function my_term_link($termlink, $term, $taxonomy) { global $post; if ($taxonomy == ‘my-custom-taxonomy’) { return get_permalink( $post->ID ) . ‘#’ . $term->term_id; } } while ( $programtype->have_posts() ) : $programtype->the_post(); $terms = get_the_terms( $post->ID, ‘my-custom-taxonomy’ ); add_filter(‘term_link’, ‘my_term_link’, 10, 3); foreach ($terms as $term) { … Read more
I managed to make it work but not fully. First, the code you provided is not retrieving an already saved post_meta. I based my code in the introductory code of this tutorial: http://wpengineer.com/2076/add-custom-field-attachment-in-wordpress/ And am using the regular post_tag taxonomy instead of a custom one. And, lastly, there’s a bug, after you close the Media … Read more
I think you can try the following options. wp_list_categories with the ‘show_count’ parameter http://codex.wordpress.org/Template_Tags/wp_list_categories get category and use $count = $category->category_count; http://codex.wordpress.org/Function_Reference/get_category You can traverse up the functions to get_term if those don’t work and see what is in there, even though you probably can use get the terms you will have to parse the … Read more
When you do the following in your code $posttags = get_the_tags($item->term_id);, $item is referring to a post object, not a term object. Therefore, term_id is an invalid property. This should be throwing a PHP notice. While not certain, I think what you are intending to do is: $posttags = get_the_tags($item->ID); since get_the_tags takes a post … Read more
I think for each term you should check that it has a parent but not have any childern So you code may look like $taxonomy = ‘world’; $tax_terms = get_terms( $taxonomy ); foreach ($tax_terms as $value){ $args=array( ‘child_of’=> $value->term_id, ); //get all child of current term $child = get_terms( $taxonomy, $args ); if( $value->parent != … Read more