Home › Forums › General Issues › How can I use Advanced Custom Fields with timber to retrieve Array values? › Reply To: How can I use Advanced Custom Fields with timber to retrieve Array values?
I tried using:
{% for item in post_autor %}
<li><a href="{{ item.user_url }}">{{ item.display_name }}</a></li>
{% endfor %}
for the custom field, but it’s not working.
I also tried:
{% for item in author %}
<li><a href="{{ item.user_url }}">{{ item.display_name }}</a></li>
{% endfor %}
Same result.
On the other hand, when I tried:
<p class="byline">Autor: <a href="{{ post.get_field("post_autor.user_url") }}">{{ post.get_field("post_autor") }}</a></p>
it worked after I settled the type to User Object, but the URL being retrieved is the post’s url instead of the user profile url.
Since there’s too many users being listed as contributors, using “author” won’t work for all of them (I presume).
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.