getting images from ACF relationship Field
-
Hi,
i use the the Advanced Custom Field Plugin, and want to show articles using the
Field Type “Relation”.
Like shown here:
https://www.advancedcustomfields.com/resources/field-types/relationship/
(Basic loop (without setup_postdata),
and it worked fine in other Projects.Now with Timber i have Problems getting the Featured Image of a blog Post. (and the Permalink as well). All the other Stuff like Title, Excerpt, Date works fine.
here is my Code:
{% set relations = post.get_field('my-custom-fieldname') %} {% for relation in relations %} <div class="span7"> <article class="focus"> <a href="{{relation.post_link}}" > <h2>{{relation.post_title}}</h2> <p class="intro">{{relation.post_content|excerpt(30)}}...</p> <img src="{{relation.post_thumbnail.src}}" alt="" /> <p>{{relation.post_date|date('j.d.Y')}}</p> <p>Article by {{relation.author_name}}</p> </a> </article> </div> {% endfor %}
i tried everything i could find regarding images in timber, but without no luck.
thanks for feedback.
riikk
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘getting images from ACF relationship Field’ is closed to new replies.