Searching Custom Posts content with JQuery

Since you’re searching on the user end (as far as I can see), you will only be able to find data that has been sent to the user. So, if you archive page does not include the full post, you won’t be able to search that.

The obvious solution is that you’ll need to send all post content over. There are two possible approaches:

  1. From within the script, retrieve the posts using the rest-api. This means you won’t have to change the archive page as it is. It might affect performance, though, as you may be issuing a lot of data request to your server which may also be hold up during transfer to the user end

  2. Change the archive page so it includes the complete posts and use some css to hide the full content as long as it is not needed. Probably the best approach.