Permalink in attachment page
-
Hi.
I have a custom attachment page where i show one image in its large size, on that page i only display the header/footer and image. But i want to add a link back to the original post.
I have tried with
<?php echo $permalink; ?>
but that retrieves the attachment URL, so the question is how to retrieve the post where the image comes from?The code im using to retrive the images in the attachment page is:
<?php if (wp_attachment_is_image($post->id)) { $att_image = wp_get_attachment_image_src( $post->id, "large"); ?> <p> <img src="<?php echo $att_image[0];?>" alt="<?php the_title(); ?>" /> </p> <?php } ?>
You could see an example of my attachment page here
https://www.arquitour.com/casa-torres-glr-arquitectos/2010/01/torreshouse-8/
Thanks for your help.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Permalink in attachment page’ is closed to new replies.