Let Users Filter Posts by Custom Fields


I’m using the Advanced Custom Fields plugin to add custom fields to my posts, but was wondering what is the best way to go about creating a filter box for the user to filter through posts.

enter image description here

I’ve been using the pre_get_posts action in WordPress to alter the meta query like so http://www.website.com/cars?type=saloon,couple,SUV. But I’ve found that when I start using multiple queries the website begins to hang and it’s pretty slow.

Does anyone know if there’s a better way to do this. I simply want my users to be able to filter through cars with relative ease. Am I going about this the wrong way?

Any help is appreciated. Thanks in advance!

, , realph 3 years 2020-07-03T20:11:18-05:00 0 Answers 44 views 0

Leave an answer