Query loop - post type Media

Hello - I’m trying to do a query loop with the post type media selected - I’m struggling figuring out how to show the attachment images - if I put an image element and select dynamic data I don’t see attachment image as a possible option so I was wondering how to set this up.
thanks in advance for your input.

Hi mmj,

You could just use the regular Featured image dynamic data, {featured_image} and the attachment image should show up.

From the academy article:

{featured_image:medium_large} – Renders an image tag with the featured image of size medium_large (defaults to thumbnail size)
{featured_image:large:link} – Renders an image tag with the featured image of size large wrapped by an anchor tag to the post

In the image element inside your query loop, did you add {post_id} as the content source?

2 Likes

thanks for replying - are you basically saying that I can only show featured images using the query loop with post type media selected - I’d like to have a way to show way more than just the featured images?

It’s not just featured image of posts. You are actually looping inside all attachments. You can set Mime type to image to loop through images only. Furthermore, you can assign a custom field to media and do meta query and …
@sridhar I thought that it should work with {featured_image} too, but apparently it’s {post_id} for media, just like maximebeguin mentioned.

1 Like

aah ok. Thanks for the info :slight_smile: