Where to put code in my template (1 post)

  1. traceelements
    Posted 4 years ago #

    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?

      if( function_exists( 'attachments_get_attachments' ) )
        $attachments = attachments_get_attachments();
        $total_attachments = count( $attachments );
        if( $total_attachments ) : ?>
          <?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; ?>
        <?php endif; ?>
    <?php } ?>

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Attachments
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic