Developers
jchristopher |
Download Stats
Today | 28 |
Yesterday | 61 |
Last Week | 293 |
All Time | 219,542 |
Extensive usage instructions are available on GitHub
Attachments allows you to simply append any number of items from your WordPress Media Library to Posts, Pages, and Custom Post Types.
Extend Attachments with add-ons
This plugin does not directly interact with your theme, you will need to edit your template files. If you prefer working with a UI, take a look at Attachments UI
Associate Media items with posts
The idea behind Attachments is to give developers the ability to directly associate Media items with any post. This is accomplished by adding a meta box to post edit screens as determined by the developer. Once Media items have been associated with a post, you're able to retrieve those Attachments and include them directly within your template files using any specific markup you wish.
Integrate Attachments within your theme with fine grained control
Attachments does not automatically integrate itself with your theme. Since the idea behind Attachments is to allow integration of Media within posts using developer-crafted, unique markup, it's up to you to integrate with your theme. The most basic integration includes editing the appropriate template file and adding your call(s) to Attachments. For example, if you have set up Attachments to be used with your Posts entries, edit single.php
to include the following within The Loop:
<?php $attachments = new Attachments( 'attachments' ); /* pass the instance name */ ?>
<?php if( $attachments->exist() ) : ?>
<h3>Attachments</h3>
<p>Total Attachments: <?php echo $attachments->total(); ?></p>
<ul>
<?php while( $attachments->get() ) : ?>
<li>
ID: <?php echo $attachments->id(); ?><br />
Type: <?php echo $attachments->type(); ?><br />
Subtype: <?php echo $attachments->subtype(); ?><br />
URL: <?php echo $attachments->url(); ?><br />
Image: <?php echo $attachments->image( 'thumbnail' ); ?><br />
Source: <?php echo $attachments->src( 'full' ); ?><br />
Size: <?php echo $attachments->filesize(); ?><br />
Title Field: <?php echo $attachments->field( 'title' ); ?><br />
Caption Field: <?php echo $attachments->field( 'caption' ); ?>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
That snippet will request all of the existing Attachments defined for the current Post within The Loop, and retrieve each itemized property for that Attachment. Using the provided details you're able to integrate the attached Media items in any way you please.
There is a lot more information on Attachments' GitHub page. Please contribute!
Releases (61 )
Version | Release Date | Change Log |
---|---|---|
3.5.9 | 2017-10-11 |
|
3.5.7 | 2015-07-06 |
|
3.5.6 | 2015-07-02 |
|
3.5.5 | 2015-04-21 |
|
3.5.4 | 2014-04-09 |
|
3.5.3 | 2013-10-25 |
|
3.5.2 | 2013-09-27 |
|
3.5.1.1 | 2013-05-20 |
|
3.5.1 | 2013-05-20 |
|
3.5 | 2013-05-13 |
|
3.4.2.1 | 2013-04-05 | = 3.0 = Now piggybacking the awesome Media workflow introduced in WordPress 3.5 |
3.4.2 | 2013-04-05 | = 3.0 = Now piggybacking the awesome Media workflow introduced in WordPress 3.5 |
3.4 | 2013-03-07 | = 3.0 = Now piggybacking the awesome Media workflow introduced in WordPress 3.5 |
3.3.3 | 2013-02-05 |
|
3.3.2 | 2013-01-25 |
|
3.3.1 | 2013-01-18 |
|
3.3 | 2013-01-18 |
|
3.2 | 2013-01-17 |
|
3.1.4 | 2013-01-09 |
|
3.1.3 | 2013-01-05 |
|
3.1.2 | 2013-01-04 |
|
3.1.1 | 2013-01-04 |
|
3.1 | 2013-01-04 |
|
3.0.8.2 | 2012-12-23 | = 3.0 = You will need to update your theme files that use Attachments 3.0. Version 1.x of Attachments has been fully deprecated but is still available. If you would like to continue to use the (no longer supported) 1.x version you may add the following to your wp-config.php:
Version 3 is a major rewrite. While I've taken precautions in ensuring you won't lose any saved data it is important to back up your databse prior to upgrading in case something goes wrong. This version is a complete rewrite so all legacy data will be left in place, but a migration must take place to match the new data storage model and workflow. = 1.0.8 = As always, be sure to back up your database and files before upgrading. = 1.0.7 = Attachments are now stored in such a way that removes an in-place limitation on string lengths for both titles and captions. |
3.0.8.1 | 2012-12-22 |
|
3.0.8 | 2012-12-22 |
|
3.0.7 | 2012-12-21 |
|
3.0.6 | 2012-12-21 |
|
1.6.2.1 | 2012-07-18 |
|
1.6.2 | 2012-07-17 |
|
1.6.1 | 2012-01-22 |
|
1.6 | 2011-12-13 |
|
1.5.10 | 2011-11-14 |
|
1.5.9 | 2011-09-29 |
|
1.5.8 | 2011-09-05 |
|
1.5.7 | 2011-08-28 |
|
1.5.6 | 2011-08-14 |
|
1.5.5 | 2011-08-14 | Re-implemented bulk Attach |
1.5.4 | 2011-08-13 |
|
1.5.3.2 | 2011-06-06 | = 1.0.8 = As always, be sure to back up your database and files before upgrading. = 1.0.7 = Attachments are now stored in such a way that removes an in-place limitation on string lengths for both titles and captions. |
1.5.3.1 | 2011-06-04 |
|
1.5.3 | 2011-06-03 |
|
1.5.2 | 2011-02-28 |
|
1.5.1.2 | 2010-12-06 |
|
1.5.1.1 | 2010-10-25 |
|
1.5.1 | 2010-10-13 |
|
1.5 | 2010-10-11 |
|
1.1.1 | 2010-09-21 |
|
1.1 | 2010-09-03 |
|
1.0.9 | 2010-08-08 |
|
1.0.8 | 2010-07-02 |
|
1.0.7.1 | 2010-03-21 |
|
1.0.7 | 2010-03-08 |
|
1.0.5 | 2010-01-02 |
|
1.0.4.2 | 2009-12-08 | |
1.0.4.1 | 2009-12-07 |
|
1.0.4 | 2009-11-27 |
|
1.0.3 | 2009-11-04 |
|
1.0.2 | 2009-11-02 |
|
1.0.1 | 2009-11-02 |
|
1.0 | 2009-11-02 |
= |