The get_the_terms()
returns a list of term objects. So first of all, you need to treat the output as a list rather than a single element. The name you’re looking for is stored in the name
field.
$artistnames = get_the_terms($post->ID, 'artist');
if (!empty($artistnames)) : ?>
foreach ($artistnames as $obj) {
$name = $obj->name;
// Do something with the name
}
Maybe you should use a custom field instead of a taxonomy? My experience is that they work better for singletons.
You get the custom fields in the loop by get_post_meta():
<?php $meta_values = get_post_meta($post->ID, 'artist', true); ?>
Hopefully this helps you somewhat!