1

I am trying to get a Single. But it doesn't seem to work. Does anyone know what I am doing wrong?

I already double checked the slug, and getting normal channels is also no problem.

This is the code I currently have:

{% set aboutUs = craft.entries.section('about-us').one() %}
2

You need to use the machine name of the section, not the single's slug. Check Settings -> Sections in the backend to find out the machine name. Machine names can't contain hyphens, so about-us isn't a valid machine name (though it is a valid slug). Maybe you're just mixing up about_us with about-us.

1
  • 1
    Thanks for your answer! It's solved now. Jul 19 at 9:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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