Taxonomy Relationships

Taxonomies are not child of each other unlike terms, which can be. Take a look at this flowchart: Model is a child of Make, and should not be registered as a new taxonomy. What you are trying to do, is something like setting Ford as a child of Honda, which is not right. Instead, register … Read more

Custom Taxonomy order by Custom Field

Ok so after posting the question an option to view another similar question appeared. So here is the answer if somebody is trying to do the same thing. //Using WordPress Pre-Get filter to order the custom taxonomy by custom field function customize_customtaxonomy_archive_display ( $query ) { if (($query->is_main_query()) && (is_tax(‘custom-taxonomy’))) $query->set( ‘post_type’, ‘your-post-type’ ); $query->set( … Read more

Looping Through Custom Tax Terms and Displaying All Posts For Each

If your things are laid properly, this code will output 10 posts from film CPT, where taxonomy is category-film and it will occur each of the term of that particular taxonomy. I’m not aware about your templating, so lay your layout accordingly. <?php $_terms = get_terms( array(‘category-film’) ); foreach ($_terms as $term) : $term_slug = … Read more

WP_insert_term how to insert multiple values as taxonomny term?

I would build the input fields for terms as array of inputs. Like this (note the [] inthe name attribute: <input name=”input_name[]” type=”text” value=””> <input name=”input_name[]” type=”text” value=””> <input name=”input_name[]” type=”text” value=””> Then, in PHP: //Now $_POST[‘input_name’]; is an array //get the array and sanitize it $input_terms = array_map( ‘sanitize_text_field’, $_POST[‘input_name’] ); //Set the array … Read more

Conditional two level dropdown filter for custom post type

Like I said in the comment, this can be solved by using two dropdowns. Additionally I already hinted you to an answer of mine doing this for a simple, one level, non conditional category selection. Category dropdowns can easily constructed with wordpress by making use of wp_dropdown_categories. To make it work as actual selection handed … Read more