Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*-----------------------------------------------------------------------------------*/
- /* Photos
- /*-----------------------------------------------------------------------------------*/
- if ( function_exists( 'add_image_size' ) ) {
- add_image_size('second_thumb_event', 150, 100, true );
- }
- function photos() {
- $images = get_children(array('post_parent' => get_the_ID(),'post_type' => 'attachment','numberposts' => $qty,'post_mime_type' => 'image',));
- foreach( $images as $image ) :
- $attachmenturl=wp_get_attachment_url($image->ID);
- $attachmentimage=wp_get_attachment_image( $image->ID, 'second_thumb_event' );
- if ($src[0]!=$attachmenturl):
- echo '<a rel="prettyPhoto[gallery]" href="'.$attachmenturl.'" >'.$attachmentimage.'</a>' ;
- endif;
- endforeach;
- }
- add_shortcode( 'photo_gallery', 'photos' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement