Home>Support>“Load more” button for posts

“Load more” button for posts

Hello.
I’ve got a problem of this kind: I need to make a “Load more button” for post query.
Here is how I see it — when user loads the page, it’s going to show only 8 posts, but when user presses the button, posts will add by 4 each time, up to 24 posts, and then button disappears.
So, if it’s possible to make it with WP_Query, how does “Build Posts Query” works in Page Builder? Where can I change these parameters in code, not in Page Builder UI?
Explained as clear as I can :)

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 8 years, 1 month ago Andrew Misplon
    Hi, I Work Here

    Hi Vlad

    Thanks for posting your question, sorry we weren’t able to reply sooner.

    With our own themes, we use Jetpack Infinite Scroll and this can be used in conjunction with the Post Loop widget. The Post Loop widget is a built in Page Builder widget that can use templates named as follows:

    *-loop.php
    loop-*.php
    

    Out of interest, you can see us adding this to our Focus theme at the moment in this PR: https://github.com/siteorigin/focus/pull/29. Here are the changes made so far: https://github.com/siteorigin/focus/pull/29/files.

    In addition, we added loops to be used with the Post Loop widget: https://github.com/siteorigin/focus/tree/develop/loops.

    I realise that if you’re building your own infinite scroll widget then this isn’t really helpful but it is unfortunately the limit of what we can offer here on the forums.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More