Save values generated via API as taxonomy terms

It’s as easy as: function wpse_199523_save_imdb_terms( $post_id ) { if ( ! $imdb = get_field( ‘imdb_id’, $post_id ) ) return; if ( ! $data = imdb_connector_get_movie( $imdb ) ) return; if ( ! empty( $data[‘actors’] ) ) wp_set_object_terms( $post_id, $data[‘actors’], ‘actors’ ); if ( ! empty( $data[‘director’] ) ) wp_set_object_terms( $post_id, $data[‘director’], ‘directors’ ); } … Read more

Group Custom post type in a taxonomy page by its child taxomony

I got it! Seems a little confused at first, but the logic is here: <?php $term = get_queried_object(); ?> <?php echo $term->name; ?> <?php $children = get_terms( $term->taxonomy, array( ‘parent’ => $term->term_id, ‘hide_empty’ => false ) ); if($children) { foreach ( $children as $child ) { ?> <?php echo ‘<li>’ . $child->name . ‘</li>’; ?> … Read more