WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't 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.

Attachment Gallery

Shortcode providing thumbnail gallery of items attached to the current post (i.e. PDFs).

What attachment types are supported for thumbnailing?

Currently only PDFs are supported, but we are able to expand this easily on request. Immediate upcoming considerations would be document types such as Word, Excel, Powerpoint and their open source equivalents, along with bitmap image formats such as JPG, PNG, TIFF, and BMP, and vector image formats such as PSD and SVG.

How does Attachment Gallery affect WordPress

Most of Attachment Gallery's functionality is provided as template options. However, we do add to the image_downsize filter, which provides thumbnailing for the types we support (i.e. PDF).

This means that standard WordPress themes like twentyten will show thumbnails on attachment galleries as these pages, if thumbnailable will be shown as if they were normal image attachments.

What options are available in the shortcode?

  • linktopage - if set, links attachments in the gallery to their own attachment page, rather than the file itself
  • size - thumbnail size for the gallery
  • grid - whether to show attachments in a grid form using CSS float property
  • metareplace - allows meta data from the attachment to be replaced by metadata from wordpress. Normally they will both be shown.

For instance:

[attachmentgallery download="yes" linktopage="yes" size="100x150" metareplace="description=Subject"]

How can I style the Galleries?

You can style them with the CSS classes attachment_gallery, attachment_gallery_item, attachment_gallery_item_title etc, as so:

.attachment_gallery{
    background-color:#eee;
    border:solid 1px #888;
    padding:10px;
}
.attachment_gallery_item{
    background-color:#fff;
    border:solid 1px #888;
    padding:10px;
}
.attachment_gallery_item_download{
    text-align:right;
    display:block;
    width:100%;
    margin:5px;
}
.attachment_gallery_item_thumbnail{
    border:solid 1px #ccc;
    float:left;
    margin-right:10px;
    width:100px;
}

Can I change the order of the HTML gallery elements?

Not yet, though please get in touch if you'd find this useful.

What does the actual output HTML look like?

Like this:

<div class="attachment_gallery">
        <div class="attachment_gallery_item">
            <div class="attachment_gallery_item_thumbnail">
                <a href="http://example.com/my.pdf">
                    <img src="http://example.com/my.pdf/attachment-gallery/thumbnail.php?size=100&file=http://example.com/my.pdf" /> 
                </a>
            </div>
            <a href="http://example.com/my.pdf">
                PDF Title
            </a>
            </div>
            <dl class="attachment_gallery_meta attachment_gallery_meta_title"> 
                <dt>Title</dt>
                <dd><div class="nl">Title extracted from PDF</div></dd> 
            </dl>
            <dl class="attachment_gallery_meta attachment_gallery_meta_subject"> 
                <dt>Subject</dt> <dd><div class="nl">Subject extracted from PDF</div></dd>
            </dl>
            <div class="attachment_gallery_item_download">
                <a href="http://example.com/my.pdf">Download Now</a> 
            </div> 
        </div>
    </div>

Requires: 2.5 or higher
Compatible up to: 3.0.5
Last Updated: 2010-5-24
Downloads: 3,144

Ratings

3 stars
3.3 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

0,1,0
100,1,1
0,2,0