Multiple terms not working on taxonomy
Try changing the field value to term_id, since there is no id value for that option. Ref: WP_Query Taxonomy Parameters
Try changing the field value to term_id, since there is no id value for that option. Ref: WP_Query Taxonomy Parameters
You can use get_ancestors() to get an array of parents, which you can then count. $term_id = 42; $ancestors = get_ancestors( $term_id, ‘category’ ); if( ! empty( $ancestors ) ){ echo count( $ancestors ); }
I’m not sure if this is a bug, but it need further investigation. I’ve run a few quick tests on the name field in a tax_query, and whenever a term name has got a special character or have more than one word, the tax_query is excluded from the SQL query TEST 1 I have use … Read more
Multiple tax_queries: display posts titles from several custom taxonomie
WP_Query: Meta_Query with serialized value (or a workaround)
Custom query for tag and custom tag from 2 post type
Empty ‘terms’ in ‘tax_query’ returns an empty array
I’ve discovered a solution. I don’t know if it’s the best solution, but it does work. GROUP BY wp_posts.ID was causing my query to error out. I don’t quite understand why. In theory, my query should be returning duplicate posts without it… but it’s not. So, I’m going to push this code live as it … Read more
I’m not sure if this is a bug, but it need further investigation. I’ve run a few quick tests on the name field in a tax_query, and whenever a term name has got a special character or have more than one word, the tax_query is excluded from the SQL query TEST 1 I have use … Read more
Query breaking with ‘posts_per_page’ => -1