Thanks for an interesting question. The current MLA version will not support this application directly but I may be able to make a few changes to fix that. The basic approach would be 1) generate a list of the custom post type IDs, then 2) pass the list into [mla_gallery]
as post_parent
values to generate a gallery of those items.
This approach will work if and only if the images within the posts are “attached” to the post, i.e. the post_parent is set correctly. There is no other way to look in the post content and extract the ID of the embedded image (unless you want to write some PHP code).
First, to get the list of post IDs you can use an [mla_gallery]
shortcode with post status and post type parameters, something like this:
[mla_gallery post_type=post post_status=publish post_mime_type=all post_parent=all]
Where post_type
is your custom type. You can add other parameters such as the post date or category to filter the list.
Second (this is the missing part), pass the list of post IDs to a second [mla_gallery]
shortcode that will display a gallery of the images. This would use the “Support for Other Gallery-generating Shortcodes” as described in the Settings/Media Library Assistant Documentation tab. The “grid specifics” could be edited by using MLA’s custom markup and style templates.
The current version won’t support [mla_gallery]
as the alternate shortcode because there’s no easy way to parse out which parameters go to the first shortcode and which go to the second. If this approach looks promising to you I can investigate some way to fix that.
I should note that the current MLA version does support a gallery display that uses the “Featured Image” of a post as the gallery thumbnail. If that would work for you, let me know.
I will leave this topic unresolved until I hear back from you. Thanks for a stimulating idea and for your interest in the plugin.