在循环中尝试以下代码,并根据需要对其进行修改。
$thumb_id = get_post_thumbnail_id();
echo \'Name = \'. get_post_field( \'post_name\', $thumb_id ).\'<br />\';
echo \'Alt = \'. get_post_meta( $thumb_id, \'_wp_attachment_image_alt\', true ).\'<br />\';
echo \'Title = \'. get_the_title( $thumb_id ).\'<br />\';
echo \'Caption = \'. get_post_field( \'post_excerpt\', $thumb_id ).\'<br />\';
echo \'Description = \'. get_post_field( \'post_content\', $thumb_id ).\'<br />\';
echo \'SRC = \'. wp_get_attachment_url( $thumb_id ).\'<br />\';
echo \'URL = \'. get_permalink( $thumb_id ).\'<br />\';