Grouping posts by 2 different taxonomies

After much searching, and lots of help here (thanks again, Sally CJ), this the code I ended up using. $category_terms = get_terms(array(‘taxonomy’ => ‘categories’)); $series_terms = get_terms(array(‘taxonomy’ => ‘series’)); $custom_post_type=”cpt”; foreach( $category_terms as $category_term ) { foreach ($series_terms as $series_term) { $args = array( ‘post_type’ => $custom_post_type, ‘showposts’ => ‘5000’, ‘meta_key’ => ‘available_date’, ‘tax_query’ => … Read more

ACF – How to get custom taxonomy term image field

I found a solution for this: <?php $current_term_id = get_queried_object_id(); $taxonomyName = “car-brand”; $parent_tax_ID = $current_term_id; $parent_tax = get_term($parent_tax_ID); $terms = get_terms( $taxonomyName, array( ‘parent’ => $parent_tax_ID, ‘orderby’ => ‘slug’, ‘hide_empty’ => false ) ); foreach ( $terms as $term ) { $image2 = get_field(‘am-brand-img’, $term); echo ‘ <div class=”am-ts-item”> <a href=”‘ . get_term_link( $term … Read more

Only display top level taxonomy on the edit post page with option to expand sub-categories

This is a VERY untested approach, but the recent addition of CSS’s :has selector has been top-of-mind for me lately, and I wondered if a simple solution could be built using purely CSS.. As a proof of concept, add the following to your site’s admin CSS: #categorychecklist > li .children{display:none;} #categorychecklist > li:has(input:checked ) .children{display:block;} … Read more

tech