K
K
Konstantin Teploukhov2018-09-15 23:41:00
WordPress
Konstantin Teploukhov, 2018-09-15 23:41:00

How to make such a filter ( wordpress + acf )?

Guys, how to make such a filter?

filter
5b9d64785679c641131961.jpeg

I will create a new real estate post type. And through arbitrary fields (acf plugin) I will indicate the price, area, location, etc. And now I need to somehow filter by the values ​​of these fields.
I hope I was able to correctly interpret the question. To be honest, I have never come across filters at all, maybe because I don’t have much combat experience yet or just got lucky -_-

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Igor Vorotnev, 2018-09-20
@HeadOnFire

If you don't use plugins, then +1 to id_baton4eg 's answer , but with a correction: WP_Query is better instead of get_posts() - more freedom and control.
In general, if we send ajax, then there is a REST API. We saw our REST controller, and we get json output - faster, more convenient for javascript on the front.
But, there is one important nuance - such requests will normally load the backend. Therefore, for such tasks there is such a thing as Elastic Search (and analogues). There is also a WP ElasticPress plugin for it. The speed of such a bundle is space compared to the standard REST API even. Oh, and flexibility.

O
Orkhan Hasanli, 2018-09-16
@azerphoenix

Maybe this article will be useful for you - https://www.smashingmagazine.com/2016/03/advanced-...
Plugin - https://wordpress.org/plugins/acf-advanced-search/

I
id_baton4eg, 2018-09-16
@id_baton4eg

I would do this:
1) create a form with the necessary inputs
2) process it via ajax, send a post request to get_posts()
3) get a response, insert its html in the right place.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question