Add terms to a taxonomy archive from within the same taxonomy
Add terms to a taxonomy archive from within the same taxonomy
Add terms to a taxonomy archive from within the same taxonomy
How to do a WP_Query when a post has a relationship to anoter post via an ACF Post Object field, where the related post is in a certain category?
After messing with some code I found a solution: just use this code and a lot if information will be showed. Within all this data you search for the categorie that is inside your taxonomy and you’ll see the taxonomy-> name. // Show all data of all taxonomies function print_tax_data(){ $data = get_terms(); print_r($data); } … Read more
Query Two Different Taxonomies Nested
Get main parent category for post (WordPress/Advanced Custom Fields)
Try this code: function these_rand_tax1() { $max = 8; //number of categories to display $taxonomy = ‘baumaschinen_cat’; $terms = get_terms(‘taxonomy=’ . $taxonomy . ‘&orderby=name&order=ASC&hide_empty=0’); $terms = (array)$terms; // Random order shuffle($terms); // Get first $max items $terms = array_slice($terms, 0, $max); // Sort by name usort($terms, function ($a, $b) { return strcasecmp($a->name, $b->name); }); // … Read more
Prioritise Pages over Taxonomy Term Root Archive, but not Taxonomy Term Child Archives
get terms hiding empty
How to get related taxonomies based on a category with mysql query?
I managed to solve my issue by looping through a get_the_terms() function. In my case, I’ve also created a shortcode. function display_taxonomy() { $prognoses = get_field(‘prognosis’); ob_start(); if( $prognoses ): foreach( $prognoses as $prognosis ): $terms = get_the_terms( $prognosis->ID , ‘my_custom_taxonomy’ ); foreach ( $terms as $term ): echo $term->name; endforeach; endforeach; endif; return ob_get_clean(); … Read more