Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 如何使用wp_查询获得正确的搜索结果_Wordpress_Search - Fatal编程技术网

Wordpress 如何使用wp_查询获得正确的搜索结果

Wordpress 如何使用wp_查询获得正确的搜索结果,wordpress,search,Wordpress,Search,我正在使用wp_查询来获取搜索结果。但它只搜索并返回匹配的标题。不返回匹配的内容和其他ACF字段。我该怎么做?我还在我的网站上使用“搜索一切”插件。下面是我的wp_查询的参数: $args = array( 'post_type' => $post_type, 'post_status' => 'publish', 'posts_per_page'=> $no_of_posts, 'offset'

我正在使用wp_查询来获取搜索结果。但它只搜索并返回匹配的标题。不返回匹配的内容和其他ACF字段。我该怎么做?我还在我的网站上使用“搜索一切”插件。下面是我的wp_查询的参数:

$args = array(
        'post_type'     => $post_type,
        'post_status'   => 'publish',
        'posts_per_page'=> $no_of_posts,
        'offset'        => $offset,
        's'             => $query,
    ); 

我认为这就是问题所在

在术语前面加连字符将排除与该术语匹配的帖子

例如,“枕头沙发”将返回包含“枕头”但不包含“沙发”的帖子