Support

Account

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).