Own Dynamic Data Tag works in Text element, but not as a parameter in a query loop

Just to close this thread.

I achieved what I was trying to do with good old ACF.

I added an ACF field to the page, made a custom query in which I read that ACF field with the code get_field(‘field name’, the ID of the page) and use the value from the ACF field as a parameter in the query args.

The key was to read the ACF field with the Page ID because with this, the value of the field is always available even within a query loop of posts.

Cheers

Patric

1 Like