admin管理员组文章数量:1310043
Wordpress admin search is not working for any type posts i.e posts,pages,comments or any other custom posts.
Whenever trying to search for say string without quotes "my new post"** it always returns.
Search results for ""
No matter what the search string is.
Also all of this error is on the pages related with edit.php
Wordpress admin search is not working for any type posts i.e posts,pages,comments or any other custom posts.
Whenever trying to search for say string without quotes "my new post"** it always returns.
Search results for ""
No matter what the search string is.
Also all of this error is on the pages related with edit.php
Share Improve this question edited May 22, 2020 at 14:57 fuxia♦ 107k38 gold badges255 silver badges459 bronze badges asked May 21, 2020 at 22:26 imshashi17imshashi17 215 bronze badges 2- Has this ever been solved? Currently, I have the same error on a wordpress 5.5.1 instance. – Erunafailaro Commented Sep 21, 2020 at 6:32
- Hi @Erunafailaro Yes there could be multiple issues . Like you may have added extra codes in functions.php file inside wp-content folder or in the themes folder. Please remove them and test. – imshashi17 Commented Sep 23, 2020 at 10:16
1 Answer
Reset to default 1you can try writing something that appends to your query var when the search is initiated something as such as:
function gt_search_filter($query) {
global $wp_query;
if ($query->is_search)
if($_REQUEST['s']){
$wp_query->query_vars['s'] = $_REQUEST['s'];
}
return $query;
}
add_filter('pre_get_posts','gt_search_filter');
this worked for me but remember this is quite insecure and not advised what other thing you can do is adding more layers of filterations and everything before you finally give it to the query string.
本文标签: Admin search not working for any type of post
版权声明:本文标题:Admin search not working for any type of post 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741838965a2400383.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论