Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //IMAGE ATTACHMENTS TOOLBOX
- function attachment_toolbox($size = thumbnail) {
- if($images = get_children(array(
- 'post_parent' => get_the_ID(),
- 'post_type' => 'attachment',
- 'numberposts' => -1, // show all
- 'post_status' => null,
- 'post_mime_type' => 'image',
- 'orderby' => 'menu_order'
- ))) {
- foreach($images as $image) {
- $attimg = wp_get_attachment_image($image->ID,$size);
- $atturl = wp_get_attachment_url($image->ID);
- $attlink = get_attachment_link($image->ID);
- $postlink = get_permalink($image->post_parent);
- $atttitle = apply_filters('the_title',$image->post_title);
- /*
- echo '<p><strong>wp_get_attachment_image()</strong><br />'.$attimg.'</p>';
- echo '<p><strong>wp_get_attachment_url()</strong><br />'.$atturl.'</p>';
- echo '<p><strong>get_attachment_link()</strong><br />'.$attlink.'</p>';
- echo '<p><strong>get_permalink()</strong><br />'.$postlink.'</p>';
- echo '<p><strong>Title of attachment</strong><br />'.$atttitle.'</p>';
- echo '<p><strong>Image link to attachment page</strong><br /><a href="'.$attlink.'">'.$attimg.'</a></p>';
- echo '<p><strong>Image link to attachment post</strong><br /><a href="'.$postlink.'">'.$attimg.'</a></p>';
- echo '<p><strong>Image link to attachment file</strong><br /><a href="'.$atturl.'">'.$attimg.'</a></p>';
- */
- echo'<li class="wrapperli"><a title="'.$atttitle.'" href="'.$atturl.'">'.$attimg.'</a></li>';
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement