Offset starting point in blog post list, exclude first post

SOLVE
bengoshow
Participant | Partner

Is there a way using rss_listing or blog_recent_posts to exclude the first X posts?

0 Upvotes
1 Accepted solution

Accepted Solutions
bengoshow
Solution
Participant | Partner

I figured out how to do it this way, skipping the first post and displaying the next 3:

 

{% set rec_posts = blog_recent_posts('default', 4) %}
{% for content in rec_posts %}
{% if loop.index > 1 %}
<a class="hs-rss-title" href="{{ group.absolute_url }}/{{ content.slug }}"><span>{{ content.name }}</span></a>
{%endif%}
{% endfor %}

 

You can just increase the number if you want to skip more than the first one, ie:

 

{% if loop.index > 2 %}

View solution in original post

2 Replies 2
bengoshow
Solution
Participant | Partner

I figured out how to do it this way, skipping the first post and displaying the next 3:

 

{% set rec_posts = blog_recent_posts('default', 4) %}
{% for content in rec_posts %}
{% if loop.index > 1 %}
<a class="hs-rss-title" href="{{ group.absolute_url }}/{{ content.slug }}"><span>{{ content.name }}</span></a>
{%endif%}
{% endfor %}

 

You can just increase the number if you want to skip more than the first one, ie:

 

{% if loop.index > 2 %}

View solution in original post

simmpaul
Contributor

[Reply Deleted - Irrelevant]

0 Upvotes