I have a custom post type my_cpt
with 9 custom meta fields like first_name, last_name, location, phone, email
etc along with post title and post content.
Now what I want is to search using first_name
and last_name
fields only.
See this sample post-
- Post Title: New Player (post title field of WP editor)
- Description: Lorem ipsum dolor sit (post content field of WP editor)
- first_name: John (custom meta)
- last_name: Doe (custom meta)
- phone: 123466789 (custom meta)
- email: [email protected] (custom meta)
- location: LA (custom meta)
Now if someone searches for
- Player, he gets no results.
- Lorem, gets no results.
- John, he founds this post
- LA, gets nothing