What is the best way to use WP’s built-in search functionality to pass some keywords to WP and get post IDs in return?
I want to detect the keywords users typed to arrive at my blog from a search engine, search the database with WP’s search functions, and get in return a list of post IDs. With these, I could then choose to display the list of post titles as links to the posts themselves.
I am not interested in using the related posts plugin.
Retrieving the search engine keywords isn’t a problem. I already have that part of my plugin done. Thanks for the offer, though.
I was able to match the keywords to UltimateTagWarrior tags in the database, do a LEFT JOIN, and get the post IDs that way. Essentially, the IDs of any post that has tags that match a search term are returned.
I can just pull the posts out based on their IDs. Thanks for your help. I just needed someone to bounce ideas off of.
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Matching search terms, getting back post IDs’ is closed to new replies.