Skip to content

How to show X number of recent full posts on homepage? #3762

Answered by lwasser
moffat asked this question in Q&A
Discussion options

You must be logged in to vote

hey @moffat you'd want something like:

{% for post in site.posts limit:3 %}
   {{ post.title }} 
{% endfor %}

Which would look through 3 posts - i think the 3 most recent posts should be displayed there. if you wanted 5 use limit:5

then you can add any styling that you wish around that loop to style how each is printed and linked to. Cheers!

SO i have something like that in my sites that looks like this that lists them horizontally using min mistakes styles.:

<div class="feature__wrapper">
   {% for post in site.posts limit:3 %}
   <div class="feature__item">
      <div class="archive__item">
         <div class="archive__item-body">
            <h3 class="archive__item-title"><a href="{{…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@moffat
Comment options

Answer selected by moffat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants