Editing posts per page on landing page


#1

This is on the vanilla Ghost install, using Casper.

I tried changing “posts_per_page” in Casper’s package.json to “5”, and ghost restarted, but the landing page (the one you see at localhost:2368) still shows the default 7 Ghost posts.

Am I missing something?

Thanks!


#2

Casper uses infinite scroll - when you scroll near the bottom of the page, the next set of posts will be loaded.

Without looking at your publication, it’s not really possible to see if the issue lies with the backend, but my guess is the remaining 2 posts are being pulled in and displayed before you notice. I tried it locally, and can see the layout change as the page loads


#3

Ah so posts_per_page only affects the lazy load, not the amount ultimately displayed.

I’m guessing not all themes are designed to have infinite scroll? Or if I wanted to programmatically change this behavior in Casper, how much work do you think it will be?

(just a question in a vacuum, I think infinite scroll is fine for my purposes for now)


#4

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.