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?
- ORDER BY custom field value
- Can I query custom meta data through WP_Query
- Including custom fields in search?
- 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
- Filter results with custom field values and dropdown
- Add custom field (value) to search result (without plugin)
- Trying to perform complex custom field query with order by set to field value
- searching in custom meta field
- Compare meta_query decimals not working right
- Ordering posts by anniversary using only day and month
- Calling Specific Pages with wp query Part II
- Loop through two different sets of custom fields
- Exclude custom post type from search by custom field value?
- Comparing timestamps in meta query doesn’t work
- Display two post types ordered by two custom fields
- Slow meta query with multi meta keys
- Using OR in WP_Query negates the “NOT EXISTS” compare
- How can I query on the year part of a complete date in a custom field?
- How can I combine meta_query queries?
- Displaying posts with only upcoming dates according their custom field date value
- Difference between ‘LIKE’ and ‘IN’ in meta queries
- Plugin similar to Taxonomy Drill-Down for custom fields?
- Sorting posts by multiple values, combined
- meta_value_num sort glitch
- WP_Query display next custom post from today’s date
- 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
- WP_Meta_Query causing long-running MySQL queries
- How do I query for a post by custom field?
- Including Database Generated Pages in Site Search [closed]
- 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
- Order by custom field value not working for acf date field
- Adding Custom Fields to Search
- Upcoming Event: How do I sort database by custom date field, but ignore past dates?
- Using a checklist to search against metadata
- Complex WP_User_Query call fails on production server
- How can I sort homepage by a meta value?
- Loop to display random posts only if a custom field matches category
- $wpdb query a post type within a specific taxonomy term while ordering posts by custom meta value?
- How do I use wp_query for WordPress search?
- Meta query with timestamp using WP_query
- Custom Fields Not in Search Results
- Orderby custom field meta value ASC and then by date DESC
- Conditional custom field query
- Display only past events on that page using Visual Composer Grid Bulider
- WP Query with custom Shortcode
- Custom Field Create Bulk via SQL Query
- Create Pop-Up Box with Custom Field Content Inside the Loop
- filtering custom post types via meta data drop down
- How to add a new meta key and assign timestamp to posts
- Get content from pages with same meta_key from Database
- 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
- Order RSS content by an advanced custom field value
- Advanced search by two criteria – sort by location and date (ascending or descending)
- Extend product search with meta in WooCommerce
- Advanced search for meta fields
- Get posts with same meta value as current post
- Merge Multiple Custom Fields into one New Custom Field for Searching
- Meta Query returns wrong number of posts
- How to populate custom field dropdown box based on prior selection?
- Search in Archive Pages by subcategory, tag, custom field and year
- Custom WP_Query for WordPress Search Results with meta_query
- Change order of posts
- Meta Query And/Or
- 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
- Why orderbyb meta_value_num won’t affect the generated SQL Query order?