The issue is with the post_status
argument of the default query generated for your taxonomy terms. If you change the status via the pre_get_posts
action to inherit
or any
, you can get attachments to show up.
however– is this the correct way to do this- I honestly don’t know. This will show attachments to posts that are drafts, and maybe private. I haven’t tested it thoroughly so beware.
Perhaps someone else can chime in with more knowledge and info.
function wpa82573_show_tax_attachments( $query ) {
if ( $query->is_tax('imagetags') && $query->is_main_query() ) {
$query->set( 'post_status', 'inherit' );
}
}
add_action( 'pre_get_posts', 'wpa82573_show_tax_attachments' );
Related Posts:
- Resize $term attachment using url
- How to use taxonomies on attachments with the new Media Library?
- How to add images to taxonomies?
- Adding Category/Tag/Taxonomy Support to Images/Media
- Bulk term assignment for attachment taxonomies
- Custom Taxonomy Images with Advanced Custom Fields
- Advanced custom fields – taxonomy terms images [closed]
- Display an image instead of tag name?
- How to display custom taxonomy images on index.php?
- Meta query for a custom taxonomy on attachment
- Taxonomies image
- How do I modify the “Insert Media” lightbox in the admin to only show media items from a category?
- How to filter a post in the Tag Cloud widget, using tags of a media library image attached to the post?
- Get all attachments by custom taxonomy – term
- Website loading slowly – Advanced Custom Fields images
- Set term on an attachment using wp_set_object_terms and want to display the full term text but it’s showing a slug instead
- Replace taxonomy term with an image in a custom loop
- Featured Images for Tags?
- How can I get Taxonomy Images to work with ‘orderby’ argument?
- Query all images with certain tag in media library using visual portfolio plugin
- Add image to taxonomy and output to homepage
- Include attachments with a custom taxonomy in search
- Get taxonomy image for Toolset custom taxonomy through Toolset Views Shortcode
- Using wp_query is it possible to orderby taxonomy?
- How To Retrieve An Image Attachment’s Alt Text?
- How to get image title/alt attribute?
- “tax_query” parameter not working with WP_Query
- How do I exclude a custom taxonomy from the post loop
- get_posts assigned to a specific custom taxonomy term, and not the term’s children
- How can I get only parent terms?
- Programmatically adding images to media library
- How to modify a taxonomy that’s already registered
- Retrieve posts by term id custom query
- Change order of Custom Taxonomy List
- Get the the top-level parent of a custom taxonomy term
- get_the_term_list without links in 3.1
- Inserting terms in an Hierarchical Taxonomy
- Creating an Image-Centric Custom Post Type?
- get_terms – only top level
- How does WP media uploader create the 3 different sized images, and how can I duplicate it
- Programmatically get images by URL and save in uploads folder
- Custom taxonomy terms not showing as list Gutenberg Editor
- how to get original image using wp_get_attachment_image_src
- Altering the appearance of custom taxonomy inputs
- Can I attach image to post without adding it to post?
- How to only list the child terms of a taxonomy and not their parents?
- Get the first image from post content (eg.: hotlinked images)
- Get term SLUG by term ID
- Is ACF being a honey trap? [closed]
- Get term name from term ID?
- Check if Current Category has Children
- Hierarchical taxonomy UI
- WordPress taxonomy radio buttons
- Remove Dimension from wp_get_attachment_image
- How to prevent new terms being added to a custom taxonomy?
- Custom taxonomy, get_the_terms, listing in order of parent > child
- How to remove the tag cloud from custom taxonomy admin page?
- custom taxonomy and pages rewrite slug conflict gives 404
- Inserting a term into a custom taxonomy
- Count posts in custom taxonomy
- Read-only taxonomy (user can assign term but can’t create or edit existing terms)
- Remove taxonomy base or term from url
- Can you add the visual editor to the description field for custom taxonomies?
- Add default WordPress tag meta box to User Profile
- Custom Taxonomy Endpoint Pagination using paginate_links()
- How do I get the top-level terms in a custom taxonomy?
- Check if a post has any term in this custom taxonomy?
- Query Custom Post by Taxonomy Category
- getting attachement images src and add classes
- Custom columns on edit-tags.php main page
- Loop through custom taxonomies and display posts
- remove links from images using functions.php
- Uploaded images don’t show in Media Library if there are special characters in IPTC Keywords
- How do I add a custom taxonomy as an option for menus under “Appearance” > “Menus”
- custom post type taxonomy “tag” archive : no post found
- How to get WooCommerce Product Category Link by ID?
- Order get_terms using a Custom Field
- Add custom taxonomy fields when creating a new taxonomy
- get_term_children for immediate children only (not grandchildren)
- Using pre_get_posts to rewrite search query to display posts from multiple taxonomies
- Custom taxonomies capabilities
- Contact Form 7 – Populate Select List With Taxonomy [closed]
- Can’t get a custom template taxonomy page to display
- Query users by custom taxonomy and user role
- Display category posts grouped by taxonomy
- WP REST API no longer supports filter param, so how do I get posts in a custom taxonomy?
- Custom Taxonomy and Tax_Query
- Custom Taxonomy Archive Page
- How to display custom taxonomies in posts?
- Disable image attachment links
- Get taxonomy names by post id
- Include and Exclude Taxonomies From Archives & Feeds Using ‘pre_get_posts’
- wp_get_attachment_image_src and server path
- How to assign multiple roles for capabilities array withini register_taxonomy function?
- Filtering custom taxonomies
- Can custom taxonomies be displayed inside of a custom meta box?
- Determine Term depth
- Exclude Specific Term from Search
- How to get current term in my custom taxonomy in WordPress?
- WordPress database error: [Not unique table/alias: ‘wp_postmeta’]