openwp3
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: posts_where filtersFirgured out on my own:
return $where .= " AND {$wpdb->posts}.post_status != 'private' AND {$wpdb->posts}.post_status != 'trash' ";Hope it helps someone else.
No answers so closing!
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
In reply to: How does WordPress check for updated taxonomy SLUGS?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
In reply to: How does WordPress check for updated taxonomy SLUGS?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
In reply to: another 404 on page 2 issueI’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):
This person seems to have worked it out by adding rewrite rules:
http://wordpress.stackexchange.com/questions/26673/getting-404-on-taxonomy-page
Hope this helps you in some way.
Forum: Fixing WordPress
In reply to: 404 on search pagination, but not paginated taxonomy?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://developer.wordpress.com/2012/05/14/querying-posts-without-query_posts/