N
N
Nazi2018-03-21 14:49:47
JavaScript
Nazi, 2018-03-21 14:49:47

How to organize filters on the site?

I have a layout for selling tours and there will be about 200 tours and filtering by prices and stars and categories. More filters will be added over time.
You need to add such a page to a static WordPress site.
I read several articles and got confused.
if someone can write step by step how this is being developed, but I'll figure it out

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
E, 2018-03-21
@aylo

Foreword: Vp is quite suitable for this task. And you can do it in a couple of days.
Create a custom post type, let's call it tour
Add categories to it, what
Add meta fields to this custom post type
price, number of stars, city, etc.,
filter through get requests, for example.
clicked the 5 stars checkbox, added ?stars=5 to the URL
clicked on the city added ?stars=5&city=somecity
, in turn, in the template, we check if we have this get parameter and make the necessary query to the database.
the filter is a separate story and can be done through ajax on jquery, you can at least on anything, vue, react, angula, which is closer to you, or you can just as I described through get parameters.
the most difficult thing here is filtering, and the structure is done in half an hour.

M
Maxim Timofeev, 2018-03-21
@webinar

In wp, you are tempted to do this. It is necessary to make cms separately for this project or take a ready-made cms for travel agencies. Do not try to make a lamp out of a stool. In no way do I want to offend wp, it is simply not suitable for this task at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question