Recent post gallery?
-
Is there a way to make a MLA gallery where the thumbnails are actually recent post featured images in a given category, and it links to this post?
Not an intended use of MLA, I’m guessing, but with all the buggy recent post plugins that have failed me, I would love for MLA to be able to do this!
Thanks,
Sam
-
Thanks for your question. I am traveling for a few days and away from my development/test system. I will investigate this issue as soon as I can and post an update here when I have progress to report.
Thanks for your patience and understanding.
No problem, it’s a bit of a stretch this request… whenever you get a chance, thanks!
SamThanks for your patience in awaiting a response!
I am happy to report that the current MLA version will support your application. You can use something like this:
[mla_gallery category=general post_type=post post_status=publish post_mime_type=all post_parent=all orderby="date DESC" numberposts=6]The
orderby="date DESC" numberposts=6portion of the shortcode gives you the “recent posts”. You can use any data selection parameter you like in place ofcategory=general. Look at the “Category Parameters” section of the Settings/Media Library Assistant Documentation tab for more options. Thepost_mime_type=all post_parent=allparameters override default settings designed for image galleries.The
post_type=post post_status=publishparameters are the key. You can find more information about them in the “Post Type, Post Status” section of the Documentation tab.You might want to add
mla_caption="{+title+}"to replace the post excerpt with the post title as the caption for each gallery item.I hope that gets you started on a display that works for your application. I am marking this topic resolved, but please update it if you have any problems or further questions regarding the above suggestions. Thanks again for your patience and your interest in the plugin.
That all worked great! I’ve been searching for a clean way to list posts for a long time, meanwhile it was just there right in front of me! The cherry on top would be pagination, I wouldn’t expect this would be possible, but thought I’d ask anyway…
Thanks!
SamThanks for your update with the good news and the pagination request. Adding pagination is simple; add a second shortcode to the page with an
mla_outputparameter:[mla_gallery category=general post_type=post post_status=publish post_mime_type=all post_parent=all orderby="date DESC" mla_caption="{+title+}" numberposts=3] [mla_gallery category=general post_type=post post_status=publish post_mime_type=all post_parent=all orderby="date DESC" mla_output="paginate_links,prev_next" numberposts=3]The
mla_outputparameter replaces themla_captionparameter (pagination controls have no caption). Thenumberposts(orposts_per_page) parameter divides the gallery into pages. Make sure you have exactly the same data selection and sort parameters in both shortcodes.There are several different types of pagination controls for you to use. Have a look through the “Support for Alternative Gallery Output, e.g., Pagination” section of the Settings/Media Library Assistant Documentation tab for more details and examples.
Awesome, MLA continues to amaze me!
Here is the page I’ve got it on: https://tall.life/tall-mens-clothing/
Is there any way to decrease the white space between pagination and gallery? Lastly, I don’t suppose there is a way to do gallery page changes without a page refresh?Thanks,
SamThanks for the kind words and for the link to your page.
You wrote “Is there any way to decrease the white space between pagination and gallery?” This depends on your markup and on the styles your theme uses. I had some luck on my system by putting both shortcodes on one line, i.e.:
[mla_gallery category=general post_type=post post_status=publish post_mime_type=all post_parent=all orderby="date DESC" mla_caption="{+title+}" numberposts=3][mla_gallery category=general post_type=post post_status=publish post_mime_type=all post_parent=all orderby="date DESC" mla_output="paginate_links,prev_next" numberposts=3]Here’s a CSS trick that works on my system:
[mla_gallery category=general post_type=post post_status=publish post_mime_type=all post_parent=all orderby="date DESC" mla_caption="{+title+}" numberposts=3] <p style="position: relative; top: -20px">[mla_gallery category=general post_type=post post_status=publish post_mime_type=all post_parent=all orderby="date DESC" mla_output="paginate_links,prev_next" numberposts=3]</p>You could also try putting the pagination above the gallery.
You asked “I don’t suppose there is a way to do gallery page changes without a page refresh?” I regret that there is no way I know of in the current MLA version to accomplish that, and the work required to do it in a general way is more than I can take on at this time.
Thanks again for an interesting question and for working with me to refine it. Good luck with your application.
Everything works great, case closed!
Thanks again!
Sam
The topic ‘Recent post gallery?’ is closed to new replies.