LoginSignup
0
0

More than 5 years have passed since last update.

【WordPress】固定ページ・カスタム投稿タイプ検索結果除外

Posted at

めも
後ほどくわしくマークダウン

function.php
/* 検索フィルター */
function SearchFilter($query) {
if ($query->is_search) {
$query->set('post_type', 'post');
}
return $query;
}
add_filter('pre_get_posts','SearchFilter');
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0