Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $attachments = wpfu_get_attachments( $post->ID );
- if ( $attachments ) {
- $attach = '<ul class="wpuf-attachments">';
- foreach ($attachments as $file) {
- //if the attachment is image, show the image. else show the link
- if ( wpuf_is_file_image( $file['url'], $file['mime'] ) ) {
- $thumb = wp_get_attachment_image_src( $file['id'] );
- $attach .= sprintf( '<li><a href="%s"><img src="%s" alt="%s" /></a></li>', $file['url'], $thumb[0], esc_attr( $file['title'] ) );
- } else {
- $attach .= sprintf( '<li><a href="%s" title="%s">%s</a></li>', $file['url'], esc_attr( $file['title'] ), $file['title'] );
- }
- }
- $attach .= '</ul>';
- echo $attach;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement