SELECT p.ID AS postId,
p.post_name,
p.post_title,
p.post_content,
p.post_excerpt,
p.post_status,
p.post_type,
p.post_author,
p.guid,
p.post_modified_gmt,
(SELECT group_concat(t.name SEPARATOR ', ')
FROM wp_terms t
LEFT JOIN wp_term_taxonomy tt ON t.term_id = tt.term_id
LEFT JOIN wp_term_relationships tr ON tr.term_taxonomy_id = tt.term_taxonomy_id
WHERE tt.taxonomy = 'category' AND p.ID = tr.object_id
) AS category
FROM `wp_posts` AS p
LEFT JOIN `wp_term_relationships` AS tr ON p.ID = tr.object_id
LEFT JOIN `wp_term_taxonomy` AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
WHERE post_type="place" AND post_status="publish" AND tt.term_id = 11
ORDER BY postId DESC
Related Posts:
- Is There a Difference Between Taxonomies and Categories?
- Check if a post is in any child category of a parent category
- How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms
- Control term order on a per-post basis
- How can I select a primary category?
- Does WordPress Offer a Way to Find All of the Categories that Don’t Have Children?
- Add custom taxonomy terms to WordPress menu dynamically & append #slug to url
- Display empty taxonomy terms with get_terms()
- List Terms in Category
- How can i insert term in a specific language of Polylang?
- Why does the argument list_only do on Walker_Category_Checklist::start_el?
- Display Posts Loop for each parent and for each Child
- Is There a Difference Between Taxonomies and Categories?
- get_terms function not returning anything
- Display custom taxonomy attached to the post on post single page
- Get a count of how many times a term or a category is used in posts
- Display sibling categories on category page
- Combining these queries? (Same taxonomy term + same category as post)
- Get WooCommerce product category list in functions.php
- outputting taxonomy hierarchy
- Bulk Change WordPress category Slug
- Display List of Categories Within a Custom Taxonomy
- get_adjacent_post_link excluded_terms ignored
- Why is my post categories not displaying?
- Problem importing categories and sub-categories
- Taxonomy term RestApi data 10 rows limitions
- hide_empty property not working when using get_terms
- Order get_terms() By Custom Field
- How can I add the featured image functionality to a custom taxonomy?
- Share one taxonomy across multiple blogs in 3.0 [duplicate]
- wp_update_nav_menu_item() to insert categories
- Programmatically create product category and add thumbnail in woocommerce
- How to order the get_categories result
- How to get next previous category in same taxonomy?
- Display only deepest category on a single post?
- Get terms that are associated with products from current category
- Wrap a chosen category name with div
- Count argument in get_terms has no effect on ouput/doesn’t work
- orphaned taxonomy terms remove by sql query
- What’s the difference between “parent” and “category_parent” in a WP_Term object?
- Update taxonomy value of post type in query
- How to query posts from specific authors and categories using WP_query?
- Add custom taxonomy under the category title
- How to get category URL with the slug?
- Set post categories to include parents when setting child category
- Display Slug instead of Name
- Inserting Category programmatically
- ACF: Display category name using taxonomy field
- Show Available Taxonomy List with Current Category
- Exclude a category from the_category in the single post page
- Shortcodes not working in category or tag description
- Filtering multiple categories via the URL
- Display specific categories by ID
- SQL to migrate post types to taxonomy
- Drop posts from categories in MySql
- Customize category page for different custom taxonomies
- How many categories can WordPress handle before performance suffers?
- Custom taxonomy template for categories
- Wacky taxonomy in wordpress
- Question on using custom structures for categories
- How to modify the output of wp_terms_checklist when used within the built-in category metabox on edit posts?
- List just subcategory and products of active category page in Woocommerce
- SQL query joining on taxonomy tables not returning what I would expect
- More efficient way to list posts by category [duplicate]
- How to schedule categories?
- Exclude categories by ID
- Using in ‘category_name’ in ‘$query->set();’?
- Copy post taxonomy?
- Setting selected term_id with wp_dropdown_categories?
- creating categories programmatically
- Post to inherit custom category background image from parent
- Update custom category fields front-end
- Assign a list of categories with a parent category
- WP-CLI Add category as menu item main-menu
- get_object_term_cache duplicate terms after update to wordpress 6
- Category post count is not correct
- How do I edit the terms output args or array data?
- How can i change sort category view starting from child then parent, not alphabetically
- Replace deprecated get_category_children code with get_terms
- Filtering posts in category by tag URL
- How to remove parent category from child category url using wordpress rewrite rule?
- Bulk assign posts to a category using SQL (MySQL)
- Restrict retrieved terms by category?
- How to modify custom category field from front end?
- Image Upload Custom Form Field for Category and Custom Taxonomy
- Get category from slug list
- Filter custom taxonomy posts via AJAX
- Why use hierarchical taxonomies instead of many custom taxonomies?
- show only terms from parent category
- How get all media from a posts category by db?
- Grouping parent categories into sections
- Match two taxonomies to display a specific content
- exclude parents from the_terms
- Return selected categories only in custom page meta box?
- Chained drop-down menu for custom taxonomy using chained.js
- Display only one level subcategory in wordpress
- Woocommerce custom taxonomy order
- get_category_children/ the new get_term_children not work
- Images as Categories
- Quick Edit on taxonomy names results in error