multi custom fields and taxonomy search

I’m not sure if I fully understand what you’re trying to do, but I always recommend the Advanced Custom Fields plugin to people looking to make custom fields more useful and intuitive. Great plugin with great support and documentation. It really opens up a lot of possibilities.

What are these undocumented arguments for register_taxonomy?

I suspect the Taxonomies Codex entry is simply out of date. Per source, there are no ‘sort’ or ‘orderby’ args for register_taxonomy(). Given the purpose of the register_taxonomy() function, it doesn’t even really make sense for this function to include sort/orderby parameters. Such parameters would be relevant to listing taxonomy terms, not to registering the … Read more

Semi complicated custom taxonomy question

Start with a tax_query to get posts with the ‘categorie’ taxonomy term you want. Assuming a custom query: $tax_query_args = array( ‘tax_query’ => array( array( ‘taxonomy’ => ‘categorie’, ‘field’ => ‘slug’, ‘terms’ => array( ‘costa’ ) ), ); $tax_query = new WP_Query( $tax_query_args ); Then, step through that query, and use get_the_terms() to return the … Read more

Trying to add taxonomy to get_categories() but it’s not working. How to fix this?

Use : $terms = get_terms( ‘location’, ‘hide_empty=0′ ); if(is_wp_error($terms)){ // error occurred } else if (empty($terms )){ // no terms were found } else { // process terms foreach($terms as $term){ // process this individual $term } } I’d advise you use the generic taxonomy & term functions everywhere, and avoid the special case category … Read more

Syntax help needed: Taxonomy Query

first of all, let’s just forget query_posts exists. there’s no good reason to use it, ever. the best way to do this is via the pre_get_posts action in your theme’s functions.php. you don’t have to set any taxonomy parameters, those are already set on a taxonomy archive page, you just need meta key and orderby: … Read more

How to Order a list of taxonomies? orderby?

If you use the more generic get_terms you can include in the $args field all of the information to get the term or the children and specifically say what you want to order by and how you want it to be ordered. Ex. $termchildren = get_terms( “location”, array( ‘child_of’ => 4, ‘orderby’ => ‘name’, ‘order’ … Read more