• I have a child theme for Twenty Ten, and I have a copy of the loop.php file in my child theme’s folder. Is that where I put the code for the attachments plugin?

    <?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>
          <?php endfor; ?>
          </ul>
        <?php endif; ?>
    <?php } ?>

    In what part of the file should I put the code? Any help would be greatly appreciated.

  • The topic ‘Where to put code in my template’ is closed to new replies.