CMS Development

bengoshow
Participant | Partner
Participant | Partner

Offset starting point in blog post list, exclude first post

SOLVE

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

0 Upvotes
1 Accepted solution
bengoshow
Solution
Participant | Partner
Participant | Partner

Offset starting point in blog post list, exclude first post

SOLVE

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
simmpaul
Contributor | Diamond Partner
Contributor | Diamond Partner

Offset starting point in blog post list, exclude first post

SOLVE

[Reply Deleted - Irrelevant]

0 Upvotes
bengoshow
Solution
Participant | Partner
Participant | Partner

Offset starting point in blog post list, exclude first post

SOLVE

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 %}