I need to edit the link which is displayed when a single attachment is being displayed – but I don’t know where this link is put together!
Let me explain..
I have a Blog post which has several attachments (images):
I managed to edit the code so every image links to a page where the image itself is displayed:
Now the question for me is, how or where do I find the code which is used to create the last link, that is being opened when I click on this single image (and which leads to the upload folder and the image itself):
I need to edit this behavior, so it still displays the image from upload folder, but links to an external side.
I can’t find where the imagelink is being created. I got as far as
<?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?>
Which is the part that displays the image, bvut I can’t find the_content function.
Besides, the code which is used to create the attachment links to each single image looks like this:
<?php echo '<a class="postImg" href="' . get_permalink( $attachment->ID ) . '" title="' . esc_attr( sprintf( __( 'View' ), $att_title ) ) . '" rel="permalink">'; ?> <img width="<?php echo $image_attributes ?>" height="<?php echo $image_attributes ?>" src="<?php echo wp_get_attachment_url( $attachment->ID , false ); ?>" alt="<?php the_title(); ?>" width="280" border="0" /></a>
I am new to WordPress and pretty new to PHP, too – so please forgive my stupidness!