Try this one in your theme custom page or debugging page:
<?php
$args = array(
'post_type' => 'offer',
'posts_per_page' => -1 //show all posts
);
$loop = new WP_Query($args);
if($loop->have_posts()){
while($loop->have_posts()){
$loop->the_post();
$id = get_the_ID();
$tax = get_the_terms($id, 'hotel');
print_r($tax);
}//endwhile
wp_reset_postdata();
}//endif
Related Posts:
- How do I append multiple taxonomies to the URL?
- How to completely disable a taxonomy archive on the frontend?
- Query Multiple Custom Post Types & Exclude a Taxonomy Term
- Set a Default CPT taxonomy by taxonomy id
- How to Use A Custom Post Type as Taxonomy for Another Custom Post Type
- Sort by Custom Post Type (Multiple Loop)
- How to get all taxonomies of a post type?
- Saving Taxonomy Terms
- Get Posts by Custom Post Type ,Taxonomy, and Term
- Custom Taxonomy as checkbox or dropdown
- Taxonomy: Why ‘with_front’ => false DOES NOT WORK?
- How to Add Custom Taxonomy To Woocommerce Plugin
- Custom Taxonomy as Dropdown in admin
- Creating “static” taxonomies to choose from, inside custom post type?
- Custom Taxonomy’s Label to change the text appearing in Appearance > Menu
- How to limit the number of terms (terms acts like categories)
- How can I list all the categories under a Custom Post Type (taxonomy)?
- Custom taxonomy not showing up when adding a new custom post type
- How do I list custom taxonomy terms without the links?
- How to list custom taxonomy categories?
- Custom Taxonomy with Custom Post Type Finds No Posts
- Custom Taxonomy Template Post List with Sort Order
- wp_insert_term doesn’t work with custom post type’s taxonomy
- Get custom post type by category in a page template
- Associating an “author” with a custom taxonomy
- How to list all categories and tags in a page?
- register_taxonomy with multiple object type and update_count_callback
- Redirect after deleting post and keep track of pagination
- Retrieve single term slug
- Taxonomy archives based on Custom Post Type
- TV Show database – Best way for structuring it?
- Create an archive page for custom taxonomies
- Get the ‘slug’ of a custom taxonomy
- Correct way to use a form to to filter custom posts by taxonomy terms?
- Custom Metabox with Taxonomy Dropdown – Saving Issue
- Showing current taxonomy terms
- How to show term-specific post list, without posts associated with child terms?
- Custom Post Type with Custom Title
- How to get the parent’s taxonomy?
- Query multiple taxonomy in Custom Post Type
- automatically create taxonomy with same name as post title
- Query posts by custom post type and custom taxonomy
- Custom Taxonomy conditionals
- Include custom post type in “all posts”
- How do I list terms of a custom taxonomy at i.e. domain.com/brands/
- wp_insert_post custom taxonomy
- Custom Post Type: How to display all of same taxonomy?
- Taxonomy-{taxnonomy}.php is not working
- Remove POST_TYPE from custom post type permalink
- Display taxonomy term only if there’s a value
- Remove “-2” from a Toolset Types URL with the same post name
- Custom Taxonomy and tax_query Issue?
- Get list of terms of current taxonomy archive for another taxonomy
- Get all taxonomies for all post types
- Custom post type taxonomy template
- Is slug “type” reserved and can’t be used in taxonomy rewrite?
- Associate Taxonomies Across Post Types
- Use the_taxonomies() to create a simple list
- How do I add a custom button to my “edit” list? ( edit.php?post_type= ) beside “Add New”
- After deleting a post are terms, and custom meta deleted?
- Listing taxonomies from custom post type
- Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?
- Best practice for adding posts in bulk
- WP 3.1 getting tax_query to work in query_posts()
- Taxonomy Templates
- How to List Thumbnails based on Custom Categories
- Programmatically adding posts
- Keep main articles and author blogs seprerate, News / Magazine like site
- Custom Post Type and Taxonomy combination
- Why is my custom loop not filtering correctly nor paginating?
- Custom post types with custom directories
- Show Post Count of a Category
- removing custom tax & CPT slug, adding taxonomy term in front of custom type
- Custom Taxonomy Creates Unwanted Integer Terms on Post Save
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Get the taxonomy value in the post loop inside the archive page
- Filter taxonomy by CPT
- How to show related posts of category on post within custom posttype
- Auto update publish date of CPT Post if default post custom field value match to cpt post CF Value
- How to show Custom Post Types under Taxonomy in a new WordPress page template?
- Why are custom taxonomies only appearing on the edit page of one of these types, but not the other?
- wp_set_object_terms creates taxonomies but does not add custom posts to it
- Error 404 change permalink term custom term taxonomy
- Define multiple prefixes for custom post type
- custom post type and user post count shortcode
- Changing CPT permalink
- How to order taxonomy terms by most recent post?
- I have a random letter appearing before my content. Where to start looking for the cause?
- Cannot view Custom Post Type no matter what I try
- Custom taxonomy returns 404 even with saving permalinks
- Create custom post type categories
- How to add CSS class field in Custom Taxonomy?
- WP_Query for custom taxonomies showing posts from non-specified terms?
- Taxonomies are not showing in the category dropdown
- Change custom post taxonomy values from front-end
- Display 3 level taxonomies
- Get all posts for custom taxonomy term
- Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post
- List posts that have the current url taxonomy
- Listing all custom posts having a specific taxonomy whatever the terms