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)
- Saving Taxonomy Terms
- Get Posts by Custom Post Type ,Taxonomy, and Term
- 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)?
- Redirect after deleting post and keep track of pagination
- Taxonomy archives based on Custom Post Type
- Get the ‘slug’ of a custom taxonomy
- Custom Metabox with Taxonomy Dropdown – Saving Issue
- Custom Taxonomy conditionals
- Include custom post type in “all posts”
- Get all taxonomies for all post types
- Is slug “type” reserved and can’t be used in taxonomy rewrite?
- How do I add a custom button to my “edit” list? ( edit.php?post_type= ) beside “Add New”
- WP 3.1 getting tax_query to work in query_posts()
- How to List Thumbnails based on Custom Categories
- Custom Taxonomy Creates Unwanted Integer Terms on Post Save
- Custom Taxonomy Not Showing in Menu
- Set object terms not working on plugin activation
- Weird problem happening with custom taxonmy when creating/updating posts
- How to Get Current Custom Post Type Selected Taxonomy Term (Not All Terms)
- Query Multiple Taxominies Across Multiple Post type’s
- How to add a custom taxonomy to show up in a custom post type menu?
- A question on creating filters for custom posts using taxonomy
- Conditional Query of Custom Post Type and custom taxonomy
- Custom Taxonomy back-end customizations
- Taxonomy custom post type URL
- How do I move/order posts with a tag to the end?
- WordPress sort search results by custom order
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- How to start a new post with custom Taxonomies already set?
- How do I display the taxonomy for a custom post type in an array
- How to conditionally redirect to the post from a taxonomy page?
- Suggested Post and Taxonomy structure
- How to get list of taxonomy slugs ordered parents>childs?
- How do I share categories across multiple post types?
- Migrating a taxonomy’s tags to the native category
- Multiple tag cloud filtering
- Get url.com/post_type/taxonomy/term work!
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- custom post type vs. conditionally displaying meta boxes for specific terms?
- Custom select query for taxonomies that have posts categorized in another taxonomy
- How to add and clear custom post types and taxonomies in a plugin? Considerations for existing data
- Hide meta box for everything BUT a certain custom post type
- How can I create an automatic drop down menu with my tags?
- Dynamically insert code to custom post type loop
- Get taxonomy singular name instead of taxonomy slug inside $taxonomy query
- Custom taxonomy template list not working (404)
- Use the custom post type archive for taxonomies?
- Query custom post types & Taxonomies and list them in a table on a page
- Taxonomy template page not working
- Display Custom Post Types Glossary
- Creating custom post type posts and associating them with a post from another custom post type
- How should I structure complex content hierarchies?
- Get posts by category name
- Convert Custom Table Data Based Plugin To Be Searchable
- Problems making shortcode with custom post types and taxonomy
- Custom Post taxonomy template
- Writing a custom Glossary plugin
- 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?
- custom post type and user post count shortcode
- Cannot view Custom Post Type no matter what I try
- 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
- Insert custom taxonomy into category query
- % encoded URL giving 404 error in WordPress
- CPT: multiple loops with different terms
- If custom taxonomy exist on post?
- How to get all posts assigned to a taxonomy term only?
- Facing some Issues on Two Parts Custom Post Type Taxonomy Names
- I want to create an archive and single page for a custom taxonomy for a custom post type
- Taxonomy’s title
- Display all posts from single taxonomy term
- How to show post which has the specific taxonomy terms?
- WordPress query posts by custom post type not workng
- WordPress add taxonomies/terms list as a menu in archive page
- WP_Query for CPT with filter by another WP_Query
- Custom post type post taxonomies
- insert a taxonomy for a custom post type
- Custom Taxonomy Showing in WP Menu
- Issue on Adding Taxonomy to Custom Post Type Using Function
- Add Excerpt On Quicksand Plugin
- How to apply order on custom taxonomy and custom meta key on custom post type
- List custom taxonomy terms
- Query multiple post of which one by taxonomy
- Display associated taxonomy child name on single CPT page
- Issue On Listing Woocommerce Parent Tag List
- Same slug for Custom Taxonomy archive and CPT archive – Rewrite rule not working
- Make term slugs of custom taxonomy available in WP REST API for custom post type?