Can I make one or more posts “sticky” at the top of the homepage?
I’m using the Blog template. Thanks!
Yes! You'll need to fork an editable copy of your template, then add the following above the {{#entries}}...{{/entries}}
block in entries.html:
<p>Sticky entries:</p>
{{#allEntries}}
{{#metadata.sticky}}
<a href="{{{url}}}">{{title}}</a><br>
{{/metadata.sticky}}
{{/allEntries}}
Then add the following custom metadata at the start of the posts you'd like to make sticky:
Sticky: yes
Please let me know if you have any questions about the above, or anything else!
Answered 2 years ago · Edit answer