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!
Related Posts:
- Custom Post Type and Taxonomy URL rewrite
- How to build a complex page structure
- Remove admin menu for custom taxonomy attached to custom post type
- How do I list custom taxonomy terms without the links?
- Page not found taxonomy custom post type
- How to list custom taxonomy categories?
- clients list using wordpress
- How to do a custom bookmarks post type?
- How to get_queried_object on multiple objects?
- custom taxonomy – Template not working
- Count number of posts which exist in 2 taxonomies?
- Getting taxonomy terms used by custom post type
- How to display Custom Taxonomy of Custom post type
- associate custom post type with tags with specific pages
- Removing Duplicate Custom Taxonomy Terms from within a Dropdown Select?
- How to customize admin posts based on the user who is logged in
- taxonomy template for custom post type the same as the archive
- Custom taxonomy template for multiple custom post types
- Custom Post Types for Support Ticket plugin?
- Add/Remove current_page_parent class
- Use different taxonomies in different custom post types’ permalinks?
- Query/list all terms and their custom post count
- Search Custom Post Type & Taxonomies
- Get custom taxonomies from multiple posts
- How can I make a custom post type sticky?
- Help need making decision. Ads rotating site on wordpress
- Categories of custom taxonomy don’t show any posts
- Get Taxonomy Term Title by it’s URL
- Is it possible to have dedicated page for parent/child taxonomy?
- Can a Custom Taxonomy be named “category” like normal Posts?
- How to use terms from the same custom taxonomy in different roles in a custom post type?
- How to have the same url structure for both a CPT and a Taxonomy?
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- limit value taxonomy based on previous taxonomy value wordpress
- Limit number of custom posts per taxonomy
- Number of Custom Post Types published are not being shown in the custom page
- Load Custom_post_type categories post with ajax
- Deleting taxonomy terms and relationships on a custom post_type when a user is deleted
- How can I get this request to use the Custom Post Type page template instead?
- Include custom taxonomy term in search
- Why is my WP_Query outputting my entries twice?
- Different slug taxonomy for two different CPT
- custom post type and custom taxonomy
- Custom Post Type with Custom Taxonomy as Category
- WP_Query() with custom post type and taxonomy — get all terms?
- Why does my taxonomy have a category style div id?
- Get custom post type categories to show up in menus
- Custom Type add Transitions
- How do I get the custom category URL from the custom post type?
- Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
- How to loop through custom taxonomies and sub taxonomies and display posts?
- How to populate a Gravity Forms Custom Post Field (dropdown type) with custom taxonomy terms? [closed]
- Custom post type name and assigning custom taxonomy
- Building a Portfolio and need some direction
- Custom Post Type Custom Archive Page Not Working
- Enabling permalinks disables custom page template
- Correct way of adding taxonomy to a custom post type
- Query Custom Post Type by Taxonomy
- WordPress custom taxonomy page
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Related “custom post type” using “custom taxonomy”
- How to create Custom Taxonomy Search Drop Down for specific Post Type
- How do I disable the built-in editor and automatically configure the properties of new pages?
- How to have multiple search result pages in wordpress with taxonomy terms listed
- Set priority to permalinks
- How to list posts by terms
- Changing CPT permalink
- CPT UI: Connect a custom post type to a custom post type
- List posts of custom post type under category name
- Custom post type and taxonomy same slug
- Single taxonomy for different custom post types
- What’s the most efficient way to get two queries based on an if statement?
- Query pulling all taxonomies, not one I am specifying
- Custom Post Type rewrite url to /category/pagetitle [duplicate]
- Custom Post Type Taxonomy – Permalinks generating, but posts not found
- Decrement term in for each
- WordPress custom post type advise
- Custom Post Type and Taxonomies, creating the corresponding template file and loop the data
- Post Editor: display categories from current post type taxonomy only?
- Generating List of Tags from Custom Post Type
- Post data in separate divs with incrementing class using WP_Query
- Exclude a custom category from a list
- Get term_id for each instance of custom taxonomy
- How to list groupings and keep pagination
- Custom Post Types and Taxonomies
- install.php Custom Taxonomy Term not being added to custom post
- How to retrieve taxonomy terms of the current custom post?
- Custom Taxonomy in Permalink from post type
- How to add taxonomy in menus?
- WordPress and Unity high scores table
- Inserting two categories
- How to manage a bookstore
- How can i change url structure of cpt like this?
- Custom taxonomy meta fields
- Same slug for Custom Taxonomy archive and CPT archive – Rewrite rule not working
- Problem with shortcode
- How to add categories to a custom post type using wp_insert_post($new_post);
- Modify permalink of CPT archive to support two taxonomies
- WP Query – Can’t get posts with specific taxonomy