C
C
cHibisSov2021-09-09 15:18:27
WordPress
cHibisSov, 2021-09-09 15:18:27

How to make a filter on a Wordpress site page that separates event entries into past and upcoming ones?

6139f9d4ba6e2073898290.jpeg
Hello! I am making a website in WP. A task arose: on one page to place announcements of events (in the form of posters), when clicked on, you go to the record and read about the selected event. It is necessary to make a filter on the page (like in the attached picture), dividing all events into past and upcoming ones. Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Zolin, 2021-09-09
@cHibisSov

You have three normal options:

  1. Make tabs. Those. make a request, before displaying records, check the date of the event and separate it into tabs at the html build stage
  2. For posts, you make .future and .past classes and sort by js when you click. There is a normal mixitup library
  3. Ajax request. This is more difficult than the previous ones. When you click, you send a request to the server, get a response, rebuild the content. Learn more about how ajax works in WordPress here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question