Artists without featured images: ‘artists’,
‘hide_empty’ => false,
));
$terms_without_image = array();
foreach ($terms as $term) {
$image_id = get_term_meta($term->term_id, ‘taxonomy_image’, true);
if (empty($image_id)) {
$terms_without_image[] = $term;
}
}
if (!empty($terms_without_image)) {
foreach ($terms_without_image as $term) {
echo ‘‘ . esc_html($term->name) . ‘, ‘;
}
} else {
echo ‘No terms without a featured image.’;
}
}
// To use this function, call it wherever you need to display the terms without a featured image
// For example: display_terms_without_featured_image();
display_terms_without_featured_image();
?>
$biography_category_id,
‘fields’ => ‘ids’, // Get only post IDs
‘posts_per_page’ => -1 // Fetch all posts
));
// Initialize an array to store artist IDs found in Biography posts
$biography_artist_ids = array();
// Loop through Biography posts to get associated artist IDs
foreach ($biography_posts as $post_id) {
$post_artists = get_the_terms($post_id, ‘artists’);
if ($post_artists) {
foreach ($post_artists as $artist) {
$biography_artist_ids[] = $artist->term_id;
}
}
}
// Remove duplicates from artist IDs
$biography_artist_ids = array_unique($biography_artist_ids);
// Fetch all artist terms
$all_artists = get_terms(array(
‘taxonomy’ => ‘artists’,
‘hide_empty’ => false, // Include all terms
));
// Filter artists to exclude those in Biography category
$filtered_artists = array_filter($all_artists, function($artist) use ($biography_artist_ids) {
return !in_array($artist->term_id, $biography_artist_ids);
});
// Output the filtered list
if (!empty($filtered_artists)) {
echo ‘
Artists with no Biography: ‘;
$artist_links = array();
foreach ($filtered_artists as $artist) {
$artist_links[] = ‘‘ . esc_html($artist->name) . ‘‘;
}
echo implode(‘, ‘, $artist_links);
echo ‘
‘;
} else {
echo ‘
No artists found outside of the Biography category.
‘;
}
?>
Reason for report?






