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
- remove custom post type permalink
- Saving Taxonomy Terms
- Get Posts by Custom Post Type ,Taxonomy, and Term
- Get The Post Type A Taxonomy Is Attached To
- Display current taxonomy term when inside custom post type
- Get term slug of current post
- How to change “Draft” string for status of custom post type to “Unavailable”?
- How to limit the number of terms (terms acts like categories)
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- How do I list custom taxonomy terms without the links?
- query multiple taxonomies
- How to correctly get post type in a the_title filter
- 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?
- wp_insert_term doesn’t work with custom post type’s taxonomy
- Custom Taxonomies Terms as Post Title for Custom Post Types upon Publishing
- wp_get_object_terms(): count relative to passed IDs?
- Custom taxonomy not saving correctly
- Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category
- Taxonomy terms with the same name are updated between separate custom post types
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- Add a class to a div if custom post type has specific terms?
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- 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
- How to display custom taxonomy term specific post?
- Store a value in global scope after init hook is fired
- How to list posts by terms
- Filter in Custom post type to find the parent post
- Excluded Custom Taxonomy Term Posts Displaying in loop
- How to order taxonomy terms by most recent post?
- How to associate custom taxonomy terms with custom post type?
- get_queried_object not work in taxonomy page
- Post Click Redirect to Custom URL instead of Single Post Page
- Change the term based on the value of a $variable using wp_update_post in submitting a form
- get_the_terms child terms for current post/custom post only
- Get all posts for custom taxonomy term
- posts_per_page is not working by term
- Insert custom taxonomy into category query
- Dropwdown: Get taxonomy terms from posts that share preselected terms from 3 other taxonomies
- Custom Post Type / Taxonomy / Term – what template to use to avoid 404-page?
- Pages of my taxonomy terms are showing all posts
- Display title of all custom posts from same taxonomy term on a custom post template
- wordpress does not see the correct custom taxonomy hierarchy
- Add active class to foundation 6 tabs while looping categories
- Saving Child Terms on front end not setting parent
- How to show terms used only for particular custom post type. Filter creation perpose
- Get category list & taxonomy list from different post type using post id?
- How to get all posts related to a taxonomy?
- how it’s possible to show from a post of a custom post type the taxonomy/terms?
- Keep br tags from stripping
- Custom taxonomy- only output relevant terms
- order taxonomy alphabetical
- 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
- WordPress add taxonomies/terms list as a menu in archive page
- Creating adminable dynamic filtering on custom post type
- Decrement term in for each
- Best way to group posts based on custom post type terms
- Hide Custom Taxonomy title if not associated with another Custom Taxomony
- Dropdown switching subcategories portfolio
- Filter wp_dropdown_categories Per Post Type
- How to pass taxonomy terms to WP_Query along with $args?
- Custom Post Status & Taxonomies
- Get list of CPT posts in *current* post’s taxonomy term
- Fetch posts list from fist CPT taxonomy term and list under 2. CPT
- Prevent repetitive terms in get_the_term_list
- 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
- Get term_id for each instance of custom taxonomy
- List a custom taxonomy’s terms, with links, on the taxonomy page
- taxonomy terms array not working
- install.php Custom Taxonomy Term not being added to custom post
- 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
- show 10 most recent custom post types excluding the one(s) from specific custom taxonomy
- How to Get The Taxonomy Term in Custom Post Type Loop Inside a Wp Query
- Display associated taxonomy child name on single CPT page
- How to manage a bookstore
- Get all terms assigned to a post from different taxonomies
- Issue On Listing Woocommerce Parent Tag List
- Get term link of shared taxonomy between multiple post types
- How to use wp_set_object_terms depending on page ID?
- Add Custom Taxonomy Terms as CSS Classes for CPT Posts in an Elementor Loop Item Template
- Taxonomy Archive URL + Template
- Display posts from Custom Post Type, group by term, arrange term groups and arrange items within groups by menu order
- Is it possible to get_terms by taxonomy AND post_type?
- How to list custom taxonomy terms without the hyperlinks?
- How to Filter the Custom term loop based on dropdown
- Is there a way to edit non-custom term attributes?
- Can’t retrieve custom post type taxonomy term to custom post type editor