Logic of Casper2 theme

Can someone help me understand this logic of Casper2 theme,
where there is bunch of post cards, and sometimes there are 3 cards,
sometimes, there are two, and sometimes there is only one that is wide

I’m interested in last one - when does it appear, and can I somehow make it appear
after 3 cards - whenever I want to.

You can see how the home page is laid out here

The first (most recent) post in the list is styled to be bigger than the others and take over the full width of the grid to give it more emphasis. Wrapped in a media query to make sure this only happens on large viewports / desktop-ish devices.

1 Like

I can’t find html part that mentions that class

The home page loops over the posts and renders this file

ok. but I don’t see mention of home-template class anyhwere

Oh, that’s added via the {{body_class}} helper

1 Like

btw. when I click on Feature this post, shouldn’t that post automatically always appear first?
That currently doesn’t happen for me.

No, In ghost, featuring a post does not bring that post automatically at the first place. That post will appear at normal position in post’s order ( Ordered by published date ).

what does featuring even mean then, exactly?

and - of course, how to make something appear first, then?

I can’t explain this clearly. Maybe some more expert person can explain this. :smiley:

If you want to show featured post at a perticular place, you can use {{get}} helper Ghost Handlebars Themes - Building a custom Ghost theme - Docs

{{#get "posts" filter="featured:true"}}
    {{! Loop through our featured posts }}
    {{#foreach posts}}
   	    {{! here you can output anything of a post object}}

This will only show the featured posts.

1 Like

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