You need to combine your search query with a new WP Query…
That would be something like this, on your search.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
?>
Related Posts:
- Custom WP_Query for WordPress Search Results with meta_query
- Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]
- Adding Custom Fields to Search
- filtering custom post types via meta data drop down
- How do I have WP_Query match posts based on search parameter OR meta fields? (rather than search parameters AND meta fields)?
- How can you include custom post meta in search without calling each key?
- searching by keywords in post’s metas or pagination links problem
- Search one custom field?
- Query postmeta values, and return multiple post_titles for common meta value
- Custom Search Query – include only custom fields and title
- Extend search query to search meta keys values based on search string
- Search for meta_query does not return any result if combined with title
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- Can wp_query return posts meta in a single request?
- How to get custom post meta using REST API
- The “_encloseme” Meta-Key Conundrum
- Filter WP_Query for posts having a certain meta-value
- Using get_post_meta with new_to_publish
- Add custom fields to search
- Meta Query with AND & OR?
- Can I count the number of users matching a value in a multiple value key?
- Getting attachments by meta value
- Auto sort the wp-admin post list by a meta key
- meta_query where value is equal to given value
- How do I search an array stored in a custom-field using WP_Query?
- Add custom field (value) to search result (without plugin)
- Get updated meta data after save_post hook
- Save HTML formatted data to post meta using add_post_meta()
- Search Custom Post Type with all meta attached?
- Custom query with category exclusion and post-meta “whitelist”
- How to get a meta value from all post
- Compare meta_query decimals not working right
- WordPress altering my custom query, How to fix it?
- Exclude custom post type from search by custom field value?
- How to break meta values into different items and avoid duplicates?
- ajax delete value from custom field array
- Save attachment custom fields on front end
- Transition from (classical) serialized custom meta field to (gutenberg) rest enabled meta
- Unable to show ACF’s Image Custom Field properly in Genesis Framework [closed]
- Order by value in serialized custom field
- How to display Meta Field Value?
- Upcoming Event: How do I sort database by custom date field, but ignore past dates?
- Group WP_Query by meta_key date
- Combine multiple custom field values into single value
- How to query posts with certain custom meta data, and output Post data
- Custom Fields Not in Search Results
- Can’t get post ID using wp_insert_post_data
- Unique Post Meta Values
- How can I sort posts by the date and a custom meta field?
- Fetch Record based on meta key dates
- Add post meta fields, when creating a post using WordPress’ REST API
- Store array as single, serialized post meta field or many post meta fields?
- Custom Field Values not updating unless I click “Update” twice
- update_post_meta for repeated custom field [closed]
- Large AND OR query timing out
- Trying to update_post_meta function
- Merge Multiple Custom Fields into one New Custom Field for Searching
- Categorising search results based on Custom Fields
- Search in Archive Pages by subcategory, tag, custom field and year
- Meta Query And/Or
- filter custom field values $min $max
- Unique meta_key with array value vs repeated meta_key with single values
- Is it possible to retrieve all posts with a certain value for metadata?
- Allow only one post with specific meta value
- wordpress custom loop ascending descending posts by custom field
- How to validate select field in post meta?
- How to display childrens custom fields?
- how to display custom fields of post on a web page
- Hide custom fields when empty
- How do I query the title (or handle?) of post meta fieldset (created with Simple Fields Plugin)
- Save all the post tags inside a custom field
- How to fill custom fields with brackets in their key with add_post_meta()?
- How add multiple wp_editor_box to new post
- Get YouTube video id from url in a custom field
- Related query shows same image in loop
- Can’t Output get_post_meta?
- put saved metabox values back into fields and then display on the front end
- How to get custom image field of specific post id
- How to update custom field of a posts in a particular category
- get_post_custom_values problem, please help
- How can I change author of posts to the value of one of the custom field of the posts?
- How do i create a custom post query when the meta value is an array?
- Custom meta fields and meta keys
- Saving Custom Field that includes Quotation marks
- Post meta data not showing in frontend, until hitting ‘update’ button
- update meta field value after
- Meta key in wp_query bug?
- Query Posts based on custom field value
- Echo out custom fields in comments
- Create custom query for search?
- Display Data From This Custom Media Upload Meta Box?
- Sorting Posts with meta value not working
- Query Custom Fields in Searchform
- WP Query multiple select form – meta_query help
- update_post_meta not working in action hook
- Help sorting by Meta Key value
- Hard Define Custom Field Value
- add multiple values (array) to post meta_input
- How to display search query as formatted text?
- WP Query Args – search by meta_key or title