<?php
	//Making attachment taxonomies work in WP templates (taxonomy-{customtax}.php)
	function show_tax_attachments( $query ) {
		if ( $query->is_tax('att_tax') && $query->is_main_query() ) {
			$query->set( 'post_status', 'inherit' );
		}
		return;
	}
	add_action( 'pre_get_posts', 'show_tax_attachments' );
?>