Hi,
We want to display 1 featured post at the top of our main blog page. Beneath that, we want to display the 6 most recent posts (excluding the featured post) with a pagination link beneath those. Wondering if this is even possible with Shopify?
Something like this as a starting point:
{% for article in blog.articles %}
{% if article.tags contains 'Featured' %}
FEATURED_POST_GOES_HERE
{% endif %}
{% endfor %}
{% paginate blog.articles by 6 %}
{% for article in blog.articles %}
POSTS_GO_HERE
{% endfor %}
{% if paginate.pages > paginate.current_page %}
See more
{% endif %}
{% endpaginate %}
Hi rootdown! Hope you are doing well!
I have a couple of questions before I suggest anything:
- If the user goes to the second page, should the featured post remain the same as on the first page?
- Will each blog have its own featured post?
Alex
Hi @AlexHodzitsky ,
Doing well. Hope you’re well too. Thanks for your help here!
-
The featured post will only display on the first page. So, the first page would be 1 featured post + 6 most recent posts, excluding the featured post. The second page would be the 6 next most recent posts, still excluding the featured post.
-
We’re only using 1 blog currently.
Doing well too!
Thank you for your answers! You won’t be able to do it the way you want. We will not be able to shift the pagination and hide one of the six posts and at the same time replace it with the next one. On one of the pages, in any case, 5 posts should be displayed, instead of 6, excluding the featured post.
Alex