get_the_terms() to show all custom taxonomies
get_the_terms() to show all custom taxonomies
get_the_terms() to show all custom taxonomies
what tables uses wp_get_post_terms
For your author content display, instead of print_r($all_term_meta); try a foreach: foreach($all_term_meta as $meta) { return $meta[0]; } It’s possible you may need to use “echo” instead of “return” but try “return” first. To control whether or not there is an author tab, update your woo_new_product_tab function with the same condition: function woo_new_product_tab( $tabs ) … Read more
get_queried_object() will get the currently queried ‘thing’ from the main query as an object. That could be a WP_Post, WP_Term, or WP_Post_Type (for post type archives) object, but I don’t think that’s quite what you’re asking for and wouldn’t be useful in AJAX. Other than that there isn’t a function for exactly what you’re asking … Read more
Output the content of a term organised by each of the CPT?
You’re not echoing the result, it’s just returning which isn’t output to the page. You should be able to change return $result; into echo $result; and have it display. Just be aware that as you have your code now, it’s not going to return or echo a proper link. My guess is you could use … Read more
You could use tax_query to get only the posts with the term that is currently being looped. $argsPost = [ ‘post_type’ => ‘meal’,//CPT meal ‘posts_per_page’ => -1, ‘meta_key’ => ‘ordre’, ‘orderby’ => ‘meta_value’, // Use the custom post order ‘order’ => ‘ASC’ ‘tax_query’ => array( array( ‘taxonomy’ => ‘cat_meal’, ‘field’ => ‘term_id’, ‘terms’ => $term->term_id, … Read more
Can’t create term for product attribute
How to order and count get_terms by specific post type?
Now I am able to sort taxonomy terms by term_order using below snippets. But I am still seeking answer for the original question “How to do it using pre_get_terms”. function foo_tax_order($orderby, $args){ return ‘t.term_order’; } add_filter(‘get_terms_orderby’, ‘foo_tax_order’, 10, 2);