That page isn’t a 404, it’s returning a status code 200. The title and body tags also indicate that the page is loading just fine.
A couple of things- there is no taxonomy
argument. It would be redundant anyway, since the query already contains the queried taxonomy and term pulled from the parsed URL.
Your possible issue is outlined in this note from the WP_Query
Codex page under type
parameters:
'attachment'
– an attachment. Whilst the defaultWP_Query
post_status
is'publish'
, attachments have a defaultpost_status
of'inherit'
. This means no attachments will be returned unless you also explicitly setpost_status
to'inherit'
or'any'
.
Related Posts:
- List WordPress Post and Related Attachments outside of a post page
- Get all image from single page using this query
- search through post-type attachments titles
- Query all posts and not repeat the same tag
- get posts by tag to showing in a widget
- Customizing the_tags output?
- WordPress SQL query to tag all posts containing a specific word on title
- How to create an overview of posts with the same tag?
- Sort query_terms_list for post_tags alphabetically
- How to get all images in Media Gallery with pagination?
- Not getting input from get_query_var
- Exclude Posts from a Widget
- Show certain number of post from tags
- SQL Query : how copy all tags of post into their post content in wordpress by sql query
- Can I create my own query in wordpress with traditional methods?
- Add multiple value to a query variable in WordPress
- Compare two numeric custom fields
- wp_dropdown_categories with multiple select
- How to tune search argument in WP_Query to show only exactly the same results?
- Custom query filter not working on woocommerce category page
- How to delete a transient on post/page publish?
- Order posts by tags count?
- How to get my loop to pull posts into three columns
- Custom $wpdb Query for Custom Post Type by Category
- Can’t pass table to $wpdb->prepare
- WordPress creating excessive joins on meta_query with search
- How to display liked posts of current user in wordpress?
- Date query year and month OR just year
- Are database queries created using WordPress filters protected from SQL injection?
- get post id using the $query_vars variable
- attachments with tags and get_posts
- Category archive page – loop through posts of certain tag (with pagination) – pre_get_posts
- Is there a conditional tag for latest post or do i need a query?
- get_posts() loop returns the same the_title() for each post
- Huge amount of queries on my site
- How to check current user in meta value array in WP_Query meta_query
- How select a specific query when setting offset?
- Change media attachment author via mysql query
- How to display related posts by same publish date?
- Temporarily storing main search result
- Help with MySQL to $WPDB query
- sql select query in wordpress ‘page’ [closed]
- wpdb->term_taxonomy count posts from both published and private posts?
- How to get related tags based on a category?
- Group custom post listing in admin section
- problem with sql query in wordpress plugin
- Attempt to improve WP search, can someone check my SQL query?
- WordPress Query orderby title with UTF8 string in title
- Searching With Apostrophe
- List author’s posts with SQL
- Where is the query in wp-login.php
- Order posts by recent comments
- query if page has not child
- get_posts showing only 5 posts. (nopaging and posts_per_page -1 not working)
- Order by title – but now built in wordpress func, sort the_title
- Display posts between two particular dates
- pre saved posts query from db options table
- Order posts by date, but also give priority for a specific term
- $post->ID not working in combination with a custom query
- Custom Query returns array, but I can’t see it’s elements
- how to insert missing tags into the posts through mySQL?
- How to insert Collate into WordPress search query?
- Combine “Exclude” Query in functions.php
- How to write update query in WordPress to expire transients
- Optimize slow SQL query for multiple meta values
- prepare function sql safe method
- Get previous posts list
- Show last 12 uploaded images on home page, but only from posts
- Wrap/close ‘query’ for a first-letter ordered listing of posts
- wpdb query with dynamic column name?
- How do you display the number of a post in a query?
- How to return count of custom post type posts with a specific custom field value via $wpdb?
- How can I get the name of term post meta value which equals term id
- Help with Related Posts Function
- Trying to use WP_Query to return post with and without meta values
- Show Posts via cat+cat in URL that are in both Categories doesn’t work
- get products by custom date variable
- Filter products on category AND tag
- How to delete all images from code in all post_content
- How to sort by two meta keys in admin area?
- Restrict WordPress search to a single ACF field
- wp query multiple values > display a specific value first
- PHP Fatal error: Uncaught Error: Call to a member function insert() on null
- SQL query to delete users with multiple meta keys and comments
- Nested select statements not working
- Pagination adds search query (again)
- Query not returning child posts for any parent post ID
- Use $wpdb->get_results with filter based on array
- Add Hook for clearing transient when post is added
- Conditional tag for attachment posts
- Displaying popular posts
- Find all posts via SQL beginning with A of type B
- Show links to child pages on both parent AND child pages
- Modify Global Posts Plugin
- SQL: Search query to get attachments only of those parents which are published
- How to reference same column name but different table in custom db query
- Retrieving custom field array value through db query
- How to add multiple values with add_query_arg?
- Query filter on custom post by current author in post widget for elementor query id
- Querying Posts from ACF Repeater Subfield Select Value