Title: Installation and default instance
Last modified: August 19, 2018

---

# Installation and default instance

 *  Resolved [enseikou](https://wordpress.org/support/users/enseikou/)
 * (@enseikou)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/installation-and-default-instance/)
 * Hello all!
    I’m an amateur sysad working for a nonprofit, just getting started
   with PHP. I’m trying to use this plugin but I’m clueless, because the documentation
   is incomplete and gibberish to me. Apparently, to install it I must “[Implement Attachments in your theme’s _functions.php_ or your own plugin (see Usage)”](https://github.com/jchristopher/attachments/blob/master/docs/installation.md).
   However, the linked page gives no clue on how to “implement” that. It tells you
   how to disable the default instance or customize it, but not how to tell whether
   the default instance has been created automatically or, if not, what piece of
   code you have to add to the file _functions.php_, nor where. On the other hand,
   the instructions on how to modify theme templates, which are the last step, are
   quite complete, but seem insufficient to do the trick. Now my posts only display
   this:
 *     ```
       stdClass Object
       (
           [id] => 1308
           [fields] => stdClass Object
               (
                   [title] => ke0301.pdf
                   [caption] => 
               )
   
           [post_id] => 125
       )
       ```
   
 * Please give me some hint, and complete the documentation.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Finstallation-and-default-instance%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Thread Starter [enseikou](https://wordpress.org/support/users/enseikou/)
 * (@enseikou)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/installation-and-default-instance/#post-10607274)
 * Nevermind, I found out I actually needed to edit the HTML code myself in the 
   template _single.php_ to make a clickable thumbnail. This one worked quite well:
 *     ```
       ?>
       <?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>
               <a href="<?php echo $attachments->url(); ?>" title="<?php echo $attachments->id(); ?>: <?php echo $attachments->field( 'title' ); ?>, <?php echo $attachments->filesize(); ?>" type="<?php echo $attachments->type(); ?>/<?php echo $attachments->subtype(); ?>"><img src="<?php echo $attachments->src( 'full' ); ?>" alt="<?php echo $attachments->field( 'caption' ); ?>"></a>
             </li>
           <?php endwhile; ?>
         </ul>
       <?php endif; ?> 
       <?php
       ```
   
 * You should make your documentation a bit more clear! And with more examples!
    -  This reply was modified 7 years, 9 months ago by [enseikou](https://wordpress.org/support/users/enseikou/).

Viewing 1 replies (of 1 total)

The topic ‘Installation and default instance’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/attachments_fafafa.svg)
 * [Attachments](https://wordpress.org/plugins/attachments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/attachments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/attachments/)
 * [Active Topics](https://wordpress.org/support/plugin/attachments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/attachments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/attachments/reviews/)

## Tags

 * [installation](https://wordpress.org/support/topic-tag/installation/)
 * [instance](https://wordpress.org/support/topic-tag/instance/)

 * 1 reply
 * 1 participant
 * Last reply from: [enseikou](https://wordpress.org/support/users/enseikou/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/installation-and-default-instance/#post-10607274)
 * Status: resolved