Languages: English • Italiano • attachment 日本語 (Add your language)
This Conditional Tag checks if an attachment is being displayed. An attachment is an image or other file uploaded through the post editor's upload utility. Attachments can be displayed on their own 'page' or template. For more information, see Using Image and File Attachments.
This is a boolean function, meaning it returns either TRUE or FALSE.
<?php is_attachment(); ?>
<?php if ( is_attachment() ) { // show adv. #1 } else { // show adv. #2 } ?>
Since: 2.0.0
is_attachment() is located in wp-includes/query.php
.