您需要将搜索查询与新的WP查询相结合。。。
在你的搜索中,可能是这样的。php
<?php
global $wp_query; // get the global object
$thesearch = get_search_query(); // get the string searched
// merge them with one or several meta_queries to meet your demand
$args = array_merge( $wp_query->query, array(
\'meta_query\' => array(
array(
\'key\' => \'field_to_seach\',
\'value\' => $thesearch,
\'compare\' => \'IN\'
)
)
));
query_posts( $args ); // alter the main query to include your custom parameters
?>