You can use meta query as give below:
$args = array(
'post_type' => 'location_type',
'posts_per_page' => 10,
'post_status' => 'publish',
'meta_query' => array(
'relation' => 'OR',
array(
'zip' => 'zip-value'
),
array(
'town' => 'town-value'
),
),
);
Related Posts:
- Include custom taxonomy term in search
- Advanced search form with filters for custom taxonomies and custom fields
- How to replicate some of Drupal Views functionality in WordPress?
- Exclude from search all custom posts which are NOT in a taxonomy term
- Exclude a term of a taxonomy with a custom post type in a search
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- Custom search for custom post type, custom meta and search fields
- SQL to update custom post taxonomies
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- Is there An Input Checkbox Option That Works like `wp_dropdown_categories()` To Use In A WP Search Form?
- How to search from specific post type with tags?
- Include different loop templates in search query
- Building an Advanced Search (text, tags, category, custom fields) – Getting the wrong SQL query
- CPT Search Form with Taxonomy filter & Or
- Keyword search limited to specific post type filtered by multiple custom taxonomies?
- How to create an advanced filter search?
- Search Custom Post Type & Taxonomies
- search also in taxonomy, tags and custom fields
- WordPress sort search results by custom order
- Including metaboxes from custom post types in global search — continued
- Pretty URL for custom search for custom post type
- Auto Complete Search
- Search by tag name and category
- Advanced search form with filters for custom taxonomies
- dropdowboxes with pre-selected custom fields optios that filters the results according seach needs
- Include custom taxonomy term in search
- how to get this tax_query working?
- Custom Taxonomy Search result page
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- Hide custom post type from search based on custom taxonomy
- Ideas on how to organize a project [closed]
- Multi Parameter search with custom post type category and tag
- How to Implement Search Functionality?
- How to have multiple search result pages in wordpress with taxonomy terms listed
- WordPress CPT Taxonomy Dashboard Search – How to include taxonomy in search?
- Live search by custom tag
- Custom search for a custom post type in WordPress
- How to transfer categories (default) to custom taxonomy?
- Extensive search filtering and results->PDF in the front-end
- Advanced search form with filters for custom taxonomies and custom fields
- Archive custom template from search
- Custom Field Search
- Remove Custom Taxonomy Metabox from Custom Post Type Screen
- How can I change the admin search posts fields?
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- Remove Trash / Delete option for Custom Post Type / Taxonomy
- How to filter custom post types by custom category taxonomy
- Highlight menu item when on a custom post type?
- remove support for ‘Categories’ for a custom post type
- How to select one major category (or custom taxonomy) for a custom post type?
- Custom taxonomy & post slug permalink
- Child and grandchild taxonomy listings – 404
- Limit taxonomy results to a single cpt
- Automatically Add a Category to a Custom Post Type
- Custom Permalink Tag breaks Pagination
- Custom Fields vs Separate Table
- Relationship between two taxonomies and a custom post type [closed]
- Sharing a custom taxonomy with Multiple custom post types
- next_post_link on custom taxonomy
- Show Two custom Post type and their posts on category page
- Change Permalink Structure for Tag.php template
- CPT UI change custom taxonomy url
- Show posts from two or more custom taxonomy terms
- Make parts of your wordpress website completely built with data from external APIs?
- How can I make the slug of the taxonomy also the slug of the custom post
- How to list custom taxonomies in the back end
- How do I display the grand child items of a taxonomy term?
- How to get custom posts sub category link
- Limit Search to Post Type With Apostrophe return search not found
- Top Level pages in wordpress giving 404, but child pages working fine
- Query posts with double taxonomy
- Creating two loops based on different logic
- search custom post type by custom fields on front end
- category list with cutom post count
- Show category and tag link as a submenu under custom post type submenu
- Get Terms from Custom Taxonomy and Current Post
- Add the custom post term to the custom post title
- Display 3 recent posts from one taxonomy
- Display next 3 posts based on custom taxonomy
- Display latest post of taxonomy
- Custom post type and multi taxonomies + customize url
- WordPress Custom Taxonomy – If not parent term
- WP_List_Table Inside Metabox Not Working on Clicking Search Button
- Static Front Page not working for custom theme
- post_type incorrect for custom post type
- Set a Default CPT taxonomy by taxonomy id
- Custom taxonomy terms registered not showing when added in child theme
- how to create custom taxonomy drop downs for parents and child
- Not Able to List CPT Based on Taxonomy Term
- Filter Term By Parent Term – Custom Post Type
- Display all Custom taxonomy terms and their relevant custom posts
- Best way to group posts based on custom post type terms
- redirect old post type url to new structure url
- Display and Allow users to edit their own profiles
- Remove custom taxonomy ‘post-type’ from post URL
- Building a List of Posts grouped by custom taxonomy as the section header only to be displayed if at least one post is in that tax
- Custom My account page and custom page for editing posts
- How do I do this?: If custom post type exists, echo it, else do not
- 404 Error On Custom Taxonomy Pages 2, 3, etc
- Dynamically count the number of custom post types associated to a custom taxonomy