我将这段代码放入主题中,也许对某些事情有帮助:
$search_buyorrent = "";
if (get_option('wp_search_bor') == "Yes") {
if (isset($_COOKIE['rentbuy']) && $_COOKIE['rentbuy'] != '') {
$search_buyorrent = $_COOKIE['rentbuy'];
} else {
if (isset($_POST['rentbuy'])) {
$search_buyorrent = trim($_POST['rentbuy']);
}
}
} else {
$search_buyorrent = '';
}
这里还有另一个片段:
if ($search_buyorrent == "buy" || $search_buyorrent == "") {
$query ="SELECT p.* FROM $wpdb->posts p, $wpdb->postmeta p1
WHERE p.ID = p1.post_id AND p1.meta_key='price_value' AND convert(p1.meta_value, signed) BETWEEN '$search_pricemin_buy' AND '$search_pricemax_buy'";
$spm = getIds( $query );
$_ids = ( !empty($spm) ? ( !empty($_ids) ? array_intersect( $_ids, $spm) : "" ) : "" );
}