Answer the question
In order to leave comments, you need to log in
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
, 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
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 questionAsk a Question
731 491 924 answers to any question