Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Attachment hook in single.php

By: a guest on Jan 9th, 2013  |  syntax: None  |  size: 0.38 KB  |  views: 44  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.                 <?php
  2.                 $args = array('post_type' => 'attachment','post_mime_type' => 'image' ,'post_status' => null, 'post_parent' => $post->ID);
  3.                 $attachments = get_posts($args);
  4.                 if ($attachments) {
  5.                 ?>
  6.                 <div id="galleryToggle" class="toggleButton closed"><span>+</span>Gallery</div>
  7.                 <ul class="galleryBox">
  8.                 <?php attachment_toolbox('small'); ?>
  9.         </ul>
  10.                 <?php } ?>
clone this paste RAW Paste Data