I am currently implement a search function to search the post from wordpress
I would like to search the post by Tag , by title and return it as JSON
I found a plugin that generate the result as JSON (JSON API)
http://wordpress.org/plugins/json-api/other_notes/#2.1.-Core-controller-methods
In that plugin , there is a get_posts function that can return the query that support WP_query parameter
I tried a query like that
where the &s= is the keyword to search while the &tag= is the tag to search
However, there are two problem
- How can I limit the search to title only?
http://codex.wordpress.org/Class_Reference/WP_Query#Search_Parameter
From the official website, it state search keyword ,but not limit to title only
- It seems the condition is tag “AND” keywords are match, but what I would like to achieve is tag “OR” keywords are match
http://codex.wordpress.org/Function_Reference/get_posts
So, to sum up , the goal is to search the post by Tag , by title and return it as JSON (actually is call the php through JSON), it doesnt matter using the plugin or not, any way achieve the goal is welcomed. Thanks for helping