<p>I think you can just add <code>.offset(3)</code> to the "remaining" craft.entries query to get the result that you want. Or you could exclude the id's of the first three.</p>

<p>But, this is quite ineffective (performance wise), since you're doing four separate queries to get the entries. An alternative would be to loop over all, and use the <code>loop</code> object together with conditionals to build the output. Something like this:</p>

<pre><code>{% for entry in craft.entries.section('shows') %}
    {% if loop.index==1 %}
        &lt;div class="row"&gt;
            &lt;div class="card-grid card-grid__two-thirds"&gt;
                {% include "_partials/card" %}
            &lt;/div&gt;
            &lt;div class="card-grid card-grid__one-third"&gt;
                &lt;h1&gt;AD&lt;/h1&gt;
            &lt;/div&gt;
        &lt;/div&gt;

    {% elseif loop.index==2 %}
        &lt;div class="row"&gt;
            &lt;div class="card-grid card-grid__two-thirds"&gt;
                {% include "_partials/card" %}
            &lt;/div&gt;

    {% elseif loop.index==3 %}
            &lt;div class="card-grid card-grid__one-half"&gt;
                {% include "_partials/card" %}
            &lt;/div&gt;
        &lt;/div&gt;

    {% elseif loop.index&gt;3 %}
        {% if loop.index==4 %}
             &lt;div class="row grid-remaining"&gt;
        {% endif %}

        &lt;div class="card-grid card-grid__one-third"&gt;
                {% include "_partials/card" %}
        &lt;/div&gt;

        {% if loop.index==loop.last %}
            &lt;/div&gt;
        {% endif %}
    {% endif %}
{% endfor %}
</code></pre>

CC BY-SA 3.0
2016-04-08T16:14:31.617Z
2016-04-08T16:14:31.617Z
André Elvan
<p>I have a layout in Craft with twig that gets the first 3 entries and applies them to the first three containers in the grid.  </p>

<p>I can't figure out how to loop through the remaining entries to add to the <code>grid-remaining</code> div.  With the current code it will repeat entries 1-3 in the grid-remaining div.</p>

<p>Here's what I have at the moment:</p>

<pre><code>{% set firstEntry = craft.entries.section('shows').first() %}
{% set secondEntry = craft.entries.section('shows').nth(2) %}
{% set thirdEntry = craft.entries.section('shows').nth(3) %}

{% extends "_layout" %}

{% block content %}

    &lt;div class="row"&gt;
        &lt;div class="card-grid card-grid__two-thirds"&gt;
            {% include "_partials/card" with { entry: firstEntry } %}
        &lt;/div&gt;
        &lt;div class="card-grid card-grid__one-third"&gt;
            &lt;h1&gt;AD&lt;/h1&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="row"&gt;
        &lt;div class="card-grid card-grid__one-half"&gt;
            {% include "_partials/card" with { entry: secondEntry } %}
        &lt;/div&gt;
        &lt;div class="card-grid card-grid__one-half"&gt;
            {% include "_partials/card" with { entry: thirdEntry } %}
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="row grid-remaining"&gt;
        {% for entry in craft.entries.section('shows') %}
        &lt;div class="card-grid card-grid__one-third"&gt;
            {% include "_partials/card" %}
        &lt;/div&gt;
        {% endfor %}
    &lt;/div&gt;
{% endblock %}
</code></pre>

<p><strong>EDIT</strong></p>

<p>The following works, but I feel like there must be a cleaner way to achieve the same result.</p>

<pre><code>&lt;div class="row grid-remaining"&gt;
    {% for entry in craft.entries.section('shows') %}
    {% if loop.index != 1 and loop.index != 2 and loop.index != 3 %}
    &lt;div class="card-grid card-grid__one-third"&gt;
        {% include "_partials/card" %}
    &lt;/div&gt;
    {% endif %}
    {% endfor %}
&lt;/div&gt;
</code></pre>

<templating><entries>
Loop through remaining craft.entries
# Loop through remaining craft.entries

(Asked by: username_0 on 2016-04-08)

I have a layout in Craft with twig that gets the first 3 entries and applies them to the first three containers in the grid.  
I can't figure out how to loop through the remaining entries to add to the grid-remaining div.  With the current code it will repeat entries 1-3 in the grid-remaining div.
Here's what I have at the moment:
{% set firstEntry = craft.entries.section('shows').first() %}
{% set secondEntry = craft.entries.section('shows').nth(2) %}
{% set thirdEntry = craft.entries.section('shows').nth(3) %}

{% extends "_layout" %}

{% block content %}

    
        
            {% include "_partials/card" with { entry: firstEntry } %}
        
        
            AD
        
    

    
        
            {% include "_partials/card" with { entry: secondEntry } %}
        
        
            {% include "_partials/card" with { entry: thirdEntry } %}
        
    

    
        {% for entry in craft.entries.section('shows') %}
        
            {% include "_partials/card" %}
        
        {% endfor %}
    
{% endblock %}

EDIT
The following works, but I feel like there must be a cleaner way to achieve the same result.

    {% for entry in craft.entries.section('shows') %}
    {% if loop.index != 1 and loop.index != 2 and loop.index != 3 %}
    
        {% include "_partials/card" %}
    
    {% endif %}
    {% endfor %}

**Tags:** templating, entries

---

## 1 answers

### Answer by username_1 on 2016-04-08. Score: 2 | Accepted answer

I think you can just add .offset(3) to the "remaining" craft.entries query to get the result that you want. Or you could exclude the id's of the first three.
But, this is quite ineffective (performance wise), since you're doing four separate queries to get the entries. An alternative would be to loop over all, and use the loop object together with conditionals to build the output. Something like this:
{% for entry in craft.entries.section('shows') %}
    {% if loop.index==1 %}
        
            
                {% include "_partials/card" %}
            
            
                AD
            
        

    {% elseif loop.index==2 %}
        
            
                {% include "_partials/card" %}
            

    {% elseif loop.index==3 %}
            
                {% include "_partials/card" %}
            
        

    {% elseif loop.index>3 %}
        {% if loop.index==4 %}
             
        {% endif %}

        
                {% include "_partials/card" %}
        

        {% if loop.index==loop.last %}
            
        {% endif %}
    {% endif %}
{% endfor %}


---

