Thanks for your question and for including the source code excerpt.
MLA emulates the WordPress [gallery] shortcode and uses the WordPress wp_get_attachment_link() function to compose the <img> tag. I discovered that if you add a size=full parameter to your [mla_gallery shortcode it will generate a srcset attribute (like [gallery] does).
Give that a try and see if it helps in your application. I haven’t considered adding more srcset support but I am open to ideas for future MLA versions.
I will leave this topic unresolved until I hear back from you. Thanks for your interest in the plugin.
Hello David,
Thanks very much for your response.
I am working on an image-centered photo site and my main concern was more flexibility in the generation of larger, one column, mixed orientation galleries. At the time I wrote my main concern was to make vertical images better fit the screen while keeping the same column wide enough for the alternating horizontals. I have actually found a fix for that, which may be of help to others. It actually makes the images responsive:
img.attachment-large {
max-height: 80vh;
width:auto;
}
Interestingly, this solution will not work on "full" images. I am able to get the srcset to appear in "full" as well, but it appears to me that only the full size image will be served. If srcset support is ever possible, it would be a huge benefit to serve smaller images as needed.
Again, thanks for your reply.
Steve
Thanks for your update with the good news and for taking the time to post the solution you worked out; very helpful.
I will study up on srcset/sizes support and see what I can do to improve using them in [mla_gallery]. I will leave this topic unresolved until I decide what to do. Thanks for raising the topic and for your interest in the plugin.
I have done more testing with WordPress 4.6. It looks like the WordPress wp_get_attachment_link() function now generates srcset and sizes attributes in the <img > tags for [gallery] and [mla_gallery] items for all of the available sizes.
I am marking this topic resolved, but please update it if your have any problems or further questions regarding [mla_gallery] support for srcset/sizes. Thanks for your patience.