Title: openwp3's Replies | WordPress.org

---

# openwp3

  [  ](https://wordpress.org/support/users/openwp3/)

 *   [Profile](https://wordpress.org/support/users/openwp3/)
 *   [Topics Started](https://wordpress.org/support/users/openwp3/topics/)
 *   [Replies Created](https://wordpress.org/support/users/openwp3/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/openwp3/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/openwp3/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/openwp3/engagements/)
 *   [Favorites](https://wordpress.org/support/users/openwp3/favorites/)

 Search replies:

## Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [posts_where filters](https://wordpress.org/support/topic/posts_where-filters/)
 *  Thread Starter [openwp3](https://wordpress.org/support/users/openwp3/)
 * (@openwp3)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/posts_where-filters/#post-3626276)
 * Firgured out on my own:
 * `return $where .= " AND {$wpdb->posts}.post_status != 'private' AND {$wpdb->posts}.
   post_status != 'trash' ";`
 * Hope it helps someone else.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Got pre_get_posts to work for attachment display but now drafts showing too](https://wordpress.org/support/topic/got-pre_get_posts-to-work-for-attachment-display-but-now-drafts-showing-too/)
 *  Thread Starter [openwp3](https://wordpress.org/support/users/openwp3/)
 * (@openwp3)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/got-pre_get_posts-to-work-for-attachment-display-but-now-drafts-showing-too/#post-3617285)
 * No answers so closing!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Got pre_get_posts to work for attachment display but now drafts showing too](https://wordpress.org/support/topic/got-pre_get_posts-to-work-for-attachment-display-but-now-drafts-showing-too/)
 *  Thread Starter [openwp3](https://wordpress.org/support/users/openwp3/)
 * (@openwp3)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/got-pre_get_posts-to-work-for-attachment-display-but-now-drafts-showing-too/#post-3617162)
 * I updated the code to be cleaner. Here’s what I have now:
 *     ```
       function custom_query( $query ) {
   
       	if ( ! is_admin() && $query->is_main_query() && is_category() || is_tag() ) {
   
       		$query->set('post_type', array( 'post', 'attachment' ) );
   
       			if( is_attachment() ) {
       				$postype = 'inherited';
       			} else {
       				$postype = 'published';
       			}
       	$query->set('post_status', $postype );
       	}
       	return $query;
       }
       add_filter('pre_get_posts', 'custom_query', 1);
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How does WordPress check for updated taxonomy SLUGS?](https://wordpress.org/support/topic/how-does-wordpress-check-for-updated-taxonomy-slugs/)
 *  Thread Starter [openwp3](https://wordpress.org/support/users/openwp3/)
 * (@openwp3)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/how-does-wordpress-check-for-updated-taxonomy-slugs/#post-3609079)
 * Ok, I decided to register an existing Taxonomy to attachments:
 * `register_taxonomy_for_object_type( 'category', 'attachment' );`
 * I believe the issue I was having may have been because of the naming scheme I
   choose for the custom taxonomy. The slug was very unique, but the word “Category”
   was included in the full display name, so I think WordPress was getting confused
   when I added terms/edited slugs.
 * This seems a much better solution anyway.
 * Hope it helps someone else out.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How does WordPress check for updated taxonomy SLUGS?](https://wordpress.org/support/topic/how-does-wordpress-check-for-updated-taxonomy-slugs/)
 *  Thread Starter [openwp3](https://wordpress.org/support/users/openwp3/)
 * (@openwp3)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/how-does-wordpress-check-for-updated-taxonomy-slugs/#post-3609065)
 * Yes I am. I created a custom taxonomy and for some reason, when the SLUG changes,
   posts won’t display.
 * But I was just reading about a possible alternative way of doing this. The custom
   taxonomy is for attachments, and read how about how, in the newer version of 
   WordPress, it’s easier to connect already registered Taxonomies (i.e. Categories),
   to already registered Post Types (Attachments).
 * Only issue then would be how to use a different template file for archives display
   when is_attachment?
 * Any idea how I can use a template file other than: category.php for any term 
   when is_attachment?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [another 404 on page 2 issue](https://wordpress.org/support/topic/another-404-on-page-2-issue/)
 *  [openwp3](https://wordpress.org/support/users/openwp3/)
 * (@openwp3)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/another-404-on-page-2-issue/#post-3590033)
 * I’m having a very similar issue with WP_Query for a custom taxonomy. Unfortunately
   received no responses so I closed my topic, but here are some links that have
   been helpful (although haven’t resolved my issue yet):
 * [http://wordpress.stackexchange.com/questions/16353/custom-taxonomy-not-working-with-posts-per-page-in-new-wp-query-pagination-prob?rq=1](http://wordpress.stackexchange.com/questions/16353/custom-taxonomy-not-working-with-posts-per-page-in-new-wp-query-pagination-prob?rq=1)
 * This person seems to have worked it out by adding rewrite rules:
 * [http://wordpress.stackexchange.com/questions/26673/getting-404-on-taxonomy-page](http://wordpress.stackexchange.com/questions/26673/getting-404-on-taxonomy-page)
 * Hope this helps you in some way.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [404 on search pagination, but not paginated taxonomy?](https://wordpress.org/support/topic/404-on-search-pagination-but-not-paginated-taxonomy/)
 *  [openwp3](https://wordpress.org/support/users/openwp3/)
 * (@openwp3)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/404-on-search-pagination-but-not-paginated-taxonomy/#post-3565669)
 * Same here Leo. I have a similar issue and not getting any responses. Here are
   a few posts I found that might be of help to you:
 * [http://wordpress.org/support/topic/custom-loop-pagination?replies=4](http://wordpress.org/support/topic/custom-loop-pagination?replies=4)
 * [http://developer.wordpress.com/2012/05/14/querying-posts-without-query_posts/](http://developer.wordpress.com/2012/05/14/querying-posts-without-query_posts/)

Viewing 7 replies - 1 through 7 (of 7 total)