Skip to content

Instantly share code, notes, and snippets.

@takatoshi
Created June 12, 2012 17:19
Show Gist options
  • Select an option

  • Save takatoshi/2918804 to your computer and use it in GitHub Desktop.

Select an option

Save takatoshi/2918804 to your computer and use it in GitHub Desktop.
function SearchFilter($query) {
if ($query->is_search) {
$query->set('post_type', 'post');
}
return $query;
}
add_filter('pre_get_posts', 'SearchFilter');
if (isset($_GET['s'])) {
$_GET['s'] = mb_convert_kana($_GET['s'], 's', 'UTF-8');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment