WP_Query
only returns WP_Post
objects for the results. To get the taxonomy terms for each post you need to use get_the_terms( $post, 'recipe_categories' );
for each post.
This is because WP_Post
represents each row of wp_posts
, which does not include taxonomy information. The links between posts and terms is in the wp_term_relationships
table.
Related Posts:
- How to group posts and get a mixed posts and groups view?
- ACF – Retrieve custom taxonomy from a relationship field
- Display Custom Field or Custom Taxonomy in front page /post/product
- Getting custom taxonomy from custom post type
- Taxonomy: Why ‘with_front’ => false DOES NOT WORK?
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- Assign posts to taxonomy terms instead of the taxonomy terms to posts?
- Exclude from search all custom posts which are NOT in a taxonomy term
- Custom SQL Query on Custom Post Type. Order by Taxonomy?
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- get terms that have post with custom post type between 2 values
- Custom taxonomy template not working with simple loop. Multiple CPT using the same taxonomy
- Show ACF field from custom taxonomy and display on the single template
- Building an Advanced Search (text, tags, category, custom fields) – Getting the wrong SQL query
- Linking three taxonomies with ACF
- Paginated Taxonomy Term Archive including one post per term
- Get Custom Field Values by Another Custom Field in WordPress
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- Create 3 Level Relations with ACF and WordPress
- $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
- get_posts of Custom Post Type AND Custom Taxonomy
- Retrieve value of a category’s custom field
- Get posts by querying taxonomy and certain terms of the taxonomy?
- Custom post type templating problem
- Custom Post Type Taxonomy Filters
- Custom Taxonomy terms aren’t getting referenced or saved in Quick Edit or Bulk Edit, only on Single product page?
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- How to conditionally redirect to the post from a taxonomy page?
- Query Custom Post Type Taxonomy term with multiple parameters
- Lists custom taxonomy terms that has specific custom field value assigned to the term (not post)
- How to list tags from custom post type attachments?
- How to get_term_meta on single custom post?
- How to define the template for custom posts?
- I have custom post type with custom taxonomy. But not found the taxonomy page..
- Get A Custom Field From A Custom Taxonomy Of A Custom Post Type [closed]
- How to List Custom Post Type Titles Based on Theirs Taxonomy Terms Inside a Nested Loop
- Custom Post type Query by Taxonomy
- Single.php for Custom Post Type > Taxonomy > Term
- How to display posttypes and taxonomy in standard posts, not in a separate label?
- Custom front-end form for adding post – Category problem
- Create loop from selected terms in ACF taxonomy field
- Sort custom posts by date and then by taxonomy
- If ACF Post Object post has custom taxonomy term…
- Some posts not displaying by taxonomy term
- Taxonomy shows up twice on Custom Post Type
- Permalink URL connection between two custom types
- How to display custom post type pagination buttons when processing AJAX request
- Display custom tax in “while” loop
- Showing taxonomies with terms that are attached to custom post
- Getting all custom post taxonomies and exhibiting only part of them
- Error get_posts with Custom Taxonomy and OR relation
- Best way to have one product in both rental and sale parent category
- Get list of CPT posts in *current* post’s taxonomy term
- How to query posts by meta keys AND under specific category?
- tax_query showing no results
- Linking custom taxonomies and posts
- Storing/querying custom date data
- How to query the content of a specific custom post type?
- Advanced Custom Fields: query posts filtered by multiple field values
- ACF Relationship: Group posts by parent category term, then child [closed]
- Custom taxonomy meta fields
- Custom Sort Order for Custom Post Type Taxonomy
- How to build a complex page structure
- How to get_queried_object on multiple objects?
- Count number of posts which exist in 2 taxonomies?
- How to customize admin posts based on the user who is logged in
- Custom taxonomy template for multiple custom post types
- Add/Remove current_page_parent class
- Use different taxonomies in different custom post types’ permalinks?
- Help need making decision. Ads rotating site on wordpress
- Categories of custom taxonomy don’t show any posts
- Can a Custom Taxonomy be named “category” like normal Posts?
- How to use terms from the same custom taxonomy in different roles in a custom post type?
- How to have the same url structure for both a CPT and a Taxonomy?
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- limit value taxonomy based on previous taxonomy value wordpress
- Deleting taxonomy terms and relationships on a custom post_type when a user is deleted
- How can I get this request to use the Custom Post Type page template instead?
- Include custom taxonomy term in search
- custom post type and custom taxonomy
- Get custom post type categories to show up in menus
- Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
- How to loop through custom taxonomies and sub taxonomies and display posts?
- Building a Portfolio and need some direction
- Query Custom Post Type by Taxonomy
- How do I disable the built-in editor and automatically configure the properties of new pages?
- How would i insert a value of custom field from Advaced Custom Field into shortcode generated by Gravity Forms [closed]
- Auto generate excerpt from ACF field on a CPT that does not support excerpt or content
- Combine multiple separate lists into one
- Automatically convert standard posts with custom fields to custom post types
- Post Custom & Taxonomy 404 error
- Custom Post Type tag taxonomy “Page Not Found”
- Remove custom post type slug but keep related category taxonomy permalink
- page not found for example.com/custom-post-name
- Custom post type and custom taxonomies display
- Adding rewrite rules to Custom Post-type mixed with Taxonomy
- Inserting two categories
- How to manage a bookstore
- selecting custom post types and taxonomies for hub page listing blocks