I've used a custom post type for one of my website. Custom post type contains scratch card data along with some custom fields.
I've developed an android application to manage those items from android device.
In the android app, I want to keep search feature which will help admin users to search card numbers to manage those.
I can use wordpress query to search by title.
Code
$args = array("post_type" => "mytype", "name" => $title);
$query = get_posts( $args );
It can only provide result if I provide exact title. But I need to retrieve all items with similar title.
Any suggestion?
get_posts()
you can use the default search query ofWordPress
which will provide you the results of the searched term. It will also provide all the matching results with all your search terms.