Advertisement
antistandard

Untitled

Oct 6th, 2011
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  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.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement