Created
December 5, 2012 17:04
-
-
Save jchristopher/4217483 to your computer and use it in GitHub Desktop.
Attachments - Retrieve Attachments Data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $attachments = new Attachments( 'attachments' ); ?> | |
<?php if( $attachments->exist() ) : ?> | |
<h3>Attachments</h3> | |
<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: Name: <?php echo $attachments->field( 'caption' ); ?> | |
</li> | |
<?php endwhile; ?> | |
</ul> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment