How do I query a taxonomy term range

You could take the query var and programatically expand the numbers between your minimum value and maximum value. Assuming http://tax.jenswedin.com/age/10,20/ is rewritten to http://tax.jenswedin.com/?age=10,20, then (pseudo code) $parts = explode(get_query_var(‘age’), ‘,’); $min_val = $parts[0]; // Should be 10 in this example $max_val = $parts[1]; // Should be 20 in this example $range = range($min_val, $max_val); … Read more

get_terms() for custom taxonomy related to another taxonomy

You can try getting all the posts IDs from the first taxonomy $objects = get_posts( array( ‘category’ => ‘history’, ‘numberposts’ => -1, ) ); foreach ($objects as $object) { $objects_ids[] = $object->ID; } Then get the terms from the second taxonomy associated with them: $collections = wp_get_object_terms( $object_ids, ‘collections’ );

Query 1 taxonomy term, exclude another

I guess its because you are trying two conditions on one taxonomy, you can allways create a custom sql query, something like this: $querystr = ” SELECT * FROM $wpdb->posts LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFT JOIN $wpdb->term_taxonomy ON($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) LEFT JOIN $wpdb->terms ON($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id) WHERE $wpdb->posts.post_type=”resource” AND $wpdb->posts.post_status=”publish” AND $wpdb->term_taxonomy.taxonomy = … Read more

Taxonomy , subtaxonomy,child taxonomy of a product woocommerce

Based on this answer, here is my function to get all your terms in an array : function get_term_ancestors($post_id, $taxonomy){ // Declare the array where we are going to store the terms $ancestors = array(); // start from the current term $parent = array_shift(get_the_terms($post_id,$taxonomy)); // climb up the hierarchy until we reach a term with … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)