How to add search filter by custom values?
-
I’m trying to this..
function my_search_filter($where) { $where .= " AND wp_postmeta.meta_key = city AND wp_postmeta.meta_value ='Jakarta'"; return $where; } if(is_search()) { add_filter('posts_where','my_search_filter'); }
but it does not work…
any idea?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘How to add search filter by custom values?’ is closed to new replies.