Problem with displaying custom post types after upgrade to 3.8
-
In our custom function file we have several functions of the type:
function author_post_type( $query ) { if ( is_category( array( 2, 5, 8, 14 ) ) && $query->is_main_query() ) { $query->set( 'post_type', array( 'author_bio' ) ); $query->set( 'orderby', 'meta_value'); $query->set( 'meta_key', 'author_last_name' ); $query->set( 'order', 'ASC' ); } }
After working successfully for a year and a half, these functions suddenly stopped working. Apparently the set-post-type line is failing, because the page produces no results. (No results because all posts in the selected category are author post types, in this example, and without setting the post type, those are not found.)
Oddly enough, a similar function with an if-statement testing for taxonomy —
if ( is_tax( 'genre' ) && $query->is_main_query() ) {
— continues to work fine.So “is_tax” continues to work, but “is_category” no longer works.
We recently updated to WordPress 3.8. Any advice?
- The topic ‘Problem with displaying custom post types after upgrade to 3.8’ is closed to new replies.