D
D
Dmitry Samoilov2021-04-06 16:27:26
WordPress
Dmitry Samoilov, 2021-04-06 16:27:26

Ajax loading wordpress posts, how best to do it?

Hello, I have now decided to make ajax loading of posts when clicking on a button on a test site, I have already read a lot of tutorials, but the code did not work in any case, perhaps because they did it in index.php, and I did it in my template . Then I came across a video of some Indian, he also did it on his template, following his example, loading began to work for me, but for some reason the posts were repeated and the loading was endless ....
You can go crazy, I read so much information, nothing working I didn’t find it, I saw here an advice about the Ajax load more plugin, it seems to be convenient, but for some reason it doesn’t work correctly, I set a class for the container606c616f270ec776400049.jpeg

.example-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
}

It should display posts in a line, but for some reason it loads 3 records per column, then also adds a column to a row, it looks strange, I don’t understand what’s wrong. 606c60f060d9a243995142.jpeg606c60f62569f306875345.jpeg
How do you work with ajax loading on your templates? I would like to ask people who have already done this, maybe give a link to a good tutorial, or some explanation about the plugin, otherwise I'm completely confused and don't know what to do

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
yarovikov, 2021-04-06
@distCom

The simplest and most understandable manual https://rudrastyh.com/wordpress/load-more-posts-aj...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question