WordPress.org

Ready to get started?Download WordPress

Codex

Caption Shortcode

The Caption feature allows you to wrap captions around content. This is primarily used with individual images

[caption]<image> Caption[/caption]

Practical usage is like this:

[caption id="attachment_6" align="alignright" width="300"]<img src="http://localhost/wp-content/uploads/2010/07/800px-Great_Wave_off_Kanagawa2-300x205.jpg" alt="Kanagawa" title="The Great Wave" width="300" height="205" class="size-medium wp-image-6" /> The Great Wave[/caption]

Which looks like this:

Options

The following basic options are supported:

id
A unique HTML ID that you can change to use within your CSS.
align
The alignment of the caption within the post. Valid values are: alignnone (default), aligncenter, alignright, and alignleft.
width
How wide the caption should be in pixels. This attribute is required and must have a value greater than or equal to 1.

Source File

The caption shortcode is located in wp-includes/media.php.

Resources