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
- get_categories for custom post type with a specific custom taxonomy attached
- Order get_terms() By Custom Field
- Could not insert term into the database
- Weird behaviour when adding terms/term_taxonomies programmatically
- How can I get category ID by category name?
- Programmatically create product category and add thumbnail in woocommerce
- How to get next previous category in same taxonomy?
- Use get_term_children to get the sub category of a parent category for the current post
- Update wordpress post terms programatically
- List all custom post type posts from a given category?
- Get a list of Terms for a specific category
- 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?
- Display name of the last child category
- How to get category URL with the slug?
- How do I get a list of all categories that a given user has written blog posts for?
- How to view WordPress’ default category IDs?
- Random taxonomy category list
- Set post categories to include parents when setting child category
- Inserting Category programmatically
- Show Available Taxonomy List with Current Category
- Exclude a category from the_category in the single post page
- Display specific categories by ID
- Why don’t posts show up in my categories on the frontend?
- Flat category URLs but retaining hierarchy?
- Get posts from specific taxonomy term
- How many categories can WordPress handle before performance suffers?
- Getting category URL with hyphens, not spaces
- Targeting Parent Category Pages
- Wacky taxonomy in wordpress
- Include WooCommerce product to all child categories
- Question on using custom structures for categories
- Notice: Trying to get property of non-object in : custom fields category
- How to Link to Most Recent Custom Post of Same Term
- WP REST API not retrieving all categories
- Some categories missing on wp-admin/edit-tags.php?taxonomy=category
- List just subcategory and products of active category page in Woocommerce
- Eliminate word from $term->name
- SQL query joining on taxonomy tables not returning what I would expect
- Style a category from category list
- How to schedule categories?
- Showing HTML if Post is In Certain Taxonomy Term
- Exclude categories by ID
- Copy post taxonomy?
- Post to inherit custom category background image from parent
- How to get posts using category slug in ClassiPress?
- Add properties to term object
- get_object_term_cache duplicate terms after update to wordpress 6
- Disable Category Taxonomy
- Sort categories by custom field in WordPress admin
- How to set acf color field as background color to product category
- How to target all woocommerce categories that don’t have any subcategories in them?
- Replace deprecated get_category_children code with get_terms
- Filtering posts in category by tag URL
- Restrict retrieved terms by category?
- get taxonomy list in a page in the wordpress
- Number of categories slowing down the site
- Image Upload Custom Form Field for Category and Custom Taxonomy
- Get category from slug list
- Add subcategories posts to the counts column at the admin’s categories list
- show only terms from parent category
- How get all media from a posts category by db?
- List Terms by category
- Grouping parent categories into sections
- Taxonomy for custom post type not found
- Category base 404 – fix
- exclude parents from the_terms
- Assign a category by user and customize the edit-tags.php?taxonomy=category page
- Woocommerce custom taxonomy order
- Hook action when create new category [duplicate]
- List the category tree of all the product_cat categories
- How to determ a custom post type url?