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

Untitled

By: antistandard on Oct 6th, 2011  |  syntax: None  |  size: 0.80 KB  |  views: 248  |  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. /*-----------------------------------------------------------------------------------*/
  2. /*      Photos
  3. /*-----------------------------------------------------------------------------------*/
  4.  
  5. if ( function_exists( 'add_image_size' ) ) {
  6.         add_image_size('second_thumb_event', 150, 100, true );
  7. }
  8.  
  9. function photos() {
  10. $images = get_children(array('post_parent' => get_the_ID(),'post_type' => 'attachment','numberposts' => $qty,'post_mime_type' => 'image',));
  11.  
  12. foreach( $images as $image ) :
  13. $attachmenturl=wp_get_attachment_url($image->ID);
  14. $attachmentimage=wp_get_attachment_image( $image->ID, 'second_thumb_event' );
  15. if ($src[0]!=$attachmenturl):
  16. echo '<a rel="prettyPhoto[gallery]" href="'.$attachmenturl.'" >'.$attachmentimage.'</a>' ;
  17. endif;
  18. endforeach;
  19. }
  20.  
  21. add_shortcode( 'photo_gallery', 'photos' );
  22.  
  23.