Manipulating Search Results
-
I’m trying to find a way to change the output of the WordPress search results, but haven’t been able to land on the solution yet. What I want to do is take the input search terms (“s”) and check to see if it matches a given string. If it does, I want to change “s” into something else and output the results for that new “s”.
For instance, currently if somebody searches for “Phoenix, AZ” it will return no results. This is because I have the page listed as “Phoenix, Arizona”. So what I would like to be able to do is write a function that checks for the string “, AZ” and if it finds it, replaces it with “, Arizona” and then outputs those results.
- The topic ‘Manipulating Search Results’ is closed to new replies.