Is this layout possible?


#1

I am struggling to only show a certain number of posts on the home page, for example 7 and then show 9 posts on every other (paged) page.

I can show a specific number of posts using the get method, but the pagination never works properly. I understand the default theme does this but I am using the traditional / default pagination.

Is this possible with Ghost?


#2

Sure, this can be handled with the {{body_cass}} helper to apply conditional styles, eg:

So you what you probably want is something like

body:not(.paged) .post:first-child { width: 100%; }

which would only apply to the first post on the first page


#3

Hi John,

Thanks a lot for the quick reply.

I understand I could style the first post separately, however the issue I have is that I only want to display 7 posts on the home page, and then 9 on the (paged) pages. If I have 9 posts with the current layout I would need to have 2 two posts in two columns which I am trying to avoid.

I hope that makes sense.


#4

hmmm, yeah that’s tricky. I mean the cheap solution is to do infinite-scroll rather than pagination, then all you have to worry about is that first post.

Not sure there’s an easy way around having differing posts_per_page values AND using automatic pagination


#5

No worries, I will adapt the layout so it’s always the same number of posts per page on each page. I could do this as a featured post instead. Thanks for your help.