This one seems deceptively simple, but I am struggling. My home page is a single, and in that template I want to retrieve the children of a specific entry in a structure, then loop through them. Here is a code example that does not work:
{% set entries = craft.entries.id(4).children %}
{% for entry in entries %}
do something
{% endfor %}
This returns the page with id 4 instead of its children.
I also tried something like:
{% set entries = craft.entries.section('pages').descendantsOf('targetpage') %}
Maybe I need to retrieve the entire section and do a conditional loop for entries where the parent entry ID is 4, but the proper syntax for that eludes me.
Could someone please point me in the right direction? Thanks!