Hi,
My code for post-item.html.twig can be found here
So I am attempting to show the first image in the blog post on the screen above, hence, I have included {% set blog_image= page.media.images|first %}. However, I am unsure of how to call on this in the , and no image is showing up.
Moreover, it seems that there is something wrong with my YAML Front Matter as I specify the Page Author {{ page.header.author }}, however when it displays on the site (as shown in the image) it shows nothing, despite me adding an author in the post.md
as you are in a for loop, you have to use the variable you defined, in this case post.
Example:
{% for post in page.children %}
{{post.title }}
{{ post.header.author }}
{{ post.media.images|first }} {# will display the img tag #}
<img src="{{ post.media.images|first.url}}"
{% endfor %}