Front of word preference

So my boss is curious if I can sort our search results giving preference to results in which the search term appear earlier in the post title. I didn’t know, but now I’m interested as well. Maybe a function to count the letters in the title, and then order numerically by “letters before term”? I wouldn’t know the first thing on how to do something like that.

Custom post type is called “crosses”.

Related post detailing other work done on this same search result page. Don’t know if it would be relevant or not.

Read more here:: Front of word preference

Leave a Reply

Your email address will not be published. Required fields are marked *