is_attachment
is_attachment ( $attachment = '' )
Parameters:- (int|string|int[]|string[]) attachment Optional. Attachment ID, title, slug, or array of such to check against. Default empty.
Returns:- (bool) Whether the query is for an existing attachment page.
Defined at: - Introduced in WordPress: 2.0.0
- Deprecated in WordPress: —
Description
Determines whether the query is for an existing attachment page.For more information on this and similar theme functions, check out
the {@link Conditional Tags} article in the Theme Developer Handbook.