0

I have 4 fields in my section:

-Images

-Videos

-GIFs

-PNGs

On my homepage, I have a section where I have to show 5 latest entries of Images, Videos, GIFs & PNGs. How can I do that ?

I tried:

 {{set entries = craft.entries.section('works').order('fieldname desc').limit(5) }}

But that didn't work. Please Help. Thanks in advance !!

2

Looks like you're trying to echo out the results using {{ instead of actually setting it using %} tags.

{% set entries = craft.entries.section('works').order('fieldname desc').limit(5) %}

{% for entry in entries %}
   {{ entry.title }}
{% endfor %}

This should fix your problem.

|improve this answer|||||

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.