投稿内に添付画像を表示したい..
<a href"LINK TO FULL SIZE IMAGE"><img src"LINK TO THUMB"></img></a>
私はcodex.wordpressから次のように取得しますが、コードに大きな画像リンク<href
とサムリンクを使用するように指示する方法<img
<?php
$attachment_id = 8; // attachment ID
$image_attributes = wp_get_attachment_image_src( $attachment_id ); // returns an array
?>
<img src="<?php echo $image_attributes[0]; ?>" width="<?php echo $image_attributes[1]; ?>" height="<?php echo $image_attributes[2]; ?>">