B
B
bugs__27032021-04-13 09:04:11
AJAX
bugs__2703, 2021-04-13 09:04:11

Displaying posts in a field using Ajax?

I have 3 links, when you click on them, posts should be displayed in the field with a certain id without reloading the page
60752ed2ace8f335097644.png
, and there are 3 name.php files that contain the code for displaying posts.
That is, when you click on the link, you need to connect a certain file to the container, and disable the previous one.
I have such an idea that when you click on the link, a variable will be sent to the handler, in which, through "if", it will be compared with the given values ​​and, if it matches, the desired file will be connected. But how can I best implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kudrya, 2021-04-13
@Mugenzo

In the link you write the category attribute through the date or what you will pull the data from, and pass it via ajax to the back, on the back you catch what you will filter by and through the usual wp query you loop through all the records inside which you use get template part, it takes variables as the 3rd parameter, and you return the markup to the front, which you insert where you need

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question