How to group non-hierarchical tags?

The examples i quote in my answer can be found here, i also recommend you read that page carefully to help you with this. But lets grab an existing example there and change it a bit. <?php //you must change the parameters in the get_terms function to get exactly the terms you want $terms = … Read more

unable to save custom taxonomy terms in a custom-built metabox in wp-admin

Rather than ‘returning’ on a failure of authentication check, die with an appropriate message: For example: if ( !wp_verify_nonce( $_POST[‘states_noncename’], plugin_basename( __FILE__ ) ) ) wp_die(“Nonce-check failure”); This will indicate on what check (if any) that you are failing. In most cases, I would advise doing this rather than returning as it gives the user … Read more

how to insert content into my taxonomy

You’re using tax_input incorrectly. You’re not literally supposed to say taxonomy_name, you’re supposed to enter the name of your custom taxonomy. See https://codex.wordpress.org/Function_Reference/wp_insert_post. So, assuming your taxonomy is called ‘ninja_turtles’ and you are tagging your post with ‘donatello’ and ‘michelangelo’: // Create post object $my_post = array( ‘post_title’ => ‘My post’, ‘post_content’ => ‘This is … Read more

WordPress: Displaying all the post tags from within a specific taxonomy’s term

http://wordpress.org/support/topic/get-tags-specific-to-category $category_tags = $wpdb->get_results(” SELECT DISTINCT terms2.term_id as tag_ID, terms2.name as tag_name, t2.count as posts_with_tag FROM $wpdb->posts as p1 LEFT JOIN $wpdb->term_relationships as r1 ON p1.ID = r1.object_ID LEFT JOIN $wpdb->term_taxonomy as t1 ON r1.term_taxonomy_id = t1.term_taxonomy_id LEFT JOIN $wpdb->terms as terms1 ON t1.term_id = terms1.term_id, $wpdb->posts as p2 LEFT JOIN $wpdb->term_relationships as r2 ON … Read more