I don’t know if you’ve tried this but try adding post_status => inherit
to your query. I’ve found that get_posts
defaults to publish
and therefore will not return any attachments, since their post_status
is always inherit
. The codex page on get_posts
confirms this.
Edit: looking at your query again, you have term
in the tax_query
where it should be terms
: http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters
Related Posts:
- tax_query in get_posts() not working?
- How to organize and cache additional data associated with terms?
- get_terms with posts that have a different taxonomy with term x
- tax_query: What to pass when I want to have all terms?
- Exclude posts which have any term in a certain taxonomy from the query
- How To Query For An Empty Taxonomy Field
- Can I create a tax query to return posts that match two slugs from same taxonomy
- $product->ID in has_term() not working, but manually inputting the ID works, why?
- Can the default “post tags” taxonomy be renamed?
- Custom columns for taxonomy list table
- get a specific taxonomy term name
- get_terms() How many is TOO many?
- How to display child term of current term’s parent taxonomy?
- Sorting custom taxonomy causes menus error
- Is there any difference between post in child term and child & parent terms?
- How to add automatically keyword to taxonomies when a post published, and assign them to the post
- Display Custom Taxonomy in Sidebar in Two Columns
- Create and move terms for taxonomies
- How can I remove links from the function “get term list”?
- Alphabetical order in taxonomy.php
- Get Term names from WP Term Object
- functions to create term and child terms
- base directories / URL
- WordPress REST get all items without a taxonomy assigned
- Getting the parent from the wp_term_taxonomy
- How do I get the current tag out of a taxonomy?
- If search matches taxonomy
- Showing custom taxonomy column in taxonomy category listings immediately after create category
- Custom Field as Custom Taxonomy?
- Order wordpress taxonomy parent terms by their children count
- Return Taxonomy/Term Information with Posts (WP_Query/get_posts)
- Plugin to assign parent category on multiple taxonomy terms
- Pagination on taxonomy archive pages breaks
- How can I increase the length for the taxonomy term slug?
- how to show only last child terms of a taxonomy
- How to Filter custom post type by taxonomy?
- Check for taxonomy archive on search results page
- Use a CPT as a taxonomy
- How to list taxonomy terms in reverse order?
- how to display only the sub category names of the taxonmoy
- Adding tag’s featured image to tag archive
- How do I display the grand child items of a taxonomy term?
- Group Post by Custom Taxonomy 2 under Custom Taxonomy 1
- Taxonomy URL Rewrite
- Ordering Taxonomies / Changing term_id
- Fetch and ACF image field from a custom taxonomy outside category/archive page? [closed]
- How to restrict users in edit post that can just select exists tags? not add new
- Changing the default taxonomy key length
- Adding taxonomy terms based on custom field
- Multi Taxonomies same terms
- Taxonomy Tag Conditionals
- UI for taxonomies & query vars
- Exclude posts with taxonomy term from appearing on home page query
- What does ?cat=2-5-results mean at the end of URLs?
- Display a tag only if there is a description
- Query Custom Post Type by Taxonomy Meta Value
- Return Taxonomy Name for Each Term
- Taxonomy list names with lowercase
- Modify output of wp_dropdown_categories to add term IDs to each option
- How to display only the direct children of a term on a taxonomy page
- Query Custom post type with Taxonomy Custom Field
- tax query between operator like
- Display posts from tagchildren of taxonomy tagparents
- If has_term, load other theme
- archive page sidebar not working
- Bug using wp_insert_term with switch_to_blog
- Get something out from taxonomy
- get_term_by with a variable
- “Menu order” being ignored when querying posts from a parent taxonomy with “include_children” set to true
- Change searching from world level to first letter
- Finding id of taxonomy by name in custom post type
- How to have article URL like example.com/article1 and example.com/foo/article2?
- Unique IDs for Post Types and Taxonomies
- JS POST update data taxonomies
- I want to edit the tags template by adding text that displays all tags from the listed posts
- echo a tax term in loop
- I need posts within a taxonomy category that are tagged “featured” to show up first
- How to manage the links of a new taxonomy
- How to position taxonomy meta box on page
- WP REST API taxonomy is missing on custom post type
- Get taxonomy url, name, post count & image
- How can I get all the posts that are related with a specific taxonomy term?
- Rewrite permalink to include multiple taxonomies
- taxonomy terms are not populating select tag options
- Related Posts by taxonomy using Advance Custom Fields Plugin
- How to Display Child Taxonomy Posts
- Output Taxonomy Title as Part of Result
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- Help me add Taxonomy to byline
- Filter custom taxonomy table
- Add a tag like a post
- How Can I List Categories by Date?
- Advanced AND tax_query in sidebar with 2 taxonomies
- Custom Taxonomy Page redirect 404
- Why is taxonmy-[taxonomyname].php not working?
- tax_query not working properly with get_posts
- Add URL field to wordpress taxonomy
- Using autocomplete with post_tag taxonomy on attachments
- Display taxonomy terms when adding a link in the admin
- Bulk import in custom taxonomy