Please specify where are you using the code above, if in a template file or in a function.
Assuming the code above is for a single post and that you’re trying to retrieve the dormitorio
terms associated with that post you should use get_the_terms()
instead of get_terms()
.
get_terms() Retrieves the terms in a given taxonomy or list of taxonomies
whilst
get_the_terms() Retrieves the terms of the taxonomy that are attached to the post
Related Posts:
- The Difference Between Hierarchical and Non-Hierarchical Taxonomies?
- Attaching taxonomy data to post with wp_insert_post
- Custom taxonomy list page?
- tax_query in get_posts() not working?
- What is wp_insert_term “alias_of” arg for?
- get a specific taxonomy term name
- List Hierarchical Term List with Count with Related Term
- Is there a way to set singular/plural labels for taxonomy term names?
- get_terms() How many is TOO many?
- List taxonomy terms as links
- Sorting custom taxonomy causes menus error
- Can we have same term slug in different taxonomies?
- Is there any difference between post in child term and child & parent terms?
- Add additional data to a specific taxonomy term when used in a post
- Display the number of published posts for each custom taxonomy term?
- Get wordpress taxonomy archive and sort by year
- Search for tags
- Create and move terms for taxonomies
- Display Post by taxonomy and taxonomy child if exist
- Missing term_id and term_taxonomy_id when adding a term using wp_insert_term() function
- How can I remove links from the function “get term list”?
- Alphabetical order in taxonomy.php
- Get Term names from WP Term Object
- functions to create term and child terms
- WordPress REST get all items without a taxonomy assigned
- How do I get the current tag out of a taxonomy?
- I need template for my custom taxonomy term
- Show list of custom taxonomies when another taxonomy is selected
- If search matches taxonomy
- WordPress as thesaurus/dictionnary: what approach?
- Custom taxonomy is crashing Gutenberg
- How to show the category filter that’s shown on the ‘All post’ pages on a custom post type page in the admin area?
- Custom WP Query: force entry for some taxonomy and have others optional
- Using get_posts() with tax_query parameter set isn’t working with attachments
- How to get the top level parent term Advanced Custom Field values in the child terms
- Modify the query method when adding category filtering function to the custom post list
- Allow a Taxonomy Term to be Used Only Once Across All Posts
- need to get postthumnails from a post whithin a category custom post type
- Individual post. Meta_key, taxonomy or post status for separation?
- Count Published & Draft Posts Associated With Each Term
- Taxonomy archive page WP_Query does not return get_the_permalink() or get_permalink() value
- How to show taxonomy image instead of taxonomy name on a list
- get_the_term_list – Return links to edit.php instead of link to taxonomy archive template
- benefits of the table ‘wp_term_taxonomy’
- How to sync to custom taxonomies (tag structure)
- List posts in a category grouped by other categories?
- `get_terms()` with `child_of` and `childless` combined
- is_taxonomy() is not working
- Add text to the end of each list item in wp_list_categories
- echo term name outside the loop, using term slug
- What are these undocumented arguments for register_taxonomy?
- Dynamic filtering of posts with custom taxonomies
- get_term_by seems to be failing
- How to return newly added terms when using wp_set_object_terms
- How to get terms from a custom taxonomies after WordPress 4.5.0
- How to update a taxonomy term for a custom post type with auto incrementing number
- Search Media by taxonomy
- Get Taxonomy name from “registered_taxonomy” hook
- Filtering elements by taxonomy slug
- Echo taxonomy name – second level
- Show only first child in dropdown
- Custom Post Type + Custom Taxonomy = Archive Listing Page Problems
- Taxonomy term archive default loop returns 1 record instead of 8
- Get terms in hierarchical taxonomy
- Taxonomy Checkbox Admin Panel
- Replacing a placeholder term with a session variable value in taxonomy filter
- Loop problem – Taxonomy
- Select query with two and two related taxonomies
- How to relate to 2 taxonomy with category
- Taxonomy Dropdown Question
- WP Search using taxonomy terms
- Customize menu link for taxonomy in WP menu
- Is possible hide hierarchical select dropdown created by jetsmartfilters? (only visual issue)
- How do I converge taxonomy category permalinks into one?
- Taxonomy terms are not checked when edit custom post
- Url leading to archive page, no matter what
- Checking if a product ID has taxonomy term attached not working with has_term
- Can I create a tax query to return posts that match two slugs from same taxonomy
- Taxonomy.php inheriting first post
- I want to edit the tags template by adding text that displays all tags from the listed posts
- Add specific content to a taxonomy results page
- Set the limit of taxonomy per page
- echo a tax term in loop
- I need posts within a taxonomy category that are tagged “featured” to show up first
- How to manage the links of a new taxonomy
- How to position taxonomy meta box on page
- Same page for startpage and archive?
- WP REST API taxonomy is missing on custom post type
- taxonomy terms are not populating select tag options
- how to print post tags [duplicate]
- Filtering posts by taxonomy and meta_value
- What to do with shared terms splitting in WordPress 4.2?
- How to get a query odered by N of matching taxonomies?
- Help me add Taxonomy to byline
- How Can I List Categories by Date?
- Child Terms not Displaying on the Taxonomy Term Admin Screen
- multiple taxonomies in wp_list_categories’ $args
- Why is taxonmy-[taxonomyname].php not working?
- How to orderby Taxonomy Term in a WP Query
- Using autocomplete with post_tag taxonomy on attachments