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
- WP_Query – Order results by meta value
- Advanced search form with filters for custom taxonomies and custom fields
- Custom post meta field effect on the performance on the post
- Difference between meta keys with _ and without _ [duplicate]
- Orderby meta_value only returns posts that have existing meta_key
- What is “meta_input” parameter in wp_insert_post() used for?
- How to enable revisions for post meta data?
- Can I query custom meta data through WP_Query
- Including custom fields in search?
- Search multiple custom fields by using meta_query
- Is there a hook / action that is triggered when adding or removing a post thumbnail?
- Filter results with custom field values and dropdown
- passing argument to get_template_part() or a better way to code
- Is there a way to do multiple ordering on a multiple meta_query?
- searching in custom meta field
- Create meta boxes that don’t show in custom fields
- Ordering posts by anniversary using only day and month
- How to use pagination with get_post_meta
- Copying Custom Meta Values from existing post to a duplicate post
- Move value of one custom field to another
- Displaying posts with only upcoming dates according their custom field date value
- How to filter a dd/mm/yyyy date from a custom field in a query
- Custom fields: In what order are they saved into the DB?
- Get a post_id where meta_value equals something in a serialized meta_value field
- How to save a ToggleControl value in a meta field?
- Including Database Generated Pages in Site Search [closed]
- How to Validate Post Meta type/extension (Video File Image File etc)
- How can I sort homepage by a meta value?
- Meta query with timestamp using WP_query
- Including Custom Meta with posts_where query
- Nav Menu – Add class based on meta keys
- Conditional custom field query
- Order query by meta_value with multiple custom fields
- How to wrap meta values seperated by comma in ? [closed]
- Bulk remove post meta
- How to create html block to display extra information on woocommerce single product page
- Display custom field meta outside loop, site wide
- Run a check for multiple meta key values
- WordPress Rest API to call page data associate with custom meta
- Including metaboxes from custom post types in global search — continued
- Hide custom meta data if empty
- Extend product search with meta in WooCommerce
- how to make members list directory through wordpress post custom meta key.
- Advanced search for meta fields
- Add custom field to all posts in specific post_type
- How to populate custom field dropdown box based on prior selection?
- Can I access a post meta field before the loop?
- wrap text around custom fields array
- Get all the posts where meta field with multiple choice has several values checked
- wordpress custom loop ascending descending posts by custom field
- How to get specific post meta by title or id
- Hide custom fields when empty
- Can’t query by meta_key
- Save all the post tags inside a custom field
- How add multiple wp_editor_box to new post
- Update post meta custom field using block editor
- Order WP_Query results by meta key value in custom query
- Get custom fields without _edit_last, _edit_lock, _wp_page_template and _visual-subtitle
- Get YouTube video id from url in a custom field
- Related query shows same image in loop
- Why am I getting a “Call to member function format() on a non-object” error?
- Search CPT Title AND Meta
- Modify custom field from front end
- Custom Query Fields – Altering Meta Value
- Custom Query: query by post custom meta data
- get_post_custom_values problem, please help
- update_post_meta not working well
- Search & column order by meta value in admin
- Custom meta fields and meta keys
- How to add a post’s view count into the WordPress API response
- Can’t set custom meta fields for a post
- Very large list of options for BuddyPress profile fields
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Search fails when using the radio buttons
- Create custom query for search?
- When post is updated, custom metadata in text area field is overwritten
- Media Attachment Custom Meta Fields not saving in Media Uploader when using jQuery UI Autocomplete
- Custom Field: Display only if a specific key is selected outside the loop
- Help sorting by Meta Key value
- When editing a post with a custom meta box the values aren’t displaying correctly
- Show posts containing or not custom field
- Hard Define Custom Field Value
- add_post_meta insert null value into Database
- Retrieving custom field as shortcode
- How to display search query as formatted text?
- save all acf options in one meta_value [closed]
- WP Query Args – search by meta_key or title
- How to include custom fields in wordpress search