Thanks for this question. It sounds like you would like to use the [mla_gallery]
shortcode to display a “gallery” with the most recent PDF document, filtered by a partial name – is that right?
Here is an example to get you started:
[mla_gallery orderby=date order=DESC numberposts=1 s=raft post_mime_type=application/pdf size=icon link=file]
In this example, orderby=date order=DESC numberposts=1
will sort the search results by upload date in descending order and then show only one result, the most recent or latest one. The post_mime_type=application/pdf
parameter restricts the search to PDF documents.
The s=raft
parameter answers your “slightly different names” question. The search function automatically adds the wildcard specification, so “raft” will match, for example, “rafting”. Note that each word in the search specification is independent, so s="the raft"
would match “these rafts”. You can find more information in the Codex entry for WP_Query under “keyword search”.
I’ve added size=icon
, which displays a PDF icon as the gallery thumbnail. You could code size=none
or omit the parameter to use the title of the document as the “thumbnail”. I’ve also added link=file
so clicking on the thumbnail will download the PDF document immediately. There are many [mla_gallery]
parameters for specifying what the display contains.
I hope that answers your question and meets your needs. I’m going to mark this issue resolved for now, but please let me know if you have any problems or further questions. I’m traveling until September 10, so there may be a delay in my responding. Thanks for your interest, your understanding and your patience. Enjoy the plugin.