I am trying to create a small search-function for WordPress. An AJAX call should get all posts where the title is like %quote%
.
Is there a possibility to make this happen inside the get_posts()
function?
Don’t get me wrong. The ajax works fine. I have the ajax function in my functions.php and I receive the posts. It’s just the “where title like” part where I couldn’t find a solution.
You could do a custom search query also.
No, but you can create a custom loop.
Check this.
EDIT:
Or you could use the filter
posts_where
like this: