<p>As soon as you apply <code>.all()</code>, the variable you're working with becomes an array. Which means that the <code>.offset(2)</code> needs to be applied <em>before</em> you convert it into an array.</p>

<hr>

<p><strong>UPDATE</strong></p>

<p>As @andrew.welch points out in the comments, it's as easy as grabbing the third item in your array...</p>

<pre><code>items[2]
</code></pre>

<p>Ultimately, it looks like you want something like this...</p>

<pre><code>{% set cardC = items[2] %}

{% if cardC %}

    {# ... the rest of your code #}

{% endif %}
</code></pre>

<hr>

<p><strong>ORIGINAL ANSWER</strong></p>

<p>Once it's an array, you'll need to use the <a href="https://twig.symfony.com/doc/2.x/filters/slice.html" rel="nofollow noreferrer">Twig syntax</a> instead...</p>

<pre><code>items[2:1]
</code></pre>

<p>Which translates to: "get third item (0-based index), limit of one".</p>

CC BY-SA 4.0
2018-06-02T16:25:25.863Z
should I keep the .all()?
Hellyar
CC BY-SA 4.0
2018-06-02T16:27:21.573Z
You mentioned that you set `items` in order to render multiple entries. If so, then yes... That said, _don't_ apply the offset & limit before the `all` if you intend to use `items` for multiple entries.
Lindsey D
CC BY-SA 4.0
2018-06-02T17:32:13.333Z
Do we need `slice` here? Seems like it could just be `items[2]` no?
andrew.welch
CC BY-SA 4.0
2018-06-02T21:20:35.070Z
Ahh, good call @andrew.welch! Even I was overcomplicating it.
Lindsey D
CC BY-SA 4.0
2018-06-02T21:21:00.143Z
I've updated my answer accordingly.
Lindsey D
CC BY-SA 4.0
2018-06-02T16:17:27.210Z
2018-06-02T21:20:05.913Z
2018-06-02T21:20:05.913Z
Lindsey D
<p>I am trying to build an <code>Index</code> page and assign a specific <code>card</code> template to the <code>3rd entry</code> and only the <code>3rd entry</code>. </p>

<pre><code>{% set items = craft.entries.section('posts').all() %}

{% for cardC in items.offset(2).limit(1) %}

    &lt;div class="col-md-12"&gt;
        &lt;div class="card card-raised card-background" style="background-image: url('{{ cardC.postImage.one().getUrl() }}')"&gt;
            &lt;div class="card-body"&gt;
                &lt;h6 class="card-category text-info"&gt;Marketing&lt;/h6&gt;
                &lt;h3 class="card-title"&gt;{{ cardC.title }}&lt;/h3&gt;
                &lt;p class="card-description"&gt;
                   {{ cardC.introParagraph }}
                &lt;/p&gt;
                &lt;a href="" class="btn btn-warning btn-round"&gt;
                    &lt;i class="material-icons"&gt;subject&lt;/i&gt; Read Case Study
                &lt;/a&gt;
                &lt;a href="" class="btn btn-white btn-just-icon btn-link" title="" rel="tooltip" data-original-title="Save to Pocket"&gt;
                    &lt;i class="fa fa-get-pocket"&gt;&lt;/i&gt;
                &lt;/a&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;

{% endfor %}
</code></pre>

<p>I also tried <code>{% for cardC in items.nth(3 )%}</code>.</p>

<p>I get the following <code>**error message**</code>:</p>

<blockquote>
  <p>Impossible to invoke a method ("offset") on an array.</p>
</blockquote>

<p>I created the <code>set</code> because I need to apply templates for the other entries, etc. </p>

<templating><entry><index>
How do I target the 3rd entry and only that entry?
# How do I target the 3rd entry and only that entry?

(Asked by: username_0 on 2018-06-02)

I am trying to build an Index page and assign a specific card template to the 3rd entry and only the 3rd entry. 
{% set items = craft.entries.section('posts').all() %}

{% for cardC in items.offset(2).limit(1) %}

    
        
            
                Marketing
                {{ cardC.title }}
                
                   {{ cardC.introParagraph }}
                
                
                    subject Read Case Study
                
                
                    
                
            
        
    

{% endfor %}

I also tried {% for cardC in items.nth(3 )%}.
I get the following **error message**:

Impossible to invoke a method ("offset") on an array.

I created the set because I need to apply templates for the other entries, etc.

**Tags:** templating, entry, index


---

## 1 answers

### Answer by username_1 on 2018-06-02. Score: 2 | Accepted answer

As soon as you apply .all(), the variable you're working with becomes an array. Which means that the .offset(2) needs to be applied before you convert it into an array.

UPDATE
As @username_2 points out in the comments, it's as easy as grabbing the third item in your array...
items[2]

Ultimately, it looks like you want something like this...
{% set cardC = items[2] %}

{% if cardC %}

    {# ... the rest of your code #}

{% endif %}


ORIGINAL ANSWER
Once it's an array, you'll need to use the Twig syntax instead...
items[2:1]

Which translates to: "get third item (0-based index), limit of one".

> **Comments:**
> **username_0**: should I keep the .all()?  
> **username_1**: You mentioned that you set `items` in order to render multiple entries. If so, then yes... That said, _don't_ apply the offset & limit before the `all` if you intend to use `items` for multiple entries.  
> **username_2**: Do we need `slice` here? Seems like it could just be `items[2]` no?  
> **username_1**: Ahh, good call @username_2! Even I was overcomplicating it.  
> **username_1**: I've updated my answer accordingly.  

---

