How to share category taxonomy with custom post type (The Event Calendar plugin)

You can use register_taxonomy_for_object_type() to use a taxonomy with a post type, without having to touch the post type registration code, example: function wpa_categories_for_events(){ register_taxonomy_for_object_type( ‘category’, ‘tribe_events’ ); } add_action( ‘init’, ‘wpa_categories_for_events’ ); To have events appear on the category pages, I believe you have to modify the default category queries via pre_get_posts to add … Read more

Loop through custom taxonomies and display posts

I thought I would provide another answer as the above one is a little hacky, also I added another layer that gets all taxonomies for a post_type. $post_type=”post”; // Get all the taxonomies for this post type $taxonomies = get_object_taxonomies( (object) array( ‘post_type’ => $post_type ) ); foreach( $taxonomies as $taxonomy ) : // Gets … Read more

Custom columns on edit-tags.php main page

You can do this by hooking into the ‘taxonomy’_edit_form and edited_’taxonomy’ actions. add_action(‘taxonomy_edit_form’, ‘foo_render_extra_fields’); function foo_render_extra_fields(){ $term_id = $_GET[‘tag_ID’]; $term = get_term_by(‘id’, $term_id, ‘taxonomy’); $meta = get_option(“taxonomy_{$term_id}”); //Insert HTML and form elements here } add_action(‘edited_taxonomy’, ‘bar_save_extra_fields’, 10, 2); function bar_save_extra_fields($term_id){ $form_field_1 = $_REQUEST[‘field-name-1’]; $form_field_2 = $_REQUEST[‘field-name-2’]; $meta[‘key_value_1’] = $form_field_1; $meta[‘key_value_2’] = $form_field_2; update_option(“taxonomy_{$term_id}”, $meta); } … Read more

Query Custom Post by Taxonomy Category

There are 3 ways of doing that: a) … ‘category_name’ => ‘category-1’ … b) … ‘taxonomy’ => ‘category’, ‘term’ => ‘category-1’, … c) … ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => array( ‘category-1’ ) ) ) … More info: http://codex.wordpress.org/Function_Reference/WP_Query

limit selection of custom taxonomies to one?

Instead of hacking it with jQuery, a more reliable solution would be to replace the meta box with your own, in PHP. Anyway, the problem is most likely with the ‘[‘ and ‘]’ characters in the selector: “input[name=tax_input[ba_locations][]]” could be rewritten as “input[name=tax_input\\[ba_locations\\]\\[\\]]” See https://stackoverflow.com/questions/2786538/need-to-escape-a-special-character-in-a-jquery-selector-string