WordPress.org

Support

Support » How-To and Troubleshooting » Media Uploader WP 2.5 – Caption and Description

Media Uploader WP 2.5 – Caption and Description

  • Can anyone tell me what the function of the Caption and Description boxes in the WordPress 2.5 Media Uploader are? Neither of them show up near an image in the default theme. (I’ve noticed however, that the image Title shows up on hover on a Mac using Firefox.)

    My assumption is that the description is for accessibility/if the image doesn’t load, but shouldn’t there be a way to add a conditional comment into my theme’s template to call the caption if present?

    Does anyone know the line of code I’d need to add and where to add it? I’d know how to style it out if I also knew a way to add a Div or Class element to it as well.

    And yes, I’ve looked at plugins that add a caption to an image – that’s not what I’m looking for, if I can just add a call to the information I put into the uploader box in the “caption” field.

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’m having the same issue. Can someone shed some light please?

    If you link an image to “post” instead of to the image file, the caption and description both show up on that resulting page.

    I spent quite a bit of time trying to find out how to do this. Seems like a lot of people want this functionality, but it’s hard to find anyone that’s done it. What worked for me is to modify the code here.

    And use $attachment->post_content to get the description. The full block of code that worked for me on my archive.php is

    <?php
    
    $args = array(
    	'post_type' => 'attachment',
    	'numberposts' => null,
    	'post_status' => null,
    	'post_parent' => $post->ID
    	);
    $attachments = get_posts($args);
    if ($attachments) {
    	foreach ($attachments as $attachment) {
    		echo $attachment->post_content;
    
    	}
    }
    
    ?>

    Hope that helps

    You can use the caption and description information neatly in plugins like Viva Zoom http://www.mediatricks.biz/zoom that uses HS to pop out your image and show the extra info.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Media Uploader WP 2.5 – Caption and Description’ is closed to new replies.
Skip to toolbar