Have you check your result-set, what result you are getting in $query
obj. another thing, there is no need to use 'relation' => 'OR',
in meta query array, have a try with this as well. And instead of 'numberposts'
use 'posts_per_page'
this will help. 🙂 or you can remove the meta_query and make your $arg something like
$args = array(
's' => $keyword,
'post_type'=> 'store',
'posts_per_page' => -1,
'meta_key' => 'postal_code',
'meta_value' => $keyword,
'meta_compare' => 'LIKE'
);
Related Posts:
- Using meta query (‘meta_query’) with a search query (‘s’)
- Add custom fields to search
- Meta Query with AND & OR?
- Is there a way to do multiple ordering on a multiple meta_query?
- WordPress Search Custom Meta Field Only
- sort search results by custom fields using dropdown
- How make a custom search on backend in WordPress without plugin?
- How do I have WP_Query match posts based on search parameter OR meta fields? (rather than search parameters AND meta fields)?
- Alter main archive, to show posts with meta as last
- filter custom field values $min $max
- Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months
- Custom search SQL Query to add custom field in result
- How to exclude custom fields from search queries?
- Best way to sort estates and query them (for rent? yes/no. contains office space? yes/no)?
- Searching with Multiple (Parallel) Criteria on Custom Fields?
- Need to search a custom field (ingredients, one long string per post), but want it to allow phrases/non-exact matches
- Search & column order by meta value in admin
- searching by keywords in post’s metas or pagination links problem
- Meta_query not filtering posts
- How to display search query as formatted text?
- SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
- How to rename a custom field?
- Matching Serialized Arrays with meta_query
- How can I make wp-pagenavi work on a custom query built upon a form submission? [closed]
- Custom search: by post data and post metadata?
- Need small coding with Custom Fields Search
- Search ONLY by meta key / meta values
- Add custom field (value) to search result (without plugin)
- Trying to perform complex custom field query with order by set to field value
- Compare meta_query decimals not working right
- Loop through two different sets of custom fields
- Display two post types ordered by two custom fields
- Difference between ‘LIKE’ and ‘IN’ in meta queries
- Plugin similar to Taxonomy Drill-Down for custom fields?
- meta_value_num sort glitch
- Extend ‘The Events Calendar’ search to include custom fields [closed]
- Include woocommerce custom field value in front-end search result
- Which is best in the following scenario : post_meta vs custom table vs parent/child posts
- Sorting posts by custom fields in meta_query
- Count how many posts have a custom field set
- meta_query for a string inside a meta field containing a comma-separated list
- Using a checklist to search against metadata
- Complex WP_User_Query call fails on production server
- Custom Fields Not in Search Results
- Orderby custom field meta value ASC and then by date DESC
- Create Pop-Up Box with Custom Field Content Inside the Loop
- query usermeta from custom field
- WP 3.1 meta_query for multiple custom field values
- Is there any way to get all meta and standard columns for any WordPress object after searching based on meta key and value
- Merge Multiple Custom Fields into one New Custom Field for Searching
- Trying to reorder posts by custom field
- Use meta_query to get title of associated post
- Limits, not all post are showen when querying for posts by view count
- Meta query with multiple custom fields for archives page ordering problem
- filter search custom field query
- How to let users choose where to search for posts?
- Ordering posts by custom field named “date” in backend
- Unique meta_key with array value vs repeated meta_key with single values
- WP Query – Is this correct?
- pre_get_posts : only get posts by wp_usermeta value
- comment meta_query for keys that aren’t yet set
- List custom queried terms in the edit-tags.php?taxonomy page
- change order of images attached to post
- Loop through incrementing custom fields
- tax query between operator like
- WP_Query () using taxonomy, custom post types
- How to query for posts with either one or another custom field
- Get array of posts based on custom field values
- Is it possible to compare the current time with a custom “start” and “end date
- How to query posts by month based on date custom field?
- How can I modify my meta_query to work with prices that are stored in the database that contain dollar signs and commas?
- Query multiple post types, but different order for each
- Compare ACF date field (if exists) and post date and order DESC
- Type character in name and make it invisble
- multiple meta_query and orderby question
- get posts based on non-single metadata
- Problem with revisions only returning four results
- Woocommerce products search with custom fields
- How to save multiple values with same meta_key, each value linked to another tag id
- How to improve my non-unique metadata MySQL entries?
- search based on custom field
- Query against multiple locations within single custom post type post
- Restrict WordPress search to a single ACF field
- Query multiple meta values at the same time :
- select user with all meta field and field value. I am use Below Query for this ,So any of know another way to fast query instead of below query?
- Create Shortcode shows only posts with custom_field meta
- meta_query ‘compare’ => ‘!=’ not working
- Search one custom field?
- Query Posts Via WordPress URL
- query specific posts according their custom fields, using sql SELECT
- Get multiple posts with some custom fields efficient
- How to add a prefix to existing custom fields over MYSQL query?
- Complex WP_Query Using Post Date And Post Meta
- Checking if field is set before comparing with meta_query in query_posts?
- Custom search with meta fields
- Only show content slideshow if “slideshow” custom field exists
- How do delete a meta key?
- Dynamic background image used in css after selector
- WP Query Args – search by meta_key or title
- Search for meta_query does not return any result if combined with title