Product dimensions filter by taxonomy
Product dimensions filter by taxonomy
Product dimensions filter by taxonomy
The documentation for WP_Query is the place to look for this 🙂 In particular, you’re after the taxonomy query parameters. Adding a tax_query to your code will look like this: $rate_query = new WP_Query( array ( ‘post_type’ => ‘movies’, ‘posts_per_page’=>’5’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘movie_genre’, ‘field’ => ‘slug’, ‘terms’ => array( ‘movie-genre-2’ ), … Read more
Some passing by can eventually find an answer to this question here. Same community but more proactive there. Weird.
For getting the child term of an parent you can use get_terms function Here you can provide hide_empty as false ( this will list all term ) parent as the parent term id ( this will return the term related to that parent id $tax_id = $term->term_id; $terms = get_terms( ‘post_tag’, array( ‘hide_empty’ => false, … Read more
echo term_description( $term->term_id, $taxonomy );
ACF is a third-party plugin and I don’t know what functions it gives you that you could use. In general, though, you can create a query for posts with a particular custom field and value. $args = array( ‘meta_key’ => ‘featured’, // must match the key that ACF has used ‘meta_value’ => true, // must … Read more
Looks like it was trying to create a taxonomy called category which was causing odd behaviour, ripping this code out did the trick, though some rewrite rules were necessary to make paginated archive pages work.
This is a direction. Not tested but you have an idea. <?php // get current term $term = get_term_by( ‘slug’, get_query_var(‘term’), get_query_var(‘taxonomy’) ); // get parent term $parent = get_term($term->parent, get_query_var(‘taxonomy’) ); // get children $children = get_term_children($term->term_id, get_query_var(‘taxonomy’)); $taxonomy = ‘business-types’; if ( empty($parent->term_id) ) { echo ‘<a href=”‘ . esc_url( get_term_link( $term ) … Read more
Solved I’ve solved it by myself. The WordPress function get_the_term_list() returns the terms of the post, but unfortunately they are in the reversed hierarchical order, so I had to turn them around. $id = get_the_ID(); $terms = get_the_term_list( $id , $taxonomy , ” , $randomstring ); $terms_array = explode( $randomstring , $terms ); $terms_string = … Read more
It’s easy if you want to use a different taxonomy. Just change the ‘category’ value below to whatever your taxonomy name is. <?php wp_dropdown_categories( array( ‘taxonomy’ => ‘category’, ) ); ?> For additional parameters, see the full list on the WordPress Codex.