Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Instruct WordPress to search on all post types when doing a category taxonomy query.
function post_type_category_fix($request) {
if ( isset($request['category_name']) && !isset($request['post_type']) )
$request['post_type'] = 'any';
return $request;
add_filter('request', 'post_type_category_fix');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.