Query posts using custom taxonomy and selected terms

You’re using a deprecated method of querying by taxonomy. Read the Codex and use tax_query: $args=array( ‘post_type’ => ‘book’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘caller_get_posts’=> 1, ‘tax_query’ => array( array( ‘taxonomy’ => ‘facts’, ‘field’ => ‘slug’, ‘terms’ => ‘information’ ) ) ); FYI, caller_get_posts is also deprecated.

Get Categories Where Taxonomy Equals ‘n’

get_categories() only lists categories, so you shouldn’t be seeing any terms from the custom taxonomy. What you want to use is get_terms() which takes a taxonomy as an argument. As you can read about in this answer, get_terms() is actually used by get_categories(), it just prefills the “taxonomy” argument with “category.” If you swap in … Read more

Get current term in single.php

You can use wp_get_object_terms($object_ids, $taxonomies, $args) to get all terms from a defined set of taxonomies for an object The $taxonomies parameter can be an array of taxonomy names. http://codex.wordpress.org/Function_Reference/wp_get_object_terms

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

Querying posts by latitude and longitude to build a Google Maps with several markers

To connect your meta fields with the “Geo Data Store”-Plugin, you simply take the name of the meta key/field and map it with the filter to the plugin. add_filter( ‘sc_geodatastore_meta_keys’, ‘wpse82502_lat_lng_metakey_mapping’ ); function wpse82502_lat_lng_metakey_mapping( $keys ) { $keys[] = “your_meta_key_field_name”; return $keys; } To get the data from PHP to JS, simply use wp_localize_script().

Return Taxonomy Name for Each Term

$term->taxonomy is the taxonomy name for each term, $term->term_taxonomy_id the – wait for it! – taxonomy ID. To get the display names use get_taxonomy(): $terms = get_terms( array( ‘category’, ‘post_tag’ ) ); foreach ( $terms as $term ) { $tax_name = esc_html( get_taxonomy( $term->taxonomy )->labels->name ); echo “$term->name ($tax_name)<br>”; }