I'm in the process of building a Wordpress plugin. I wish to mimic WP's default search functionality but in the form of a 'live search'.
I have my JS setup to grab the query string (i.e what would be
/?s=search-term) & am passing it via AJAX to my function. But now I have to process the query to get the list of posts & pages. But I've read that it's not right to simply use
query_post from the WP documentation.
So my question is, what is the correct approach to yield the same search results as if the default search form was submitted?
Please can someone provide a code snippet or a link to a detailed article which clarifies this for me.
Thanks & please pardon my nativity!