Sign in

Featured posts on top of list of posts

  • This topic has 4 replies, 3 voices, and was last updated 1 week, 1 day ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #8810
    Avatar photomuch.fun

    Dear all –

    I marked some of my posts as featured.

    As long as they marked as featured, I want them to be listed on top, e.g.:

    1. featured post from last week
    2. normal post from today
    3. normal post from yesterday
    4. ….

    I neither found a description in the docs nor here on how to to that…

    Thanks in advance, Michael

    #8814
    Avatar photoBob

    I’m afraid there’s no way to display a post by date range; we can filter and display them according to the most recent or oldest entry.

    e.g. https://getpublii.com/dev/getpostsbytags-helper/

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #8816
    Avatar photomuch.fun

    what a pity. I was thinking of the functionality of the sticky posts in WordPress. Maybe an idea for future releases? Cheers, Michael

    #8846
    Avatar photoprivii

    Doesn’t that depend on your theme?

    Editorial shows a featured post at the top, for example. And Taste lets you display a featured post in the hero section.

    #8858
    Avatar photomuch.fun

    Hi, privii,

    thanks a lot for your suggestion. It gave me the right direction 🙂

    I now use this structure, and it works fine in my theme:

    {{> head}}
    {{#if @renderer.isFirstPage}}
    {{#featuredPosts}}
    <article>
    </article>
    {{/featuredPosts}}
    {{/if}}
    
    {{#each posts}}
    <article>
    </article>
    {{/each}}
    {{> footer}}

     

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.