0

Is it possible to load a specific amount of posts on click into a DIV via ajax? I've found a lot of tutorials, but all of them make use of the load-more- / next-page-functionality of a theme.

What I need is, that the initial DIV is empty and the posts are only loaded into the div, if u click a toggle-button.

Is this possible? Thanks in advance!

1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Commented Mar 11, 2022 at 17:16

1 Answer 1

1

The short answer to your question is simply, yes it is possible. It involves code across JS and PHP and is beyond what I would be able to show in an answer here. However I did a simple Google search for "wordpress load posts with ajax" and this link is the first result. https://wpmudev.com/blog/load-posts-ajax/ I scanned through the tutorial and it appears to be very detailed and I believe it should help you get where you need to be.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.