I've just started using the attachment.php template on my site. What I'd like to do is redirect all images in posts that used 'file url' to 'post url' and my new attachment.php template.
Is this possible?
Thanks in advance for any help.
EB
I've just started using the attachment.php template on my site. What I'd like to do is redirect all images in posts that used 'file url' to 'post url' and my new attachment.php template.
Is this possible?
Thanks in advance for any help.
EB
Link to the image file using wp_get_attachment_link( $id, $size, $permalink, $icon, $text )
:
$id
is the attachment ID, which, if using attachment.php
, will simply be $post->ID
$size
is the image size, e.g. full
, large
, medium
, thumbnail
$permalink
determines whether a link to the file or post is returned. Use false
(which is the default) to link to the file$icon
refers to a mime-type icon. Leave false
, which is default$text
displays a text link. Leave false
, which is defaultthe_content()
, in attachment.php
Commented
Aug 10, 2011 at 11:44
Take a look at the solution on the WordPress Support Forum: http://wordpress.org/support/topic/redirect-attachment-page-to-post-page-how-to