wp_get_attachment_image Error
-
Hi,
I’m currently using the below code to retrieve all images in a gallery that’s related to a post, but at the moment, it only retrieves 5 of the images rather than all of the images, i’m not sure why as there’s no where i can see it’s setting the limit to 5 only.
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?> <table> <tr> <?php function recall($data) { $GLOBALS['d'] = $data; return ''; } ob_start("recall"); the_id(); ob_end_clean(); $args = array( 'order' => 'ASC', 'post_type' => 'attachment', 'post_parent' => $GLOBALS['d'], 'post_mime_type' => 'image', 'post_status' => null, ); $attachments = get_posts($args); if ($attachments) { foreach ($attachments as $attachment) { $imageTitle = $attachment->post_title; $imageDescription = $attachment->post_content; ?> <td valign="top"> <p><?php echo wp_get_attachment_image($attachment->ID, 'large', false); ?></p> <h4><em><?php echo $imageTitle; ?></em></h4> <p><?php echo $imageDescription; ?></p> <?php } ?> </td> <?php } ?> </tr> </table> </div> <?php endwhile; else: ?>
- The topic ‘wp_get_attachment_image Error’ is closed to new replies.