Skip to content

Instantly share code, notes, and snippets.

@besimhu
Created March 15, 2015 16:06
Show Gist options
  • Save besimhu/3636fc8d844c053ac633 to your computer and use it in GitHub Desktop.
Save besimhu/3636fc8d844c053ac633 to your computer and use it in GitHub Desktop.
When you view a tag, it only lists custom post type with ‘post’ … this function changes that.
// Allow custom post types in tag search
function post_type_tags_fix($request) {
if ( isset($request['tag']) && !isset($request['post_type']) )
$request['post_type'] = 'any';
return $request;
}
add_filter('request', 'post_type_tags_fix');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment