Support » Plugin: Attachments » Attachments doesn't appear in my theme

Viewing 2 replies - 1 through 2 (of 2 total)
  • You will need to edit your theme files where applicable.

    Here is a basic implementation:

    <?php
      if( function_exists( 'attachments_get_attachments' ) )
      {
        $attachments = attachments_get_attachments();
        $total_attachments = count( $attachments );
        if( $total_attachments ) : ?>
          <ul>
          <?php for( $i=0; $i<$total_attachments; $i++ ) : ?>
            <li><?php echo $attachments[$i]['title']; ?></li>
            <li><?php echo $attachments[$i]['caption']; ?></li>
            <li><?php echo $attachments[$i]['id']; ?></li>
            <li><?php echo $attachments[$i]['location']; ?></li>
            <li><?php echo $attachments[$i]['mime']; ?></li>
            <li><?php echo $attachments[$i]['filesize']; ?></li>
          <?php endfor; ?>
          </ul>
        <?php endif; ?>
    <?php } ?>
    Plugin Author Jonathan Christopher

    (@jchristopher)

    Thanks so much for posting that snippet, Lukis!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Attachments doesn't appear in my theme’ is closed to new replies.