It appears that getting a entry that is a single is more tricky that it should be.

This works,


This does not work,


This does not work,


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

1 Answer 1


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. 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.

  • 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? Feb 9, 2017 at 21:04
  • @NathanDHuening: Might want to post that as a separate question. Feel free to link back to this thread for reference.
    – Lindsey D
    Feb 9, 2017 at 21:31
  • 1
    In Craft CMS 4.x first() is not defined, you have to use one() instead.
    – muffir
    Mar 6 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.