Your tax query is incorrect, field
should be the field you want to query on: term_id
, name
, or slug
–
$posts_array = get_posts(
array(
'posts_per_page' => -1,
'post_type' => 'fabric_building',
'tax_query' => array(
array(
'taxonomy' => 'fabric_building_types',
'field' => 'term_id',
'terms' => $cat->term_id,
)
)
)
);
Related Posts:
- Get Posts Under Custom Taxonomy
- How do I get the slug of a custom taxonomy category of a post?
- Get posts by name and taxonomy term
- How to get post count including nested categories
- How to show related posts by category
- Different post sort order within different categories
- Displaying the category name of a custom post type
- Show WordPress Custom Taxonomy Items Based On a Selected Item From Another Custom Taxonomy
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- Query only Posts from Both of Two Category?
- Show Custom Taxonomy Categories, Listing of Posts, and Single Post via AJAX
- is there a better way of combining this?
- Adding Multiple Values to a Post Meta Key
- Posts are not showing up on particular category
- How can I add a meta-box to the posts editor containing all items of a custom taxonomy as checkbox?
- Get Posts via Taxonomy Term Name with Space
- How to set up multiple taxonomies for groups of posts
- Get mixed category random posts
- Choose whether to automatically add a taxonomy with the same name as the post
- Posts list in custom taxonomy
- How to Restrict Previous & Next Post Link to Posts of Same Category?
- Get attachments for posts that belongs to a specific category
- Prepending %category% onto default posts fails
- How can I setup a relationship using categories in WordPress?
- How can I hide tags on a child-category page, if that tag has not been used?
- Display posts of specific category term
- How to create a “latest news” page showing a list of posts from blog category
- WordPress bulk category select when publishing post
- How to show a custom taxonomy in the theme?
- How to get post with slug and exclude categories
- How to get posts by category and by choosing a taxonomy term?
- Unable to differentiate between two categories under custom post type on single.php
- Geting error in post and category [closed]
- How to add content above footer in posts from specific category
- How to associate a custom taxonomy to a post multiple times
- Create/Set Category as Title of Post
- How to manage a dynamic multi-level page hierearchy system?
- Page with Category Returning 1
- Customizing URL slugs of Custom Post Type and Taxonomy make posts/pages 404
- How to Get Position of a Post from a category and tag
- Custom Taxonomy From Database
- Retrieve latest post by multiple categories with ID
- Multiple loops on a Search result page?
- Taxonomy Category category.php not working
- wordpress show category link instead of post link [closed]
- View post with specific category id and name which I selected in the backend (drop-down option)
- How to show related posts by detecting the current category?
- How to display related posts from same category?
- How to add category to: ‘wp-admin/post-new.php’?
- Including categories in search results
- Use category base slug in posts’ permalink
- get_categories for custom post type with a specific custom taxonomy attached
- Count how many posts in category
- get_children() Not Working with orderby Parameter
- Custom Single Post By Category
- How to get all posts related to particular category name?
- get all posts ID from a category
- Setting Custom Sort Order of Posts within a Category
- How can I add the featured image functionality to a custom taxonomy?
- How to get the number of posts in a selected category?
- MySQL Query to Retrieve Category from wp_posts
- Different number of posts in each category
- Elegant way to include only published posts with get_objects_in_term()?
- Combine two taxonomies in a hierarchical tree
- Display all posts from specific categories on a page
- Display the latest post from a category in a page
- How can I list all the categories under a Custom Post Type (taxonomy)?
- How to show list of posts by author and category?
- get comments and get posts in loop
- Category checkbox list tree changes when editing a post
- How to add metabox for post of specific category
- Convert custom fields to post categories
- How to list all categories and tags in a page?
- How can I select a primary category?
- How are terms connected with posts in database?
- How to know if get_posts() failed?
- Manipulate post category after time
- Show related posts by category but ignore one category
- How to sort posts by last name (2nd word) on ONE category only?
- How to disable Uncategorized category URL?
- Add role that restricts user to post in specific category
- How to get Category Id from Post Id ?
- How to display posts by current user/author in a custom page template?
- Count posts in category including child categories
- Query posts from current year
- How to make custom taxonomy check boxes like ‘Categories’
- Getting Position of a post in a category
- Display only posts from a specific parent category
- How to control which category will be picked for the slug of a post?
- Categories box not showing on post edit pages
- How to get previous 10 days post from a specific date – WP Query
- get_the_term_list by hierarchy order
- How to change the layout and styling of posts according to their category in WordPress?
- How to create non-unique sub-category slugs?
- Convert IPTC keywords to blog post tags
- How to get next previous category in same taxonomy?
- Show the title of the latest post by author
- List only child categories a post is in, of a specific parent category
- Add default content to post (for specific category)
- Setting pagination for images attached to a post