Site logo

Archived topic

Ajax load more post button loads posts in wrong place.

26 replies · Started by Kirsty on April 13, 2021

Viewing posts 1–15 of 27

I using Element hook to load two custom post loops prior to the main loop on the blog page. When I click the load more posts button at the bottom of the page (ie. after the main post loop) the newly loaded posts are getting added to one of the first loops instead of the main loop. I am making use of the post template to display the posts so maybe this has something to do with it?

Hi there,

that sounds more an issue with there being multiple post loops on the same page - pagination on a loop when other loops exist can be a pain - and i don't think theres an easy option to get the Ajax loader to deal with that - ill check with Tom.

Definitely a lot of things can go bad when integrating infinite scroll with multiple loops. It really depends on how pagination is being handled and where infinite scroll is getting the next set of posts from. It's likely something that would need a custom infinite scroll integration.

Heya, just letting you know I got it working. I was originally trying to make use of the grid layout, but ended up hooking the Element into another position further up and just styled my own grid. Now the load more loads posts in the right place.

Glad you got it sorted! :)

After updating Generate Press plugin, the load more stopped working in the way I had managed to get it working - ie. at the bottom of the page instead of in the first loop. Because this was working before updating the plugin, I'm wondering if you have any insight into what's caused this?

Hi Kirsty,

Any chance you can link us to the page in question to observe what's happening to the load more button?

You can use the private information text field to provide the details.

Just wondering if there’s any update on this? I sent a link to the page via the private info...

Hi Kirsty.

I don't see any link from any of the private information boxes from your replies.

The only private information associated with this topic is from you mentioning that it's still on a local dev on your computer.

Is the site still up? Can you link us to the page in question?

Let us know. :)

I just sent it again. Let me know if you don’t receive it.

Weird, not wrapping in code. ok sent again without https:// part of url.

How odd. I’m using chrome on iPhone, but I filled in the contact form in safari just in case that’s the issue. Hopefully you receive the link ok this time.

Hi there,

i am seeing the issue that Tom and I originally pointed out. That additional post loop being hooked in above the archive is being 'loaded' on the Load More option.

What was the changes you made previously to fix the issue?

This archived topic is closed to new replies.