Always check the codex – get_terms( $taxonomies, $args ) – your code should read:
$genre = get_terms( 'genre', array(
'include' => get_post_meta( $post->ID, 'maingenre', true ),
));
Related Posts:
- Exclude Custom Post Type from shared Custom Taxonomy
- Get terms by taxonomy AND post_type
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- query multiple taxonomies
- wp_set_object_terms() is not replacing term, but creating a new one
- Get terms that contain posts that in turn belong to other terms?
- Custom Taxonomies Terms as Post Title for Custom Post Types upon Publishing
- Retrieve single term slug
- How can I add programmatically custom taxonomy terms to a custom type post when saving posts?
- post count is wrong when using same taxonomy for 2 different CPT
- Glossary with Custom Post Type
- Dynamically Create Terms in Taxonomy when Custom Post Type is Published. Almost There!
- Custom Post Type Archive Template
- Filter get_categories() for taxonomy term in WordPress
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- Separate Custom Post Type Taxonomy by Comma
- Sort the main query in subcategories/terms?
- Get child terms of current term of the current post
- Highlight nav menu terms
- Want to filter only parent post in admin area
- Get list of terms of current taxonomy archive for another taxonomy
- pre get posts changing the query
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- Dynamically create/remove terms in taxonomy when custom post type is published/trashed
- How to get the first term for the current taxonomy?
- Output the content of a term organised by each of the CPT?
- How to filter the taxonomy terms based on another taxonomy term
- Add html to cpt main page / admin edit.php
- register_taxonomy and register_post_type does not work [closed]
- How to check the terms in single custom post type template
- get_the_terms return only last term
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- How to query custom post types posts filtered by multiple custom taxonomies through a form selection
- How do I display tags for a custom post type single page?
- How can I see a list of my Custom Post Types of the last term I was in?
- using $wpdb to get custom post type with term
- Show posts from two or more custom taxonomy terms
- Allow user to set custom order to a list of custom taxonomies?
- Display post as term id
- How to filter wp_list_categories output with some custom post type meta query?
- How to Filter custom post type by taxonomy?
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- Display Custom Taxonomy Alphabetically
- Get terms that contain posts that in turn belong to other terms?
- How to get custom posts sub category link
- Filter Posts from the Main Query
- Displaying custom-taxonomy-terms sorted by parent/child-hierarchy?
- Query posts with double taxonomy
- Adding predefined terms to a taxonomy
- Custom query – get_the_terms not work
- Filter posts by tax (dropdown) and meta value
- How to Display Posts From Category Within a Custom Taxonomy?
- Shared terms between taxonomies
- How to get dropdown instance value in WordPress custom Widget
- custom hierarchical taxonomy and custom post type list contains surplus posts
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- how to count the current posts terms
- Urls in Custom Post Type work for Terms but not for its Taxonomies
- Custom Taxonomy Terms in Menu lead to which page?
- How can I get 3 different taxonomy type terms in a div class element?
- Get terms for a specfic post from multiple taxonomies in custom post type
- Add custom post type taxonomy tag to article class
- Custom Taxonomy dont save in a frontend form for post a custom post
- Add filter to Admin list for all custom post types by their custom taxonomies
- Add the custom post term to the custom post title
- Custom taxonomy not saving correctly
- Taxonomy terms with the same name are updated between separate custom post types
- Add a class to a div if custom post type has specific terms?
- display post count in archive page that have relation with another taxonomy term
- Return multiples taxonomies with wp_get_object_terms
- Custom taxonomy terms hierarchical navigation
- Filter in Custom post type to find the parent post
- Excluded Custom Taxonomy Term Posts Displaying in loop
- Get all posts for custom taxonomy term
- posts_per_page is not working by term
- Insert custom taxonomy into category query
- Add active class to foundation 6 tabs while looping categories
- Saving Child Terms on front end not setting parent
- how it’s possible to show from a post of a custom post type the taxonomy/terms?
- Filter Term By Parent Term – Custom Post Type
- Filter By Term Not Working – Custom Post Type
- Display all Custom taxonomy terms and their relevant custom posts
- WordPress get all post with like in terms [duplicate]
- Get posts of an specific term of a custom taxonomy
- Best way to group posts based on custom post type terms
- Get list of CPT posts in *current* post’s taxonomy term
- Fetch posts list from fist CPT taxonomy term and list under 2. CPT
- How to List CPTs Under One Tax Term
- How to retrieve the permalink for a specific (custom) term?
- Remove Custom Taxonomy Slug only without removing Custom post type slug in permalinks
- Get a list of categories ids
- taxonomy terms array not working
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- get_the_term_list() wanting to loop through the returned values
- List custom taxonomy terms
- Is it possible to get_terms by taxonomy AND post_type?
- Is there a way to edit non-custom term attributes?
- Can’t retrieve custom post type taxonomy term to custom post type editor