List Attachments Shortcode

Adds a shortcode to display a list of files attached to a post.

Author:Curtiss Grymala (profile at wordpress.org)
WordPress version required:3.0
WordPress version tested:3.5.1
Plugin version:0.4.1a
Added to WordPress repository:19-01-2011
Last updated:29-01-2013
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:0
Rated by:0
Plugin URI:http://plugins.ten-321.com/category/list-atta...
Total downloads:4 358
Active installs:50+
plugin download
Click to start download

This WordPress plug-in allows users to easily list all of the attachments associated with a specific post or page within WordPress. For instance, if you want to create a long list of Word documents or PDF documents, you can simply attach them to the page or post, then insert the shortcode where you'd like that list to appear.

Usage

The simplest way to use this plug-in is just to use the shortcode. That will, by default, list the attachments with the most recent upload at the top of the list and the oldest upload at the end of the list. No heading will be included above the list. The list will be created as an unordered list with the CSS class of "attachment-list".

[list-attachments]

Options

  • type - a comma-separated list of file extensions that should be included in the list. If this is left empty, all attachments will be included orderby - any of the values that can be used with the WordPress query_posts() function
  • order - indicate whether the list should be sorted in ascending or descending order
  • groupby - if you would like the list split into specific groups, you can indicate any of the WordPress post object parameters as the value of this property. For instance, you can use a common "description" for your attachments to organize them into groups. In that case, you would use "post_content" as the "groupby" parameter for this shortcode
  • before_list - any HTML code you want to appear before the list begins opening - the opening tag(s) for the list (defaults to <ul class="attachment-list">)
  • closing - the closing tag(s) for the list (defaults to </ul>)
  • before_item - the opening tag(s) for each item of the list (defaults to <li>)
  • after_item - the closing tag(s) for each item of the list (defaults to </li>)

This is the first version of this plug-in, so I'm certain there are a lot of features that still need to be added and bugs that need to be worked out. If you try out the plug-in and have any suggestions or notice any issues, please comment on this post and let us know.


ChangeLog