<p><strong>The first example you showed is the exact right way to do it.</strong></p>

<p>The second &amp; third examples you showed will technically work, but return an array of entries. Your single would be the only entry inside that array.</p>

<p>In your second &amp; third examples, you're dealing with an <a href="https://craftcms.com/docs/templating/elementcriteriamodel">ElementCriteriaModel</a>. You can append several methods to an ECM to generate results from it...</p>

<ul>
<li><code>first()</code> - Returns an individual Entry (in this case your Single)</li>
<li><code>find()</code> - Returns an array of matching entries</li>
<li><code>ids()</code> - Returns an array of entry IDs</li>
<li><code>total()</code> - Returns a number (total matches)</li>
<li><code>last()</code> - Opposite of <code>first()</code></li>
<li><code>nth()</code> - Returns an individual Entry</li>
</ul>

<p><strong>Important to note...</strong> If you don't specify one of these methods, then <code>find()</code> will be automatically applied when it's used as an array.</p>

CC BY-SA 3.0
2017-02-09T21:04:54.307Z
Thanks for the detailed answer, and for providing additional context beyond the OP's question. If the 2nd & 3rd examples return an array, would `craft.entries.section('footer')[0]` work?
Nathan D Huening
CC BY-SA 3.0
2017-02-09T21:31:52.920Z
@NathanDHuening: Might want to post that as a separate question. Feel free to link back to this thread for reference.
Lindsey D
CC BY-SA 4.0
2024-03-06T13:01:17.960Z
In Craft CMS 4.x `first()` is not defined, you have to use `one()` instead.
muffir
CC BY-SA 3.0
2016-07-26T23:10:43.827Z
2016-07-26T23:10:43.827Z
Lindsey D
<p>It appears that getting a entry that is a single is more tricky that it should be.</p>

<p>This works,</p>

<pre><code>craft.entries.section('footer').first()
</code></pre>

<p>This does not work,</p>

<pre><code>craft.entries.section('footer').limit(1)
</code></pre>

<p>This does not work,</p>

<pre><code>craft.entries.section('footer')
</code></pre>

<p>Does any one know of any documentation that lays out the usage of when to use limit, nothing, and first()? Seems very confusing. </p>

<templating><entries>
Getting a Single
# Getting a Single

(Asked by: username_0 on 2016-07-26)

It appears that getting a entry that is a single is more tricky that it should be.
This works,
craft.entries.section('footer').first()

This does not work,
craft.entries.section('footer').limit(1)

This does not work,
craft.entries.section('footer')

Does any one know of any documentation that lays out the usage of when to use limit, nothing, and first()? Seems very confusing.

**Tags:** templating, entries

---

## 1 answers

### Answer by username_1 on 2016-07-26. Score: 9 | Accepted answer

**The first example you showed is the exact right way to do it.**

The second & third examples you showed will technically work, but return an array of entries. Your single would be the only entry inside that array.

In your second & third examples, you're dealing with an [ElementCriteriaModel](https://craftcms.com/docs/templating/elementcriteriamodel). You can append several methods to an ECM to generate results from it...

* `first()` - Returns an individual Entry (in this case your Single)
* `find()` - Returns an array of matching entries
* `ids()` - Returns an array of entry IDs
* `total()` - Returns a number (total matches)
* `last()` - Opposite of `first()`
* `nth()` - Returns an individual Entry

**Important to note...** If you don't specify one of these methods, then `find()` will be automatically applied when it's used as an array.

> **Comments:**
> **username_2**: Thanks for the detailed answer, and for providing additional context beyond the OP's question. If the 2nd & 3rd examples return an array, would `craft.entries.section('footer')[0]` work?  
> **username_1**: @NathanDHuening: Might want to post that as a separate question. Feel free to link back to this thread for reference.  
> **username_3**: In Craft CMS 4.x `first()` is not defined, you have to use `one()` instead.  

---

