Jul 10
5
Listed Related Attachments is a small wordpress widget and shortcode that will list all related attachments for the current post or page. The widget can filter the listed attachments by mime/type such as image, image/png, application/pdf, etc.
If there are any questions, bug reports, additional feature requests or tasty cocktail recipes you wish to share, feel free to leave a comment below.
Change log:
- 18 Nov, 2010 – LRA v1.5
Bug fixes, optimization and added options to the shortcode. - 18 Nov, 2010 – LRA v1.4
Added the option to display title, caption or description of the attachment as the link text in the attachment list. - 17 Nov, 2010 – LRA v1.3
Added order_by and order options to plugin at the request of Mauro (see comment below) - 23 Aug, 2010 – LRA v1.2
Added shortcode at the request of Alekb and Thomas… but mostly Thomas (see comments below) - 8 July, 2010 – LRA v1.1
Replaced mime/type select box with text input field. Plugin now has a home at wordpress.org - 5 July, 2010 – LRA v1.0
Initial release of the Listed Related Attachments widget for WordPress
Upcoming Features:
- Localization & WPML multi-language integration
If you like this why not tweet about it or make a donation? Fill your boots!
This post is also available in: German

I want to quote your post in my blog. It can?
And you et an account on Twitter?
it was very interesting to read.
I want to quote your post in my blog. It can?
And you et an account on Twitter?
is it possible to include this in a template file?
@Alekb: all things are possible with technology…
…so your answer is yes! Just a question or two.
1. as a side bar widget? sure! you can simply create a custom sidebar for your template (ask if you need more direction) and drop the widget in.
2. as part of your template loop? also yes, but you will need to either
a) know a bit of php or..
b) a short code will need to be included as part of the plugin. (update: v1.2 has just such a thing of this sort)
ok, so 2.2 questions. what are you wanting to achieve, exactly? Nice website by with way… is that a wakeboarder behind a friggin’ sail boat?
@radiogrinch: was it? I am happy that you CAN read! sure you can quote the post on your blog. Yes, yes it can. And yeah, I totally “et” an account on Twitter–it is the future, dont’cha know.
@momentofpeace: you sure can, same polprav guy with the same bh9821 gmail acount as @radiogrinch. although you are now called momentofpeace I will always remember you as the radio grinch. such good times we had back in 2010. good luck with your seo spam link farm fun. oh, and I want my black-hat tricksters sweater back, you lazy bum. just kidding! friends? yeah….
hi baden, sorry to not spam you. not everyone can be as eloquent as my predecessor bh9821. just wanted to ask you to tell me how to add the frigin’ shortcode to the plugin, which is such an awsome idea but useless to non-sidebarred websites, like the one i’m sweating on rightnow. can’t congratulate you enough with the work so far, though.
the people have spoken and what they say is “give me some frigin’ short code action.” So, just so keep everyone cool like little fonzies, v1.2 includes shortcodes…. because, well that’s just the way we roll.
Hello! Great Plugin!
I am a dumb with code, can you tell me how can do i apply a to get some more visual air inbetween the titles lines of the attachment list?
I mean the BR tag
@Marceio: I am happy you like the plugin! I believe you want to know how to adjust the space between the items in the list. The widget is placing each item between <li>list item</li> tags. The easiest way to adjust the vertical spacing is by changing the stylesheet.css file in your theme. Add or change the bottom padding for all sidebar widget list items like so:
More information on styling sidebar lists with css can be found at the WordPress Codex.
Hope this helps.
you can add this code to keep the attachments ordered like in the image gallery:
‘orderby’ => ‘menu_order ID’,
‘order’ => ‘ASC’
in the function widget_listattach
tanx for your work
@Mauro: Great Idea! I will add a order by option to the next version and update you when this is ready (the next few days). Glad you like the plugin and thanks for your feedback.
@Mauro: Version 1.5 of the List Related Attachments plugin is ready for download. This version adds the order and displayed text options to both the sidebar widget and the shortcode. I hope this meets your needs. If so, please rate the plugin on the WordPress site. Happy Listing.
I’m noticing that (unrelated) attachments are showing up on a category page, as long as that category of posts is empty. Once category has any posts in it, its’ all good……
@David: Huh. That’s not suppose to do that. We’ll look into that and give you an update when this wonky behavior is corrected. Thanks for the feedback!
Nice plugin! But… is it possible to add the widget to more than 1 widget area? I added it to one and don’t have the possibility to add it to another two…
Nice work.
Is there anyway to add his to the home page to show recent files uploaded?
example: We have a page that shows pdfs of files sent out to parents but would like the home page to show last 5 uploaded.
No need to answer, I fixed it with an ugly hard code hack setting Page ID. Might be a useful feature. No I just need to work out how to only make it show on home page as it’s not working with the “Display widgets” plugin. Once again thanks
@David: Hmmm… couple of things:
1. to only show any widget on the home page, simply create a unique ‘home’ sidebar, and add the widgets to this sidebar.
2. that’s an interesting idea, to give a specific page ID… or even a range of page ID’s to show attachments from.
Regardless, thanks for the feedback, and we’ll keep this in mind for the next release!
“and shortcode that will list all related attachments for the current post or page”
How does one “relate” a PDF to a post?
@Shaun H: Upload it, the same way one would upload an image.