/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php function postimage($size=thumbnail, $qty=-1) { '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, $size ); echo '<li><a href="'.$attachmenturl.'" rel="shadowbox[photos]">'.$attachmentimage.'</a></li>' . "\n"; } } else { echo "No Image"; } } ?>