WP_Query ignoring tax_query when is_singular

You can always use posts_clauses filter and add processing for tax_query in there (you don’t even need to write your own SQL): function filter_single_with_tax_queries( $clauses, $query ) { global $wpdb; if ( $query->is_singular ) { $query->parse_tax_query( $query->query_vars ); $tax_clauses = $query->tax_query->get_sql( $wpdb->posts, ‘ID’ ); $clauses[‘join’] .= $tax_clauses[‘join’]; $clauses[‘where’] .= $tax_clauses[‘where’]; } return $parts; } add_action( … Read more

Get unique superset of taxonomy terms from a list of custom posts in another hierarchical taxonomy

Assuming that when you are on the “page” sub_category_1 you’re looking at a standard archive for that term, you can do this… The main query is already for the posts in sub_category_1 so get a list of their IDs: global $wp_query; $post_ids = wp_list_pluck( $wp_query->posts, ‘ID’ ); Then you simply need to get a list … Read more

Dynamic dropdown select values depending on other custom field value

No plugins. You’ll have to build it yourself, using a JavaScript library. Basically, you’ll need to use an onchange() event on the main dropdown, then get the value and check an array of values for that specific value. If you search for a library, look for “chained select” or “linked select”. Another solution would be … Read more