Support » Fixing WordPress » Working with [caption id=”attachment_###”

  • I am using MarsEdit (OSX stand-alone blogging software) to publish to my WP blog and have everything working with the exception of one issue I am just confused about.

    I use captions for all embedded images in my posts and love the feature. The first part of the caption code reads:

    [caption id="attachment_###" where “###” is a seemingly random number. How is that number generated (where does it come from)? Is it necessary for posting new photos with captions? While MarsEdit lets me template how each image is inserted, I don’t know what number to put in this part of the code.

    I found this documentation (via:
    http://faq.wordpress.com/2008/07/24/image-settings-titles-descriptions-captions-etc/):

    Image Settings – Titles, Descriptions, Captions, etc.

    You can add captions to your images by using the “Image Caption” field in the “Add an Image” or the “Edit Image” window.

    WordPress Heart Button
    When you add a caption to an image, caption shortcode is inserted into the source code. The caption is also used as the alternate text for the image by default. Here is the source code for the image above right after inserting it.

    [caption id="attachment_945" align="aligncenter" width="161" caption="WordPress Heart Button"]<a href=”http://faq.files.wordpress.com/2008/07/dandy-pink.png”><img class=”size-full wp-image-945″ src=”http://faq.files.wordpress.com/2008/07/dandy-pink.png” alt=”WordPress Heart Button” width=”161″ height=”142″ /></a>[/caption]

    Unfortunately, this doesn’t tell me why the number “945” is used in both places above. Any takers please?

  • The topic ‘Working with [caption id=”attachment_###”’ is closed to new replies.