My attachment page uses
wp_get_attachment_image_src(), which doesn't include the alt text.
<div class = "entry"> <?php if ( wp_attachment_is_image( $post->id ) ) : $att_image = wp_get_attachment_image_src( $post->id, "large");?> <a href="<?php echo wp_get_attachment_url($post->id); ?>" title="<?php the_title(); ?>" rel="attachment"> <img class="attached_img" src="<?php echo $att_image;?>" width="<?php echo $att_image;?>" height="<?php echo $att_image;?>" class="attachment-medium" alt="<?php $post->post_excerpt; ?>" /> </a> } <?php endif;?> </div>
<div class = "entry"> <a href="http://www.example.com/wp-content/uploads/2010/07/photo_namejpg" title="My_Photo_Title" rel="attachment"> <img class="attached_img" src="http://www.example.com/wp-content/uploads/2010/07/photo_name_and_size.jpg" width="393" height="500" class="attachment-medium" alt="" /> </a> </div>
I'm aware that the
$post->post_excerpt is being called in the above code, but I am not sure what to replace it with to get the image's alt attribute.