検索結果ページにおいて、謎のPHPエラーが出ます
-
http://kotori-blog.com/wordpress/refinement_search/#refinement1
を参考にし、複数タクソノミーの絞り込みのページを作っております。
検索結果は良好ですが、謎のエラーが上部に出ます。Warning: strpos() expects parameter 1 to be string, array given in D:\_www\folderName\wp\wp-includes\query.php on line 1766 Warning: preg_split() expects parameter 2 to be string, array given in D:\_www\folderName\wp\wp-includes\query.php on line 1767 Warning: Invalid argument supplied for foreach() in D:\_www\folderName\wp\wp-includes\query.php on line 1768 Warning: strpos() expects parameter 1 to be string, array given in D:\_www\folderName\wp\wp-includes\query.php on line 1766 Warning: preg_split() expects parameter 2 to be string, array given in D:\_www\folderName\wp\wp-includes\query.php on line 1767 Warning: Invalid argument supplied for foreach() in D:\_www\folderName\wp\wp-includes\query.php on line 1768
タクソノミーは4つ。(Custom Post Ulにて作成)
それぞれ、チェックボックスにて複数選択可。
あるタクソノミーを選択した時だけ、エラーが出るように思います。$s = $_GET['s']; $area = $_GET['area']; $job = $_GET['job']; $years = $_GET['years']; $dept = $_GET['dept']; if($area){ $taxquerysp[] = array( 'taxonomy'=>'area', 'terms'=> $area, 'include_children'=>false, 'field'=>'slug', 'operator'=>'IN' ); } if($job){ $taxquerysp[] = array( 'taxonomy'=>'job', 'terms'=> $job, 'include_children'=>false, 'field'=>'slug', 'operator'=>'IN' ); } if($years){ $taxquerysp[] = array( 'taxonomy'=>'years', 'terms'=> $years, 'include_children'=>false, 'field'=>'slug', 'operator'=>'IN' ); } if($dept){ $taxquerysp[] = array( 'taxonomy'=>'dept', 'terms'=> $dept, 'include_children'=>false, 'field'=>'slug', 'operator'=>'IN' ); }
のようにしてから、
$arg = array( 'meta_key' => '_prefNum', 'orderby' => 'meta_value_num', 'order' => 'ASC', 'tax_query' => $taxquerysp, 's' => $s, ); query_posts($arg);
と取得しておりますが、どこか間違いがあるのでしょうか。
クエリーバージョンをFalseにすると、エラーはなくなりましたが、
taxonomy.phpで、クエリが効かなくなりました。以上、どなたかご教示いただきましたら幸いです。
よろしくお願い致します。
2件の返信を表示中 - 1 - 2件目 (全2件中)
2件の返信を表示中 - 1 - 2件目 (全2件中)
- トピック「検索結果ページにおいて、謎のPHPエラーが出ます」には新たに返信することはできません。