Hi,
I’m a bit of a WP/PHP newbie. This post has been really helpful, but I’m a bit confused. I need to pull the images from each post individually, but instead of them linking to the actual image itself, I need the image to link to the post that its been pulled from. I’ve been using this bit of code.
<?php
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => $post->ID
);
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $attachment) {
echo apply_filters('the_title', $attachment->post_title);
the_attachment_link($attachment->ID, false);
}
}
?>
I guess I can use <?php the_ID(); ?> to link to the post, but don’t know where it needs to go, or in fact what is generating the link to the image in the first place.
Can anyone help?
Have I made any sense?
Cheers
??