Search CPT by tag ids

I have done by my self. Here is the solution $args = array( ‘post_type’ => ‘gampu’, ‘posts_per_page’ => -1, ‘post_status’ => ‘any’, ‘orderby’ => ‘ID’, ‘order’ => ‘DESC’, ‘tax_query’ => array( ‘relation’ => ‘OR’, array( ‘taxonomy’ => ‘my-tag-taxonomy1’, ‘field’ => ‘id’, ‘terms’ => array(30,31,34), ), array( ‘taxonomy’ => ‘my-tag-taxonomy2’, ‘field’ => ‘id’, ‘terms’ => array(30,31,34), … Read more

Add taxonomy column with meta field (ACF) content

As Sally CJ suggest in comments, the error come from the terms with artist_avatar empty. So, check if is_array() before access the array, fix it: add_filter(‘manage_artist_custom_column’, function ($content,$column_name,$term_id){ $term = get_term($term_id, ‘artist’); $avatar = get_field(‘artist_avatar’, $term); switch ($column_name) { case ‘artist_avatar’: if ( is_array( $avatar ) ) { $content = $avatar[“url”]; } else { $content … Read more

How to add a shortcode function that returns the taxonomy slug of the actual post within the loop

get_the_terms() will always return an array; but because you have only one ‘project_category’, you can simply use its first element: add_shortcode( ‘return_taxonomy_slug’, ‘my_shortcode_return_taxonomy_slug’ ); function my_shortcode_return_taxonomy_slug() { $terms = get_the_terms( get_the_ID(), ‘project_category’); return $terms[0]->slug; }

Why are custom taxonomies only appearing on the edit page of one of these types, but not the other?

In short, it’s because your Formats taxonomy is not enabled in the REST API. Events shows both custom taxonomies and the built-in Categories, Resources only the built-in. That is actually the expected behavior. The Events post type doesn’t have the editor support, i.e. $supports = array(‘title’, ‘featured-image’, ‘thumbnail’, ‘excerpt’); — no editor in the list. … Read more