New answers tagged

1

From the get_terms documentation: orderby (string): Field(s) to order terms by. Accepts term fields ('name', 'slug', 'term_group', 'term_id', 'id', 'description'), 'count' for term taxonomy count, 'include' to match the 'order' of the $include param, 'meta_value', 'meta_value_num', the value of $meta_key, the array keys of $meta_query, or 'none' to omit ...


0

Without seeing the code, it's a bit hard... But if you're trying to query for a certain taxonomy when 'post_type' => 'page', make sure you Add a registered Taxonomy to a registered Post Type. (See Codex) In this case, you would add it to 'post_type' => 'page' since "Pages" do not support any taxonomies by default. Again, you may have done this ...


0

WordPress is generating the tax query for you - when you register a custom taxonomy, it also registers what's known as a query var. This is a "key"-type value that means you can simply do this: new WP_Query([ 'age_from' => 2 ]); ... and WP will transform that to: WP_Tax_Query([ [ 'taxonomy' => 'age_from', 'terms' => 2, ...



Top 50 recent answers are included