I was hoping a fellow Wordpress user could help me out with this PHP function which returns thumbnails for images attached to the post. The function seems to be absolutely impervious to styling and I would very much appreciate any suggestions this thread produces.
What I'm trying to do is display the results inline with a margin-right of 20px. The images themselves are 85x65px.
Here's the PHP code for you Wordpress users:
What I'm trying to do is display the results inline with a margin-right of 20px. The images themselves are 85x65px.
Here's the PHP code for you Wordpress users:
PHP:
<?php
$args = array(
'order' => 'ASC',
'post_type' => 'attachment',
'post_parent' => $post->ID,
'post_mime_type' => 'image',
'post_status' => null,
'numberposts' => -1,
);
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $attachment) {
echo wp_get_attachment_link($attachment->ID, 'thumbnail', false, false);
}
}
?>