Image
Image objects represent image attachments in WordPress. You don't access images directly as a root provider — instead, they appear when you chain into an image field from another provider.
How you get an Image object:
{{ post.thumbnail }} <!-- Featured image -->
{{ site.icon }} <!-- Site icon -->
{{ item.thumbnail }} <!-- Featured image inside a Loop -->
Once you have an Image object, all the fields below are available.
All Fields
| Field | Arguments | Returns | Description |
|---|---|---|---|
id | — | int | Attachment ID |
title | — | string | Image title |
name | — | string | Image name (alias for slug) |
slug | — | string | Attachment slug |
caption | — | string | Image caption |
status | — | string | Attachment status |
src | size | string | Image URL |
srcset | size | string | Srcset attribute value |
img_sizes | size | string | Sizes attribute value |
width | — | int | Width in pixels |
height | — | int | Height in pixels |
aspect | — | float | Aspect ratio |
alt | — | string | Alt text |
sizes | — | array | Available sizes metadata |
mime_type | — | string | MIME type (image/jpeg, etc.) |
file | — | string | Relative file path |
file_loc | — | string | Absolute file path |
extension | — | string | File extension |
size | — | int | File size in bytes |
content | — | string | Attachment description |
excerpt | — | string | Attachment caption |
link | — | string | Attachment page URL |
path | — | string | Attachment page path |
edit_link | — | string | Admin edit URL |
date | format | string | Upload date |
time | format | string | Upload time |
timestamp | — | int | Unix timestamp |
modified_date | format | string | Modified date |
modified_time | format | string | Modified time |
modified_timestamp | — | int | Modified unix timestamp |
author | — | User | Uploader |
parent | — | Post | Parent post |
can_edit | — | bool | Current user can edit |
meta | field_name | mixed | Image meta value |
raw_meta | field_name | mixed | Unescaped meta value |
has_field | field_name | bool | Check if field exists |
Image Source
The src field accepts an optional size parameter:
{{ post.thumbnail.src }} <!-- Full size URL -->
{{ post.thumbnail.src('thumbnail') }} <!-- 150x150 -->
{{ post.thumbnail.src('medium') }} <!-- 300px max -->
{{ post.thumbnail.src('medium_large') }} <!-- 768px max -->
{{ post.thumbnail.src('large') }} <!-- 1024px max -->
{{ post.thumbnail.src('custom-size') }} <!-- Custom registered size -->
For responsive images:
{{ post.thumbnail.srcset }}
{{ post.thumbnail.img_sizes }}
Dimensions
{{ post.thumbnail.width }}
{{ post.thumbnail.height }}
{{ post.thumbnail.aspect }}
Metadata
{{ post.thumbnail.alt }}
{{ post.thumbnail.mime_type }}
{{ post.thumbnail.sizes }}
File Info
{{ post.thumbnail.file }}
{{ post.thumbnail.extension }}
{{ post.thumbnail.size }}
Content
{{ post.thumbnail.content }} <!-- Description -->
{{ post.thumbnail.excerpt }} <!-- Caption -->
URLs
{{ post.thumbnail.link }} <!-- Attachment page URL -->
{{ post.thumbnail.edit_link }}
Dates
{{ post.thumbnail.date('F j, Y') }}
{{ post.thumbnail.timestamp }}
{{ post.thumbnail.modified_date('Y-m-d') }}
Author & Parent
{{ post.thumbnail.author.name }}
{{ post.thumbnail.parent.title }}
Custom Fields (Meta)
{{ post.thumbnail.meta('photographer') }}
{{ post.thumbnail.meta('copyright') }}
{{ post.thumbnail.has_field('credit') }}
Note: Private meta keys (starting with _) are blocked for security.
Common Patterns
Responsive image
<img
src="{{ post.thumbnail.src('large') }}"
srcset="{{ post.thumbnail.srcset }}"
sizes="{{ post.thumbnail.img_sizes }}"
alt="{{ post.thumbnail.alt }}"
width="{{ post.thumbnail.width }}"
height="{{ post.thumbnail.height }}"
>
Featured image with fallback
{{ post.thumbnail.src('large') ?? '/default-image.jpg' }}
Alt text with fallback
{{ post.thumbnail.alt ?? post.thumbnail.title ?? 'Image' }}
Site icon
{{ site.icon.src('thumbnail') }}