Languages: English • Italiano • attachment link 日本語 (Add your language)
Outputs an HTML hyperlink to an attachment file or page, containing either
If no attachment can be found, the function displays the string Missing Attachment.
<?php the_attachment_link( $id, $fullsize, $deprecated, $permalink ); ?>
<?php the_attachment_link( 7 ); ?>
<?php // Show an image at full size linked to the attachment file the_attachment_link( 4, true ); // Show a thumbnail linked to the attachment page the_attachment_link( 4, false, false, true ); ?>
Use wp_get_attachment_link() instead if you just want to get the hyperlink, not print it.
Since: 2.0.0
the_attachment_link() is located in wp-includes/post-template.php
.
Attachment Functions:
get_children(), get attached media(), the_attachment_link(), get_attachment_link(), wp_get_attachment_link(), wp_get_attachment_image(), wp_get_attachment_image_src(), wp_get_attachment_url(), wp_get_attachment_thumb_file(), wp_get_attachment_thumb_url(), is_attachment(), wp_get_attachment_metadata()